
SN8P1700
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 121
Revision 1.93
Example: TC0 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
FTC0IRQ
; Check TC0IRQ
JMP
EXIT_INT
; TC0IRQ = 0, exit interrupt vector
B0BCLR
FTC0IRQ
; Reset TC0IRQ
MOV
A,#74H
; Reload TC0C
B0MOV
TC0C,A
.
.
; TC0 interrupt service routine
. .
JMP
EXIT_INT
; End of TC0 interrupt service routine and exit interrupt
vector
. .
. .
EXIT_INT:
POP
;
Pop
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector
Example: TC0 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
FTC0IRQ
; Check TC0IRQ
JMP
EXIT_INT
; TC0IRQ = 0, exit interrupt vector
B0BCLR
FTC0IRQ
; Reset TC0IRQ
.
.
; TC0 interrupt service routine
. .
JMP
EXIT_INT
; End of TC0 interrupt service routine and exit interrupt
vector
. .
. .
EXIT_INT:
POP
;
Pop
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector