From: anonymous c. <nas...@ya...> - 2003-11-09 15:21:02
|
> - NASM does not add the prefixe 66H before POPF and POPA. That's because PUSHA/POPA and PUSHF/POPF default to the current operand size, which either depends on your output format, or the most recent BITS assembler directive. Use an explicit O16 or O32 prefix, if you want the non-default. For -f elf you will get: 1 00000000 60 pusha 2 00000001 6660 o16 pusha 3 00000003 60 o32 pusha 4 5 00000004 9C pushf 6 00000005 669C o16 pushf 7 00000007 9C o32 pushf 8 9 [bits 16] 10 11 00000008 60 pusha 12 00000009 60 o16 pusha 13 0000000A 6660 o32 pusha 14 15 0000000C 9C pushf 16 0000000D 9C o16 pushf 17 0000000E 669C o32 pushf 18 19 [bits 32] 20 21 00000010 60 pusha 22 00000011 6660 o16 pusha 23 00000013 60 o32 pusha 24 25 00000014 9C pushf 26 00000015 669C o16 pushf 27 00000017 9C o32 pushf Whereas for e.g. -f bin you will get: 1 00000000 60 pusha 2 00000001 60 o16 pusha 3 00000002 6660 o32 pusha 4 5 00000004 9C pushf 6 00000005 9C o16 pushf 7 00000006 669C o32 pushf 8 9 [bits 16] 10 11 00000008 60 pusha 12 00000009 60 o16 pusha 13 0000000A 6660 o32 pusha 14 15 0000000C 9C pushf 16 0000000D 9C o16 pushf 17 0000000E 669C o32 pushf 18 19 [bits 32] 20 21 00000010 60 pusha 22 00000011 6660 o16 pusha 23 00000013 60 o32 pusha 24 25 00000014 9C pushf 26 00000015 669C o16 pushf 27 00000017 9C o32 pushf As you can see, for ELF the default is 32-bit, whereas for BIN it is 16-bit. You can use [BITS] to change it, and you can use O16 and O32 to get the non-default. Or to put it another way: don't bother with those W and D suffix variants... just like a real x86 chip. __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree |