It works ok, thank you all !! Regards, Carlos >> #define _ABABABAB b'01010101 ; or whatever >> >> movlw 0xfc ; bit 0,1 are low >> >> btfsc number,0 ; LSB set? >> movlw 0xf3 ; bit 2,3 are low >> btfsc number,1 ; Bit 1 set? >> movlw 0xcf ; bit 4,5 are low >> >> ; write the _AB_ bit pattern >> andwf var,f ; clear the dest bits >> xorlw 0xff ; complement the bit mask >> andlw _ABABABAB ; select the two desired AB's >> iorwf var,f ; write them -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body