Hi all, "Paul B. Webster VK2BZC" wrote: > Pick another register as pointer, let's call it "ptr". > > clrc > movlw 1 > btfsc ptr,1 > movlw 4 > movwf mask > btfsc ptr,0 > rlf mask,F > btfsc ptr,2 > swapf mask,F ; or W if you need that > Concept not original, copied from Dimitry amongst others. I think the original version (1 cycle less) goes like this: movlw 1 btfsc ptr,1 movlw 4 movwf mask btfsc ptr,0 addwf mask,f btfsc ptr,2 swapf mask,f The 'rlf' is replaced with an 'addwf' thus 'clrc' is not needed anymore. I had also posted a 32 bit version last week for the led bar solution. I copied the technique for a part. The code is also found on the website below. regards, Reggie -- e-mail: rberdin@bigfoot.com ICQ#: 31651436 URL: http://www.bigfoot.com/~rberdin