Just to add... this is what you see when using the addt'l 'save(0, fsr1, fsr2, wreg)'
Code: Select all
dim b as byte
interrupt isr()
save(0, fsr1, fsr2, wreg)
b = 0 // dummy code so the isr isn't empty
restore
end interrupt
enable(isr)
Code: Select all
; ISR
ISR_L00000000
// fast shadow isr automatically saves STATUS, BSR, and WREG
MOVLB 0
// save (0, FSR1, FSR2, WREG)...
// save FSR1
MOVFF _FSR1L#M0_U16H,F0_U16H
MOVFF _FSR1L#M0_U16,F0_U16
// save FSR2
MOVFF _FSR2L#M0_U16H,F2_U16H
MOVFF _FSR2L#M0_U16,F2_U16
// save WREG
MOVWF F4_U08,0
// save system vars (save(0))
// save FSR0 since it's used to save the system block
MOVFF FSR0L,F5_U08
MOVFF FSR0H,F6_U08
LFSR 0,F7_U200
CLRF FSR1L,0
CLRF FSR1H,0
MOVLW 25
MOVFF POSTINC1,POSTINC0
DECFSZ WREG,1,0
BRA $ - 6
// and PROD reg
MOVFF PRODL,F32_U08
MOVFF PRODH,F33_U08
?I000000_F000_000005_P000001 ; L#MK B = 0 // DUMMY CODE SO THE ISR ISN'T EMPTY
CLRF M0_U08,0
// restore...
// restore PROD
MOVFF F33_U08,PRODH
MOVFF F32_U08,PRODL
// restore system vars
CLRF FSR0L,0
CLRF FSR0H,0
LFSR 1,F7_U200
MOVLW 25
MOVFF POSTINC1,POSTINC0
DECFSZ WREG,1,0
BRA $ - 6
// restore FSR0
MOVFF F6_U08,FSR0H
MOVFF F5_U08,FSR0L
// restore WREG
MOVF F4_U08,0,0
// restore FSR2
MOVFF F2_U16H,_FSR2L#M0_U16H
MOVFF F2_U16,_FSR2L#M0_U16
// restore FSR1
MOVFF F0_U16H,_FSR1L#M0_U16H
MOVFF F0_U16,_FSR1L#M0_U16
?I000001_F000_000007_P000001 ; L#MK END INTERRUPT
// fast shadow return restores STATUS, BSR, and WREG
RETFIE 1
If you leave out saving WREG using 'save(0, FSR1, FSR2)', the only thing that gets dropped out is the
Code: Select all
// save WREG
MOVWF F4_U08,0
...
// restore WREG
MOVF F4_U08,0,0
....
but WREG is saved/restored by the fast shadow feature