2001 Microchip Technology Inc.
DS39024B-page 29
Using the MPLAB
®
C17 C Compiler
RES 1 ;ALUSTA
RES 1 ;CPUSTA
;-- Bank 3
INTSAVE_SEC3 UDATA SAVEINT 0x301
RES 1 ;WREG
RES 1 ;ALUSTA
RES 1 ;CPUSTA
;-----------------------------------------------------------;
;***********************************************************;
VARIABLES UDATA_OVR
;-----------------------------------------------------------;
; These are the function pointers that have the i.s.r. addresses.
;
fpINT RES 2
fpTMR0 RES 2
fpT0CKI RES 2
fpPIV RES 2
GLOBAL fpINT, fpTMR0, fpT0CKI, fpPIV
;-----------------------------------------------------------;
;***********************************************************;
_INT_sec CODE H’4008’
;-----------------------------------------------------------;
; Save ALUSTA
movpf ALUSTA, save_ALUSTA ; must save ALUSTA before others
movpf WREG, save_WREG ; temporarily save off WREG
; Branch to prolog
movlw HIGH _INT_prolog
movwf PCLATH
movlw LOW _INT_prolog
movwf PCL
;-----------------------------------------------------------;
;***********************************************************;
_TMR0_sec CODE H’4010’
;-----------------------------------------------------------;
; Save ALUSTA
movpf ALUSTA, save_ALUSTA ; must save ALUSTA before others
movpf WREG, save_WREG ; temporarily save off WREG
; Branch to prolog
movlw HIGH _TMR0_prolog
movwf PCLATH
movlw LOW _TMR0_prolog
movwf PCL
;-----------------------------------------------------------;
;***********************************************************;
_T0CKI_sec CODE H’4018’
;-----------------------------------------------------------;
; Save ALUSTA
movpf ALUSTA, save_ALUSTA ; must save ALUSTA before others
movpf WREG, save_WREG ; temporarily save off WREG