I have a 16bit subtract code. Can I tell one of the values greater or less than by looking at the CARRY bit?
I dont need the result I need to know what value is bigger or less.
I dont need the result I need to know what value is bigger or less.
Code:
Num_L,Num_H =value to be subtracted
NumF_L,NumF_H =fix value
[Num_H] [Num_L]= [Num_H] [Num_L] - [NumF_H] [NumF_L]
Sub16 movf NumF_L,W
subwf Num_L,F
movf NumF_H,W
btfss STATUS,C
addlw .1
subwf Num_H,F
btfss STATUS,C
;if carry set [Num_H] [Num_L] bigger
;if carry not set [NumF_H] [NumF_L] bigger