SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 58
Version 1.5
Note: In RTC mode, don
’t reset T0C in interrupt service routine.
Example: T0 interrupt service routine with RTC function.
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
…
; Push routine to save ACC and PFLAG to buffers.
B0BTS1
FT0IRQ
; Check T0IRQ
JMP
EXIT_INT
; T0IRQ = 0, exit interrupt vector
…
; T0 interrupt service routine
…
B0BCLR
FT0IRQ
; Reset T0IRQ
…
EXIT_INT:
…
; Pop routine to load ACC and PFLAG from buffers.
RETI
; Exit interrupt vector
Note: We strongly recommend to clear T0IRQ must be used b0bclr or bclr instructions.