x86 lea instruction
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?
if these instructions appear in sequence as in this example, the eax register is overwritten once the second line executes?
Yes (it is overwritten after both instructions)
And what exactly would be loaded into the register? Another address?
The memory address described by EDX + the offset stored as value in EDX multiplied by 2
链接地址: http://www.djcxy.com/p/72386.html上一篇: LEA指令在只使用位移时会做什么?
下一篇: x86 lea指令