Dennis Crawley wrote: > I wonder if is possible to rotate a 1 in a nibble with out an auxiliary > register and without change the other nibble. This is my approach with a > temporary register, rotating the high. > > movfw Reg ;Reg= 0001.efgh > andlw 0xf0 ; > movwf Tmp ; > rlf Tmp,F ; > btfsc STATUS,C ; > bsf Tmp,4 ; > movlw 0x0f ;Clean before write > andwf Reg,F ; > movfw Tmp ; > iorwf Reg ,F ;Reg= 0010.efgh movf reg, w ;get entire register to rotate high nibble of andlw b'11110000' ;mask in high nibble only addwf reg ;double high nibble to shift it 1 bit left skip_ncarr ;the 1 bit didn't shift out the MSB ? bsf reg, 4 ;it did, start a new 1 bit in LSB That's 5 instructions. Scott can probably do it in 5 or 6 less. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics