LC-3 instruction set. Help needed

492 Views Asked by At
  1. Using only one LC-3 instruction, how would I move the value in Register 2 into Register 3

  2. How to perform R1 = R2 - R3 using only 3 LC-3 instructions?

Hope you can help. Thanks

1

There are 1 best solutions below

0
On

First question:

ADD R3, R2, #0   // Store (R2 + 0) in R3

Second question:

NOT R1, R3
ADD R1, R1, #1   // Form the two's complement of R3 and store in R1
ADD R1, R1, R2   // Add R2 to R1