问题描述
我想知道这些说明有什么区别:
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 AddressMOV
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 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!