SN8P275X Series
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 76
Version 0.7
¾
Example: Check the interrupt request under multi-interrupt operation
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
…
; Push routine to save ACC and PFLAG to buffers.
INTP00CHK:
;
Check
INT0 interrupt request
B0BTS1
FP00IEN
; Check P00IEN
JMP
INTP01CHK
; Jump check to next interrupt
B0BTS0
FP00IRQ
; Check P00IRQ
JMP
INTP00
INTP01CHK:
;
Check
INT1 interrupt request
B0BTS1
FP00IEN
; Check P01IEN
JMP
INTP02CHK
; Jump check to next interrupt
B0BTS0
FP01IRQ
; Check P01IRQ
JMP
INTP01
INTP02CHK:
;
Check
INT2 interrupt request
B0BTS1
FP00IEN
; Check P02IEN
JMP
INTT0CHK
; Jump check to next interrupt
B0BTS0
FP02IRQ
; Check P02IRQ
JMP
INTP02
INTT0CHK:
; Check T0 interrupt request
B0BTS1
FT0IEN
; Check T0IEN
JMP
INTTC0CHK
; Jump check to next interrupt
B0BTS0
FT0IRQ
; Check T0IRQ
JMP
INTT0
; Jump to T0 interrupt service routine
INTTC0CHK:
; Check TC0 interrupt request
B0BTS1
FTC0IEN
; Check TC0IEN
JMP
INTTC1CHK
; Jump check to next interrupt
B0BTS0
FTC0IRQ
; Check TC0IRQ
JMP
INTTC0
; Jump to TC0 interrupt service routine
INTTC1CHK:
; Check T1 interrupt request
B0BTS1
FTC1IEN
; Check TC1IEN
JMP
INTSIOHK
; Jump check to next interrupt
B0BTS0
FTC1IRQ
; Check TC1IRQ
JMP
INTT1
; Jump to TC1 interrupt service routine
INTSIOCHK:
; Check SIO interrupt request
B0BTS1
FSIOIEN
; Check SIOIEN
JMP
INTADCHK
; Jump check to next interrupt
B0BTS0
FSIOIRQ
; Check SIOIRQ
JMP
INTSIO
; Jump to SIO interrupt service routine
INTADCHK:
; Check ADC interrupt request
B0BTS1
FADCIEN
; Check ADCIEN
JMP
INT_EXIT
; Jump to exit of IRQ
B0BTS0
FADCIRQ
; Check ADCIRQ
JMP
INTADC
; Jump to ADC interrupt service routine
INT_EXIT:
…
; Pop routine to load ACC and PFLAG from buffers.
RETI
; Exit interrupt vector