【发布时间】:2013-01-21 14:53:24
【问题描述】:
test.asm:
org 0100h
[BITS 16]
mov eax, 0
[BITS 32]
mov eax, 0
然后编译反汇编如下:
nasm test.asm -o test.com
ndisasm -o 0x0100 test.com
结果:
00000100 66B800000000 mov eax,0x0
00000106 B80000 mov ax,0x0
00000109 0000 add [bx+si],al
所以从结果中,我们可以看到[BITS 16]使用eax,[BITS 32]使用ax,为什么?结果该不该翻?
【问题讨论】:
-
当您混合 16 位和 32 位代码时,不只是 ndisasm 混乱吗?
B800000000在 32 位模式下将是mov eax, 0。
标签: assembly x86 nasm disassembly