-----Original Message----- From: William Chops Westfield To: PICLIST@MITVMA.MIT.EDU Date: Thursday, 30 October 1997 18:04 Subject: Re: Challenge: Reverse 7 bits >There is a clever algorithm for bit reversal "discovered" at MIT (I >think) a long time ago. Do: > > mult a,#100040020001 ;Make some copies > and a, #210210210010 ; select some bits > div a, #377 ; cast out / squeeze... > >All the numbers are octal. The words are 36 bits long and the initial >multiply is allowed to get an arithmatic overflow. >Three instuctions. Five words (36 bits each). Totally inapplicable to >the PIC, but pretty weird... > Typical assembly comments! Anyone care to explain it? MikeS