;***** VARIABLE DEFINITIONS
w_temp EQU 0x20 ; variable used for context saving
w_temp1 EQU 0xA0 ; reserve bank1 equivalent of w_temp
status_temp EQU 0x21 ; variable used for context saving
;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
bcf STATUS,RP0 ; ensure file register bank set to 0
movwf status_temp ; save off contents of STATUS register
; isr code can go here or be located as a call subroutine elsewhere
bcf STATUS,RP0 ; ensure file register bank set to 0
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt