>Tony Matthews wrote: >> >> Is there a simple (short) way to reverse the order of bits in a byte. >> or even better a nibble in the middle of a byte ? Thanks > > >Here's something David Tait and Steve Hardy posted almost a >year ago. > >> From: David Tait >> [cut] I have been following the discussion on reversing the order of bits in a byte and wonder if the following has been suggested: clrw btfsc NORMAL,7 iorlw b'00000001' btfsc NORMAL,6 iorlw b'00000010' btfsc NORMAL,5 iorlw b'00000100' btfsc NORMAL,4 iorlw b'00001000' btfsc NORMAL,3 iorlw b'00010000' btfsc NORMAL,2 iorlw b'00100000' btfsc NORMAL,1 iorlw b'01000000' btfsc NORMAL,0 iorlw b'10000000' movwf NORMAL ;save reversed byte on top of original It takes 2 more instructions than other methods mentioned but saves 1 RAM. On the smaller parts, this may be a worthwile tradeoff. Dwayne Reid Trinity Electronics Systems Ltd Edmonton, Alberta, CANADA (403) 489-3199 voice (403) 487-6397 fax