What does a hexadecimal number, with a register in parenthesis mean in Assembly?

有些话、适合烂在心里 提交于 2019-11-28 11:46:55

问题


lea 0x1c(%ebp),%eax

So, I understand vaguely what the lea instruction does, and I know those are registers, but what is this structure: 0x1c(%ebp)? I got this code out of objdump.


回答1:


It is one of the many x86 addressing modes. Specifically, this is referred to as "displacement" addressing.

Since you said you used objdump and didn't specify that you used the -M flag, I'm going to assume this in the GAS syntax (as opposed to Intel syntax). This means that the first operand is the source, and the second operand is the destination.

The lea 0x1C(%ebp),%eax instruction means, "Take the value in %ebp, add 0x1C (28 in decimal), then store that value in %eax".



来源:https://stackoverflow.com/questions/31735903/what-does-a-hexadecimal-number-with-a-register-in-parenthesis-mean-in-assembly

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