Does masm support ud2 opcode ?
I´m trying to rebuild a Freebasic routine, and it uses this opcode, but when trying to assemble it mas, gives me this error:
FbRtl.asm(5538) : error A2008: syntax error : ud2
The function i´m trying to create is:
fb_DevScrnRead_cold proc near
mov eax, large ds:38h
ud2
fb_DevScrnRead_cold endp
How to use this ud2 opcode ?
Guga,
That opcode does not ring a bell, can you find it in an Intel manual ?
Just use db 0Fh, 0Bh (you'll see in the debugger what it does):
include \masm32\include\masm32rt.inc
.code
start:
print "Hello World"
db 0Fh, 0Bh
inkey "That was ud2"
exit
end start
Hi JJ. Tks, but this msg came up
"FbRtl.asm(5537) : error A2206: missing operator in expression"
fb_DevScrnRead_cold proc near
mov eax, large ds:38h
; ud2
db 0Fh, 0Bh
fb_DevScrnRead_cold endp
Btw...the beginniong of the file i´,m using this:
.686
.model flat, stdcall
.xmm
option casemap :none ; case sensitive
Steve, this opcode is the same as Nop, with the only difference that it raises a opcode exception
https://mudongliang.github.io/x86/html/file_module_x86_id_318.html
I have no idea why Fb (FreeBasic) is using this, but since i´m testing to see if i can build in masm, a Runtime Library of FreeBasic, i chosen to keep the instructions as it is.
Ok, Worked after i remove the "large" command
fb_DevScrnRead_cold proc near
mov eax, ds:38h
db 0Fh, 0Bh
fb_DevScrnRead_cold endp
Tks, Steve and JJ :thumbsup: :thumbsup:
Yes, that makes sense, LARGE is an old memory model that would not be compatible with FLAT memory model, I think its a left over from the DOS era.
Quote from: hutch-- on February 22, 2022, 01:40:31 PM
... LARGE is an old memory model that would not be compatible with FLAT memory model, I think its a left over from the DOS era.
Yes this is an old left over from DOS, just like TINY, SMALL or MEDIUM for example. Under Win32 that's no longer needed.