; Interrupt context saving & recovery routines ; Copywright (c) 2004 Randy Gamage ORG 4 doISR ;Start of Interrupt service routine ; Variables W_TEMP, PCLATH_TEMP, and FSR_TEMP ; should be declared in the shadow RAM area ; so they are accessible from all banks movwf W_TEMP swapf STATUS,w clrf STATUS movwf STATUS_TEMP movf PCLATH,w movwf PCLATH_TEMP clrf PCLATH movf FSR,w movwf FSR_TEMP ; ; Interrupt handling routine goes here ; INTDone movf FSR_TEMP,w movwf FSR movf PCLATH_TEMP,w movwf PCLATH swapf STATUS_TEMP,w movwf STATUS swapf W_TEMP,f swapf W_TEMP,w ExitInt retfie ;Return from Interrupt