SN8P1700
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 130
Revision 1.93
Example: TC1 interrupt service routine without auto-reload function.
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
B0XCH
A, ACCBUF
; B0XCH doesn’t change C, Z flag
PUSH
;
Push
B0BTS1
FTC1IRQ
; Check TC1IRQ
JMP
EXIT_INT
; TC1IRQ = 0, exit interrupt vector
B0BCLR
FTC1IRQ
; Reset TC1IRQ
MOV
A,#74H
; Reload TC1C
B0MOV
TC1C,A
.
.
; TC1 interrupt service routine
. .
JMP
EXIT_INT
; End of TC1 interrupt service routine and exit interrupt
vector
. .
. .
EXIT_INT:
POP
;
Pop
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector
Example: TC1 interrupt service routine with auto-reload.
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
B0XCH
A, ACCBUF
; B0XCH doesn’t change C, Z flag
PUSH
;
Push
B0BTS1
FTC1IRQ
; Check TC1IRQ
JMP
EXIT_INT
; TC1IRQ = 0, exit interrupt vector
B0BCLR
FTC1IRQ
; Reset TC1IRQ
.
.
; TC1 interrupt service routine
. .
JMP
EXIT_INT
; End of TC1 interrupt service routine and exit interrupt
vector
. .
. .
EXIT_INT:
POP
;
Pop
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector