在 IA32 下如何将 0 移动到 ax 有很多可能性...
lea eax, [0]
mov eax, 0FFFF0000h //All constants form 0..0FFFFh << 16
shr ax, 16 //All constants form 16..31
shl eax, 16 //All constants form 16..31
也许是最奇怪的......:)
@movzx:
movzx eax, byte ptr[@movzx + 6] //Because the last byte of this instruction is 0
并且也在 32 位模式下(较长的指令将最终(最重要的)地址字节放在后面)...
@movzx:
movzx ax, byte ptr[@movzx + 7]
Edit:
对于 16 位 x86 cpu 模式,未测试...:
lea ax, [0]
and...
@movzx:
movzx ax, byte ptr cs:[@movzx + 7] //Check if 7 is right offset
The cs:前缀是可选的,以防ds段寄存器不等于cs段寄存器。