zero out top 32 bits of 64-bit register

[亡魂溺海] 提交于 2019-11-29 07:24:18

movl %eax, %eax or mov eax, eax, depending on the assembler in use.

see: Intel® 64 and IA-32 Architectures - Software Developer’s Manual, Volume 1, 3.4.1.1 : General-Purpose Registers in 64-Bit Mode.

32-bit operands generate a 32-bit result, zero-extended to a 64-bit result in the destination general-purpose register.

I should also add, in regards to @HansPassant's comment: 7.3.1.7 :

The MOVSXD instruction operates on 64-bit data. It sign-extends a 32-bit value to 64 bits.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!