SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 90
Version 1.0
Example: How does users check the interrupt request in multi-interrupt situation?
ORG
8
; Interrupt vector
B0XCH
A, ACCBUF
; Store ACC value.
PUSH
;
Push
INTP00CHK:
; Check INT0 interrupt request
B0BTS1
FP00IEN
; Check P00IEN
JMP
INTP01CHK
; Jump check to next interrupt
B0BTS0
FP00IRQ
; Check P00IRQ
JMP
INTP00
; Jump to INT0 interrupt service routine
INTP01CHK:
; Check INT1 interrupt request
B0BTS1
FP01IEN
; Check P01IEN
JMP
INTP02CHK
; Jump check to next interrupt
B0BTS0
FP01IRQ
; Check P01IRQ
JMP
INTP01
; Jump to INT1 interrupt service routine
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
INTTC1HK:
; Check TC1 interrupt request
B0BTS1
FTC1IEN
; Check TC1IEN
JMP
INTSIOCHK
;
Jump
check to next interrupt
B0BTS0
FTC1IRQ
; Check TC1IRQ
JMP
INTTC1
; Jump to TC1 interrupt service routine
INTSIOCHK:
; Check SIO interrupt request
B0BTS1
FSIOIEN
; Check SIOIEN
JMP
INT_EXIT
; Jump to exit of IRQ
B0BTS0
FSIOIRQ
; Check SIOIRQ
JMP
INTSIO
; Jump to SIO interrupt service routine
INT_EXIT:
POP
;
Pop
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector