1

I am writing routines for LC3 simulator, I have successfully wrote Shift Right routine, but I am now stuck with Rotate Right routine, it should move bits right and during each move to the right the least significant bit is copied into the most significant bit. I have AND, NOT, ADD operations, data movement operations, seven registers to store values and whole range of memory. I just need some basic ideas how it could be implemented.

edi
  • 47
  • 1
  • 1
  • 9

1 Answers1

0

You can test the LSB by performing an AND operation against 0x01. If the result is 1, you want the MSB to become 1, which you can do by ADDing 0x80.

aqua
  • 617
  • 4
  • 12