SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 84
V1.4
Â
Example: INT1 interrupt service routine.
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
B0XCH
A, ACCBUF
; B0XCH doesn’t change C, Z flag
B0MOV
A,
PFLAG
B0MOV
PFLAGBUF, A
; Save PFLAG register in a buffer
B0BTS1
FP01IRQ
; Check P01IRQ
JMP
EXIT_INT
; P01IRQ = 0, exit interrupt vector
B0BCLR
FP01IRQ
; Reset P01IRQ
.
.
; INT1 interrupt service routine
. .
EXIT_INT:
B0MOV
A,
PFLAGBUF
B0MOV
PFLAG, A
; Restore PFLAG register from buffer
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector