Ron Kreymborg wrote: > If the numbers are unsigned, and stored msb at the lower address, > you could try > > movf new+1,w ; subtract lsbs > subwf old+1,w > movf new,w ; subtract msbs > btfss status,c ; including any carry > addlw 1 > subwf old,w > btfsc status,c ; new smaller? > goto smaller ; yes > goto larger ; no Ron: I think you meant for that "BTFSC STATUS,C" to be a "BTFSS". Also, your code works for Marcel's application (12-bit subtraction), but it fails on 16-bit numbers when "new" is greater than 0xFF00. A routine that works for all 16-bit numbers is: MOVF NEWLO,W SUBWF OLDLO,W MOVF NEWHI,W SKPC INCFSZ NEWHI,W SUBWF OLDHI,W BC NEW_IS_LARGER_OR_EQUAL GOTO NEW_IS_SMALLER -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499