> I am trying to separate ASCII digits 0-9 to hex 0-9. First thing you should do is start with a decent problem statement. This one is just gibberish. What do you mean by separate? What does it mean to separate it "to hex"? It looks like you really just want to determine whether a byte value represents an ASCII character in the range of "0" to "9". If so, two compares is all you need: ; ; Jump to BAD if value in W is not an ASCII character from "0" ; to "9", otherwise fall thru with the 0-9 digit value in REG0. ; REG0 is trashed if the character was out of range. ; addlw -"0" ;make 0-9 digit value if within range movwf reg0 ;save digit value btfsc reg0, 7 ;char was not below range ? goto bad ;was below range sublw 9 ;compare to max valid value skip_wle ;within range ? goto bad ;no ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu