DMA Interrupts
7-46
ISR_n:
PUSH
ST
;
PUSH DP
; Save
registers
PUSH R0
;
LDI
0, DP
; Clear Data-page Pointer
LDI
@DUMMY_INT, R0
; If DUMMY_INT is 0 or positive,
BNN
ISR_n_START
; go to ISR_n_START
STI
DP, @DUMMY_INT
; Set DUMMY_INT = 0
POP
R0
;
POP
DP
;
POP
ST
; Housekeeping, return from interrupt
RETI
;
ISR_n_START: .
.
; Normal interrupt service routine
.
; Code goes here
LDI
INT_Fn, R0
;
AND
IF, R0
; If ones in IF reg match
BNZ
ISR_n_END
; INT_Fn, exit ISR
LDI
0, DP
; Otherwise clear
LDI
0FFFFh, R0
; DP and set
STI
R0, @DUMMY_INT
; DUMMY_INT negative & exit
ISR_n_END:
POP
R0
;
POP
DP
; Exit ISR
POP
ST
;
RETI
;