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
This was a comment but I thought WTH!
To save space over the 256 byte table you can have a 16 byte table containing the values for four bits (nibbles) at a time. The algorithm then would be
revval=(revdigit[inval&0x0f]<<4)|
revdigit[inval>>4];
If I were a prof I'd certainly like the two parts where one shift is in the indexing and the other outside.