LC3 Assembly Bitwise Right Shift

后端 未结 4 527
醉话见心
醉话见心 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:54

    Wow, that's quite a minimal instruction set.

    If you have 256 bytes of memory available, then a lookup table might be the way to go.

    You could do it without data memory using a loop over each bit position, using AND to extract the bit.

提交回复
热议问题