Hi I have this 2 Digit decrement code inside ISR. When both variables (Digit1 & Digit2) value = 0 it must turn ON the output. I want to confirm is it ok or not?
Thanks
Thanks
Code:
decf Digit1,F ;decrement Digit1 value
movf Digit1,W
xorlw 00h ;check Digit1 = 0?
btfss STATUS,Z
goto Decr
movf Digit2,W ;yes then check Digit2 = 0?
xorlw 00h
btfss STATUS,Z
goto Decr
goto Finish ;yes both are = 00 then goto output
Decr btfss Digit1,7 ;check Digit1 has gone negative?
goto Away
movlw .9
movwf Digit1
decf Digit2,F ;decrement Digit2 value
btfss Digit2,7 ;check Digit2 has gone negative?
goto Away
Output clrf Digit2
clrf Digit1
bsf PORTA,3 ;Yes both are zero turn ON RA3