x86 lea指令
我试图很好地掌握 x86 中的 LEA 指令:
leal (%edx, %edx, 4), %eax
leal (%edx, %edx, 2), %eax
鉴于这两行,我知道:
eax = edx + edx*4
然后
eax = edx + edx*2 两个问题
。首先,如果这些指令像本例中那样按顺序出现,那么一旦第二行执行,eax寄存器就会被覆盖吗?到底什么会被加载到寄存器中?另一个地址?或者这是对这些寄存器指向的值进行算术运算?
I am trying to get a good grip on the LEA instruction in x86:
leal (%edx, %edx, 4), %eax
leal (%edx, %edx, 2), %eax
Given these two lines, i know that:
eax = edx + edx*4
and then
eax = edx + edx*2
Two questions. First, if these instructions appear in sequence as in this example, the eax register is overwritten once the second line executes? And what exactly would be loaded into the register? Another address? Or is this doing arithmetic on the values that these registers point to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是(两条指令后都会被覆盖)
EDX 描述的内存地址 + EDX 中存储为值的偏移量乘以 2
Yes (it is overwritten after both instructions)
The memory address described by EDX + the offset stored as value in EDX multiplied by 2