Hello Philip. Wish you Happy New Year too ! :-) > I have a question about bit manipulation. > What I have is an input that reads '11010000' say. What I need to do is > convert it to '00001101' say. > > One route seems to be to RRNCF four times. Would this do the job and not > affect any other registers? > > Is there a better way to bit mask to create the desired result? As i understand you want to move bits in following sequence: bit_7 => bit_3 bit_6 => bit_2 bit_5 => bit_1 bit_4 => bit_0 This is may be done by executing SWAPF FILE,F Another variant is to using RRF FILE,F or RLF FILE,F commands series: Due to PIC16Cxx have no RRNCF instruction you should apply additional command before (see example) RRF FILE,W ;copy FILE.0 to Carry RRF FILE,F RRF FILE,F ; do it as many times as you need There are also another trick was described by John Payson some times ago (i admire him ability to find non-standart solution :-) To swap 7<->0 6<->1 5<->2 4<->3 do the following sequence: MOVFW FILE BTFSC FILE,7 XORLW 0b10000001 BTFSC FILE,0 XORLW 0b10000001 BTFSC FILE,6 XORLW 0b01000010 BTFSC FILE,1 XORLW 0b01000010 BTFSC FILE,5 XORLW 0b00100100 BTFSC FILE,2 XORLW 0b00100100 BTFSC FILE,4 XORLW 0b00011000 BTFSC FILE,3 XORLW 0b00011000 MOVWF FILE WBR Dmitry.