Have you noticed the Status register!!!! The carry bit is set in one but not in the other... This makes subtraction and addition susceptible to errors... Clear the carry before any maths...
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
;Initialize (clear) RAM: GPR(0x20 - 0x35) and Common Ram
CLRF FSR0H ; |B0
MOVLW 0x20 ; |B0
MOVWF FSR0 ; |B0
Clr_GPR
CLRF INDF0 ; |B0
INCF FSR0
MOVLW 0x35 ; |B0
XORWF FSR0,w ; |B0
BTFSS STATUS,z ; |B0
GOTO Clr_GPR ; |B0
MOVLW 0x70 ; |B0
MOVWF FSR0
Clr_CRAM
CLRF INDF0 ; |B0
INCF FSR0
MOVLW 0x7F ; |B0
XORWF FSR0,w ; |B0
BTFSS STATUS,z ; |B0
GOTO Clr_CRAM ; |B0
NOP