PDA

View Full Version : Reverse Bit Order?



Art
- 23rd January 2010, 13:04
Hi Guys,
I made a cool 144 LED scroller in the last 36 hours:
http://www.youtube.com/watch?v=4it2ISHoh0k

I have definitions made up for characters that appear upside down,
so I need to reverse the order of every bit in a byte to compensate for this.
Is there a way that's better than moving bits to a new byte ?
At the moment that's taking 8 lines (one for each bit in the byte).
Cheers, Art.

HenrikOlsson
- 23rd January 2010, 15:21
Art,
There is the REV command/operator, does that do what you want?

/Henrik.

mackrackit
- 23rd January 2010, 15:26
Maybe this will work for you?


BITS VAR BYTE
BITS = %10101010

START:
LCDOUT $FE,1,BIN BITS
BITS = BITS REV 8
LCDOUT $FE,$C0,BIN8 BITS
END


echo of Henrik

Art
- 23rd January 2010, 22:52
Thanks :) Ten words cheaper than handling the bits individually.