MOV和LEA有什么区别? [英] What is the difference between MOV and 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 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有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!