Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Identify the addressing modes for the source and destination operands in the fol

ID: 3669605 • Letter: I

Question

Identify the addressing modes for the source and destination operands in the following instructions: a. MOVE.L (A2),D6 b. MOVE.W #$F900,(A4)+ c. MOVE.B -5(A0),-(A2) d. MOVE.B $FFFF9000,0(A2) e. MOVE.W D5,(A3)+ f. MOVE.B $7123,D1 2. Give the values for the address registers which will cause all of the following instructions to produce the same result as MOVE.L D2,$8900 a. MOVE.L D2,-15(A0) b. MOVE.L D2,(A3)+ c. MOVE.W D2,-(A1) d. MOVE.W D2,7(A2) 3. Using the memory map shown below, illustrate the contents in the destination operand (registers or memory locations) after each of the following instruction is being executed. Also calculate the effective address (EA) of the source and destination operands. Express the result in 32-bit and assume that D0=$12345678, A0=$00000003, A1 =$00000006, A2=$0000000B, and TOP=$00000009 prior to each instruction execution. a. LEA TOP,A3 b. MOVE.L -1(A0),(A1) c. MOVE.B D0,3(A2) d. LEA (A1),A0 e. MOVE.L 12, A1 f. MOVE.L TOP(AO),$A

Explanation / Answer

1. Move{.size} src,dst
MOVE copies data from one location to another. The size can be b or w or l i.e. byte, word, longword.
MOVE does not change the source location only the destination location.

a. MOVE.L (A2),D6   To move a longword of data. Here variants are used when the destination operand is an address register.
b. MOVE.W #$F900,(A4)+ Here we use immediate addressing mode for their source operand
c. MOVE.B -5(A0),-(A2)   Here source operand is in address register indirect mode.
d. MOVE.B $FFFF9000,0(A2) To move the immediate hex value of "FFFF9000" into register A2
e. MOVE.W D5,(A3)+    To move a word, Here both registers are in data register direct mode.
f. MOVE.B $7123,D1 To move a byte. Here it loads the register D1 with contents of memory at location $7123.

2. According to me here third instruction MOVE.L D2,(A3)+ would return the same result as required for Move.L D2,$8900.
If the register is involved, this type is also called data register direct Move.L D2,$8900

3. EA for source and destination operands.
LEA stands for Load Effective Address. This computes an effective address and loads the result into an address register.
LEA TOP,A3. Put the address TOP $00000009 into A3.
MOVE.L -1(A0).A1
MOVE.B D0,3(A2) Moves the prev saved bottom byte.
LEA (A1),A0 This loads the contents of another address register
MOVE.L 12,A1
MOVE.L TOP(A0),$A Data address copied.