NASM Forum > Programming with NASM
Instructions from ref.x86asm.net
(1/1)
Borneq:
I found http://ref.x86asm.net/x86reference.xml. I want to write simple disassembler based on it. What doing when encounter byte 0x98? It is multiple mnemonic http://ref.x86asm.net/geek.html#x98. When to write CBW,CWDE or CDQE ? CWDE write when is set bit D in CS segment descriptor? When write CDQE? What write when will prefix 0x66 or 0x67?
Frank Kotler:
0x67 is the address size override prefix, and doesn't come into it. That part was easy. :)
Looking at ndisasm's output (which you could do yourself), I think...
With D-bit clear, 0x98 is cbw - with the 0x66 prefix, it's cwde.
With D-bit set, it's cwde, with 0x66 it's cbw.
With a 0x48 prefix, it's cdqe.
I wouldn't bet my pacemaker on that! :)
Best,
Frank
Borneq:
--- Quote from: Frank Kotler on August 17, 2010, 10:15:21 AM ---With D-bit clear, 0x98 is cbw - with the 0x66 prefix, it's cwde.
With D-bit set, it's cwde, with 0x66 it's cbw.
With a 0x48 prefix, it's cdqe.
--- End quote ---
It is possible 0x48 and 0x66 prefix at the same time?
64-bit instruction all must have 0x48 prefix or is possible 64-bit mode when instruction is all 64-bit except that have non 64 bit prefix?
Thanks
Frank Kotler:
--- Quote ---It is possible 0x48 and 0x66 prefix at the same time?
--- End quote ---
Dunno. Try it!
I don't know much about 64-bits, Borneq. I was just going by what Ndisasm said...
Best,
Frank
Navigation
[0] Message Index
Go to full version