Hello Nick,
Nick
What is the quickest way to invert the
order of bits in an 8bit register? Currently I have data that is essentially backwards in
order...IE, LSB is in the MSB poisition and MSB is in the LSB position.....
TempVar = 11011010, I want to flip it to this FinalVar= 01011011
First off:
to invert the bits you subtract from 255
TembVar=255-TembVar
11011010 would become 00100101
Second off:
Your example is NOT a switch of LSB/MSB
11011010 would be 10101101
The Rev command could be used.... you would reverse bits.
(right out of the manual)
B0 = %10101100 REV 4 (You would use 8)
Your example shows this... Is this what you want?
Edit: (I notice Steve and I were looking at the exact same forum thread in which we were playing with reversing strings....) Steve you is fast!
DWayne
Last edited by Dwayne; - 27th July 2005 at 17:00.
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks