On Thu, Aug 10, 2006 at 10:09:13AM +0100, Steve Smith wrote: > Guys; > Is there an easy way of doing the following?? > > (16F877) > > Movlw (variable 0-7) > > Bsf register,W > > Or > > Btfsc register,W > > Specifically for addressing various pins depending on the result of a test Nope. I had to implement such an operation for my NPCI interpreter. I ended up with a jump table that set the bit then returned. Let me see if I can fish out the code right quick... Here's a snippet: movf command,W ; Get the value, already shifted 1 bit to the left. addwf PCL,F ; Computed goto to change the correct bit bcf INDF,0 ; Clear bit 0 return ; All done. bcf INDF,1 ; Clear bit 1 return ; All done. bcf INDF,2 ; Clear bit 2 return ; All done. bcf INDF,3 ; Clear bit 3 return ; All done. bcf INDF,4 ; Clear bit 4 return ; All done. Hope this helps, BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist