Two instructions provided by the 68K CISC processors are LEA (load effective address) and PEA (push an effective address on the stack). What do these instructions do, and how are they used in practice?
What will be an ideal response?
These are two powerful operations. The LEA lets you calculate an address for later use. This might seem pointless to those who program ARM processors. However, in the CISC world you can perform an operation like ADD (4,A0,D0),D2 which adds the contents of the memory location pointed at by [A0] + [D0] + 4 to register D2. You can use LEA (4,A0,D0),A1 to load the effective address into A1 and then use ADD (A1),D2 as many times as you like. Another advantage of LEA is that it can be used to generate position independent addresses, for example LEA Temp(PC),A0 to generate the PC relative address of Temp and put it in a pointer. If you move the program in memory, you do not have to re?compute addresses.
The PEA instruction does the same as LEA, except that the resulting address is pushed on the stack. PEA is useful for passing parameters to a function by address. Consider the following example of assembled C code that passes parameters by reference to a subroutine to swap them.
PEA -4(A6)
PEA -2(A6)
JSR _swap
*12 }
UNLK A6
RTS
14. W
You might also like to view...
The default table border is a single, solid, black line
Indicate whether the statement is true or false
What word would not describe an unbound control?
A) Dynamic B) Static C) Unchanging D) Decorative
A statistical function that returns the kth smallest value in a dataset.
What will be an ideal response?
Cascading Style Sheets (CSS) use special Hypertext Markup Language (HTML) tags to globally define font characteristics for a variety of page elements as well as how those elements are laid out on a Web page.
Answer the following statement true (T) or false (F)