LEA or LOAD integer?

Possible Duplicate:
What's the purpose of the LEA instruction?

Having just started assembly language I would like if someone could tell me the difference between using:

load R1,one[R0] rather than lea R1,1[R0]

when using the value in R1 only as an increment value. For the former, the data is given (one data 1) whereas for the latter data it is not.


In the first case you are loading data, in the second case you are loading an address.

Eg if R0 contains 0x1000:

      addr   data
R0 -> 0x1000 0x42
             0x48
             0x49
             0x43
             0x30

then load R1,1[R0] will load 0x4849 into R1 (assuming the load instruction is a 16 bit load, and the architecture is big endian), whereas lea R1,1[R0] will load 0x1001 into R1.

链接地址: http://www.djcxy.com/p/72380.html

上一篇: 这个lea应该做什么?

下一篇: LEA或LOAD整数?