leal(%eax,%ecx,4), %edx
Run Code Online (Sandbox Code Playgroud)
当我从我的计算机系统书中读到时,如果$ eax包含x值并且%ecx包含y,那么上面的意思是x + 4y放入%edx.
如果是的话
movl(%eax,%ecx,4), %edx
Run Code Online (Sandbox Code Playgroud)
那么上面的leal表达是不是同一个?
据我所知,leal创建了可以引用的地址,而不是像movl那样自己引用,但是
当我看到leal(%eax,%ecx,4), %edxequals x+4y进入edx注册时,那么t it mean that it 'referenced'%eax and%ecx`和提取值x和y用于计算?
nin*_*alj 12
LEA将地址计算生成的有效地址加载到寄存器中.MOV移动一些地方,在使用SIB的寻址作为源操作数,它移动的任何是在由地址计算到目标操作数生成的地址.
所以:
leal (%eax,%ecx,4), %edx ? moves %eax+%ecx*4 into %edx
movl (%eax,%ecx,4), %edx ? moves whatever is at address %eax+%ecx*4 into %edx
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11581 次 |
| 最近记录: |