Hi all, In light of all the discussion recently this may be off topic now ;-) Just a few code snippets I discovered in the last two weeks while writing some new software. if RAMx > Y movf RAMx,w addlw 255 - Y ; eg if RAMx > 5 ... addlw d'250' btfsc status,carry goto True if RAMx < Y movf RAMx,w addlw 255 - Y + 1 ; eg if RAMx < 5 ... addlw d'251' btfss status,carry goto True if RAMx >= Y movf RAMx,w addlw 255 - Y + 1 ; eg if RAMx >= 5 ... addlw d'251' btfsc status,carry goto True if RAMx <= Y movf RAMx,w addlw 255 - Y ; eg if RAMx <= 5 ... addlw d'250' btfss status,carry goto True -- Best regards Tony http://www.picnpoke.com Email sales@picnpoke.com