Hardware Reference
In-Depth Information
Hier muss die eigentliche Interrupt Service Routine hinein, und dann müssen die
Register wiederhergestellt werden.
LowInt_ex
movff BSR_LOW,BSR
;restore BSR register
movff WREG_LOW,WREG
;restore working register
movff STATUS_LOW,STATUS
;restore STATUS register
retfie
Im Falle der high priority Interrupts für den USB sind eine ganze Anzahl mehr
Register zu retten.
; High priority interrupt routine
HighInt
; save working registers
movff STATUS,STATUS_HIGH
movff WREG,WREG_HIGH
movff BSR,BSR_HIGH
movff TBLPTRU,TBLPTRU_HIGH
movff TBLPTRH,TBLPTRH_HIGH
movff TBLPTRL,TBLPTRL_HIGH
movff TABLAT,TABLAT_HIGH
movff FSR0L,FSR0L_HIGH
movff FSR0H,FSR0H_HIGH
movff FSR1L,FSR1L_HIGH
movff FSR1H,FSR1H_HIGH
movff FSR2L,FSR2L_HIGH
movff FSR2H,FSR2H_HIGH
Nach der Ausführung aller Interrupt-Aktionen, die hier hineingehören, muss es
dann zum Schluss heißen:
; this is all fast ISR's end
fast_end:
; restore working registers
movff FSR2H_HIGH,FSR2H
movff FSR2L_HIGH,FSR2L
movff FSR1H_HIGH,FSR1H
movff FSR1L_HIGH,FSR1L
movff FSR0H_HIGH,FSR0H
movff FSR0L_HIGH,FSR0L
movff TABLAT_HIGH,TABLAT
movff TBLPTRL_HIGH,TBLPTRL
movff TBLPTRH_HIGH,TBLPTRH
movff TBLPTRU_HIGH,TBLPTRU
movff BSR_HIGH,BSR
movff WREG_HIGH,WREG
movff STATUS_HIGH,STATUS
retfie ;never use 'retfie fast' because of early silicon errors
Search WWH ::




Custom Search