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

9. For each of the following instructions, show the Register Transfer Notation a

ID: 3734576 • Letter: 9

Question


9. For each of the following instructions, show the Register Transfer Notation and the result in the destination register. All registers are 16-bit wide and memory addresses point to 16-bit words. All numbers are in hex. The first one has been done for y ou. Before each instruction, assume the register and memory contents are as follows: R8 0200 R9 0202 [0200] 1234 [0202) FFFE [0204) 0001 [0206] 0002 [0208]- CBEE Instruction RTN Result (dst) a) mov.w R8, R9 R9 0200 b) mov.w @R8, R9 c) mov.w R9, 4(R8) d) add.w R8, RS e) mov.w R8, &0x0206 #0x0100, 4 (R8) f) bis.w

Explanation / Answer

Below instruction moves data stored in R8 register into R9 register and that is 0200, so R9 will contain 0200 value after execution of below instruction.

1) mov w      R8, R9               R9 <-- R8             R9 = 0200

Below instruction moves data of address stored in R8 register into R9 register, so the contain of R8 is 0200 and contain of 0200 address is [0200]=1234, so finally R9 contains 1234.

2) mov w      @R8, R9            R9 <-- [R8]           R9 = 1234

Below instruction moves data of R9 register into address (4+contain of R8 register), i.e. at address 0206, so finally the address 0206 contain [0206]=0202

3) mov w      R9, 4(R8)          [4+R8] <-- R9        [204] = 0202

Below Instruction add contain of R8 register with R9 register and store it into R9 register, Finally R9 register will contain R9 = 0402.

4) add w       R8, R9               R9 <-- R8 + R9     R9 = 0402

Below Instruction mov data of R8 register to the address 0206, so finally the contain of 0206 address will be [0206] = 0200

5) mov w      R8, &0x0206      [0206] <--- R8      [206] = 0200

Below Instruction executes OR between two operands and store ouput into second operand. so the or of 0100 OR [0200+0004] => 0100 OR 0204 ==> 0304

6) bis, w       #0x0100, 4(R8)   [R8+4] <-- 0100, [204] = 0304