MOV和LEA有什么区别? [英] What is the difference between MOV and LEA?

查看:121
本文介绍了MOV和LEA有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这些指令之间的区别是什么

I would like to know what the difference between these instructions is:

MOV AX, [TABLE-ADDR]

LEA AX, [TABLE-ADDR]

推荐答案

  • LEA表示加载有效地址
  • MOV表示负载值
    • LEA means Load Effective Address
    • MOV means Load Value
    • 简而言之,LEA加载指向您要寻址的项目的指针,而MOV加载该地址处的实际值.

      In short, LEA loads a pointer to the item you're addressing whereas MOV loads the actual value at that address.

      LEA的目的是允许用户执行非平凡的地址计算并存储结果[以供以后使用]

      The purpose of LEA is to allow one to perform a non-trivial address calculation and store the result [for later usage]

      LEA ax, [BP+SI+5] ; Compute address of value
      
      MOV ax, [BP+SI+5] ; Load value at that address
      

      仅涉及常量的地方,MOV(通过汇编程序的常量计算)有时似乎与LEA的最简单用法重叠.如果您要进行包含多个基地址等的多部分计算,那么它很有用.

      Where there are just constants involved, MOV (through the assembler's constant calculations) can sometimes appear to overlap with the simplest cases of usage of LEA. Its useful if you have a multi-part calculation with multiple base addresses etc.

      这篇关于MOV和LEA有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆