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

查看:28
本文介绍了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天全站免登陆