Bob Segrest wrote: >Can >anyone provide me with a sixteen bit subtraction routine example ??? Try these: ;******************************************************************* ; Two byte subtract. ; At exit, if C = 1, result is positive. ; Usage example: sub_word new_count, old_count ; Note: Zero flag NOT valid at exit ;******************************************************************* sub_word: macro aaa, bbb movf (bbb+1), w subwf (aaa+1), f movf (bbb), w skpc incfsz (bbb), w subwf (aaa), f endm ;******************************************************************* ; Subtract two byte literal. ; At exit, C = 0 if result is negative ; Note: Zero flag NOT valid at exit ;******************************************************************* sub_word_literal: macro aaa, lll movlw low (~(lll) + 1) addwf aaa+1, f movlw high ((~(lll) + 1) & h'ffff') skpnc addlw 1 skpnc skpz addwf aaa, f endm ;******************************************************************* -- Bob Fehrenbach Wauwatosa, WI bfehrenb@execpc.com