LC3 Assembly Bitwise Right Shift

后端 未结 4 513
醉话见心
醉话见心 2021-01-12 22:10

What I need to do it implement both a bitwise left shift, and a bitwise right shift using LC-3 Assembly. Basically, every bit has to be moved over one space in the directio

4条回答
  •  感情败类
    2021-01-12 22:47

    Assuming a leading 0 you can just divide by 2, by subtracting again and again.

    So count how often you can ADD RX, RX, #-2

    I'm sure there is also a way to work around a leading 1.

提交回复
热议问题