Here you are:
Code:ISR: asm movwf wsave ; Save WREG swapf STATUS, W clrf STATUS ; Point to bank 0 movwf ssave ; Save STATUS movf FSR,w movwf fsave ; save FSR movf PCLATH, W ; Save PCLATH movwf psave ; get ready to jump within the ISR page movlw ((INTHAND) >> 8) ; Set PCLATH for jump movwf PCLATH btfsc INTCON, INTF goto ZeroCrossingInt T0Overflow bcf INTCON, T0IF ; clear the timer overflow flag goto EndInt ZeroCrossingInt bcf INTCON, INTF ; clear the interrupt EndInt ; restore the machine state and return from interrupts movf fsave,w movwf FSR ; restore FSR movf psave,w movwf PCLATH ; restore PCH swapf ssave,w movwf STATUS ; restore Status swapf wsave,f swapf wsave,w ; restore WREG retfie endasm




Bookmarks