Hello PICmaniacs ;) Antti Lukats wrote: > > a real dirty solution: > > revbits > movwf tmp > andlw 0x08 > btfsc tmp,0 > iorlw 0x40 > btfsc tmp,1 > iorlw 0x20 > btfsc tmp,2 > iorlw 0x10 > btfsc tmp,4 > iorlw 0x04 > btfsc tmp,5 > iorlw 0x02 > btfsc tmp,6 > iorlw 0x01 > return > > RAM 1 * 30 = 30 > ROM 15 * 8 = 120 > Cycle 16 * 1 = 16 > < 25 -40 > ================== > SCORE: 126 > > should be Correct now :) Another one. ;tmp = 0ABCDEFG ; ; swapf tmp,w ;DEFG0ABC andlw 0x22 ;__F_|__B_ btfsc tmp,0 ;G ? iorlw 0x40 btfsc tmp,2 ;E ? iorlw 0x10 btfsc tmp,3 ;D ? iorlw 0x08 btfsc tmp,4 ;C ? iorlw 0x04 btfsc tmp,6 ;A ? iorlw 0x01 return ; ; 14 clocks/13 words WBR Dmitry .