SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 19
V1.7
2.1.2.1
INTERRUPT VECTOR (0008H)
A 1-word vector address area is used to execute interrupt request. If any interrupt service executes, the program
counter (PC) value is stored in stack buffer and jump to 0008h of program memory to execute the vectored interrupt.
Users have to define the interrupt vector. The following example shows the way to define the interrupt vector in the
program memory.
Note: Users have to save and load ACC and PFLAG register by program as interrupt occurrence.
Example: Defining Interrupt Vector. The interrupt service routine is following ORG 8.
.DATA
ACCBUF
DS 1
; Define ACCBUF for store ACC data.
PFLAGBUF DS 1
; Define PFLAGBUF for store PFLAG data.
.CODE
ORG
0
; 0000H
JMP
START
; Jump to user program address.
…
ORG
8
; Interrupt vector.
B0XCH
A, ACCBUF
; Save ACC in a buffer.
B0MOV
A, PFLAG
B0MOV
PFLAGBUF, A
; Save PFLAG register in a buffer.
…
…
B0MOV
A, PFLAGBUF
B0MOV
PFLAG, A
; Restore PFLAG register from buffer.
B0XCH
A, ACCBUF
; Restore ACC from buffer.
RETI
; End of interrupt service routine
…
START:
; The head of user program.
…
; User program
…
JMP
START
; End of user program
…
ENDP
; End of program