Might as well do it straight to W though, no need for temp.. clrw btfsc gpio,1 iorlw 0x08h etc.. Quentin wrote: > > It is not good practice to manipulate bits in W (don't ask me why, it > just is :)). > You can test bits on GPIO direct with out loading it in W first (ex: > BTFSC GPIO,5), so here goes: > > CLRF TEMP ;TEMP IS ANY RAM > BTFSC GPIO,1 > BSF TEMP,4 ;A > BTFSC GPIO,2 > BSF TEMP,5 ;B > BTFSC GPIO,4 > BSF TEMP,6 ;C > BTFSC GPIO,5 > BSF TEMP,7 ;D > MOVF TEMP,W ;DONE! W=DCBA0000 > > Hope this helps > Quentin