SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 58
Version 1.7
6.5 PUSH, POP ROUTINE
When any interrupt occurs, system will jump to ORG 8 and execute interrupt service routine. It is necessary to save
ACC, PFLAG data. The chip doesn
’t have any special instructions to process ACC, PFLAG registers when into
interrupt service routine. Users have to save ACC, PFLAG by program, Using
“B0XCH” to save/load ACC buffer,
“B0MOV” to save/load PFLAG and avoid main routine error after interrupt service routine finishing.
Note: To save/load ACC data, users must be
“B0XCH” instruction, or else the PFLAG register might be
modified by ACC operation.
Example: Store ACC and PAFLG data by program when interrupt service routine executed.
.DATA
ACCBUF
DS 1
; ACCBUF is ACC data buffer.
PFLAGBUF DS 1
; PFLAGBUF is PFLAG data buffer.
.CODE
ORG
0
JMP
START
ORG
8
JMP
INT_SERVICE
ORG
10H
START:
…
INT_SERVICE:
B0XCH
A, ACCBUF
; Save ACC to ACCBUF buffer.
B0MOV
A, PFLAG
B0MOV
PFLAGBUF, A
; Save PFLAG to PFLAGBUF buffer.
…
…
B0MOV
A, PFLAGBUF
B0MOV
PFLAG, A
; Load PFLAG from PFLAGBUF buffer.
B0XCH
A, ACCBUF
; Load ACC from ACCBUF buffer.
RETI
; Exit interrupt service vector
…
ENDP