Hello.
The code below compares a 16 bit and an 8 bit variable.
What is not clear to me is the part after the bz diff, where xorwf and xorlw 128 are used.
What is their function?
Any suggestion\clarification on the working principle of this algorithm would be appreciated.
Thanks in advance.
Regards
The code below compares a 16 bit and an 8 bit variable.
What is not clear to me is the part after the bz diff, where xorwf and xorlw 128 are used.
What is their function?
Any suggestion\clarification on the working principle of this algorithm would be appreciated.
Thanks in advance.
Regards
Code:
; A is a 2 byte signed variable (AH A)
; B is a 1 byte signed variable (B)
; IF A>B THEN trueif
movlw 0
btfsc B,7
movlw 255
subwf AH,W
bz diff
movf AH,W
xorwf B,W
btfsc STATUS,0
xorlw 128
andlw 128
bz restofcode
bra trueif
diff
movf A,W
subwf B,W
bc restofcode
trueif
;...
restofcode
;...