SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 17
V1.4
3.1.2 USER RESET VECTOR ADDRESS (0000H)
A 1-word vector address area is used to execute system reset. After power on reset or watchdog timer overflow reset,
then the chip will restart the program from address 0000h and all system registers will be set as default values. The
following example shows the way to define the reset vector in the program memory.
Â
Example: After power on reset, external reset active or reset by watchdog timer overflow.
ORG
0
;
0000H
JMP
START
; Jump to user program address.
.
;
ORG
10H
START:
; 0010H, The head of user program.
.
; User program
.
.
.
ENDP
; End of program
3.1.3 INTERRUPT VECTOR ADDRESS (0008H)
A 1-word vector address area is used to execute interrupt request. If any interrupt service is executed, the program
counter (PC) value is stored in stack buffer and points to 0008h of program memory to execute the vectored interrupt.
Users have to define the interrupt vector and the following example shows the way to define the interrupt vector in the
program memory.
Â
Example 1: This demo program includes interrupt service routine and the user program is behind the
interrupt service routine.
ORG
0
;
0000H
JMP
START
; Jump to user program address.
.
ORG 8
; Interrupt service routine
B0XCH A,
ACCBUF
; B0XCH doesn’t change C, Z flag
B0MOV A,
PFLAG
B0MOV PFLAGBUF,
A
; Save PFLAG register in a buffer
.
; User code
.
; User code
B0MOV A,
PFLAGBUF
B0MOV PFLAG,
A
; Restore PFLAG register from buffer
B0XCH A,
ACCBUF
RETI
; End of interrupt service routine
START:
; The head of user program.
.
; User program
.
.
JMP
START
; End of user program
ENDP
; End of program