PICDEM™ 17 Demonstration Board User’s Guide
DS39024B-page 32
2001 Microchip Technology Inc.
;-----------------------------------------------------------;
_PIV_prolog
;Save BSR and WREG
movfp BSR, PCLATH
clrf BSR, 1
movpf PCLATH, save_BSR
;Service the interrupt by calling the interrupt
;handling function
goto _PIV_2
_PIV_1
BANKSEL fpPIV
movfp fpPIV+1, PCLATH
movfp fpPIV, PCL
_PIV_2
call _PIV_1 ; push address of next instruction on
stack
;Restore WREG and BSR
clrf BSR, 1 ;BSR was saved in bank 0
movfp save_BSR, BSR ;Now restore it
movfp save_WREG, WREG ;and WREG as well.
;Restore PCLATH and ALUSTA
movfp save_PCLATH, PCLATH
movfp save_ALUSTA, ALUSTA
;Return from interrupt
RETFIE
;-----------------------------------------------------------;
END