首页 文章

LEA指令? [重复]

提问于
浏览
8

这个问题在这里已有答案:

是什么

lea    (%edx,%eax,1),%eax

做?

2 回答

  • 22

    它相当于“eax = edx eax * 1” .

    lea 的这种特殊情况是编写 add %edx, %eax 的低效方式;仅在您需要避免修改标志时才有用 . 但与 add 不同,输出可以是不是输入之一的寄存器,您可以执行更复杂的操作 .

    通常, lea (address expression), register 表示"compute the address expression and change the register value to that";其他指令使用地址表达式进行内存访问,即 mov (address expression), register 表示"compute the address expression and load the value from the resulting address into the register" .

  • 0

    加载有效地址 - 它相当于C一元 & 运算符 .

相关问题