Bit-reverse a byte on 68HC12

前端 未结 9 1604
挽巷
挽巷 2021-01-18 02:03

I\'m in a microprocessors class and we are using assembly language in Freescale CodeWarrior to program a 68HCS12 micro controller. Our assignment this week is to revers a by

9条回答
  •  悲哀的现实
    2021-01-18 02:57

    Hints: If you do a shift, one bit gets shifted out and a zero (probably) gets shifted in. Where does that shifted out bit go to? You need to shift that in to the other end of the destination register or memory address.

    I'm sure that 25 years ago I could do this in Z80 machine code without an assembler :)

提交回复
热议问题