Bit-reverse a byte on 68HC12

前端 未结 9 1603
挽巷
挽巷 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

    FIrst of all work out the algorithm for doing what you need to do. Express it as pseudo code or C or plain English or diagrams or whatever you are comfortable with. Once you have cleared this conceptual hurdle the actual implementation should be quite simple.

    Your CPU probably has instructions which let you shift and/or rotate a register, perhaps including the carry flag as an additional bit. These instructions will be very useful.

提交回复
热议问题