LEA

 

The load effective address instruction, LEA, calculates an effective address and loads it into an address register. This instruction can be used only with 32-bit operands. The LEA instruction is one of the most powerful instructions provided by the 68000. Two examples of its use are as follows.

Assembly language form RTL form Action
LEA $0010FFFF,A5 [A5] ¬ $0010FFFF Load the address $0010 FFFF into register A5.
LEA $12(A0,D4.L),A5 [A5] ¬ $12 + [A0] + [D4] Load contents of A0 plus contents of D4 plus $12 into A5.

In the second example, LEA $12(A0,D4.L),A5, the address evaluated from the expression $12 + [A0] + [D4] is deposited in A5. If the instruction MOVEA.L $12(A0,D4),A5 had been used, the contents of that address would have been deposited in A5.

The load effective address instruction has been provided to avoid the repeated and time-consuming calculation of effective addresses by the CPU. It is clearly more efficient to put the effective address into an address register by means of an LEA <ea>,An instruction, than to recalculate the address every time it is used. For example, if the operation ADD.W $1C(A3,D2),D0 is to be repeated many times, it is better to execute an LEA $1C(A3,D2),A5 once and then to repeat ADD.W (A5),D0.