Happy New Year, I was just wondering if anyone has an elegant method for determining whether two numbers are within an absolute difference, in the 12 bit PIC universe. For example... the two numbers, X & Y, are in registers which must remain unchanged are to be tested to determine whether they are within DIFF of each other. My first try this year is: MOVF X,W ;Try it this way SUBWF Y,W SKPNC ; Positive? GOTO POS ; Yes MOVF Y,W ; No, then do it the other way SUBWF X,W POS SUBWF DIFF,W ; Compare against the limit SKPNC ; The carry knows... GOTO LESS Thanks in advance, Jen :-)