In some old versions of assemblers some new operations are not defined. How can I insert operation RDTSC (its hexadecimal value is 0F31h) into the program for TASM?

PS That's the example

model flat, stdcall

include ""

RDTSC equ 0F31h ;00001111 00110001b

MsgCaption db "Caption",0
MsgBoxText db "Text",0

RDTSC ; "Illegal instruction" message appears
;call MessageBox, NULL, offset MsgBoxText, offset MsgCaption, MB_OK
call ExitProcess, NULL
end start
Posted on 2002-03-19 09:01:00 by Mike
add db infront of the RDTSC

or define it as a macro that does it for you.

At present the assembler is effectivly trying to work out what you mean with the code:

call ExitProcess, NULL

which is un-parsable.

what you need is

db 0F31h
call ExitProcess, NULL

signifying to the parser that the number following is byte data.
The processor will then see this byte data and execute it.

Posted on 2002-03-19 09:12:46 by Mirno
Thank you, it works but I write:

dw 0F31h
call ExitProcess, NULL

Posted on 2002-03-19 10:34:46 by Mike
I don't think that will work...

I should have said:

db 0Fh, 31h

dw 0F31h

will assemble down into
db 31h, 0Fh
because of the Endian-ness of the intel processor.

Posted on 2002-03-19 11:42:32 by Mirno
Or perhaps you could just dump the cruddy old tasm assembler and
use masm ;).
Posted on 2002-03-19 12:27:57 by f0dder
All my programs I write on MASM, but sometimes I look through the another's programs on TASM. Then also it is necessary to add for example
Macro rdtsc
Db 0Fh, 31h ; operation RDTSC

Posted on 2002-03-20 06:12:09 by Mike