SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 31
V1.7
2.1.6
ACCUMULATOR
The ACC is an 8-bit data register responsible for transferring or manipulating data between ALU and data memory. If
the result of operating is zero (Z) or there is carry (C or DC) occurrence, then these flags will be set to PFLAG register.
ACC is
not in data memory (RAM), so ACC can’t be access by “B0MOV” instruction during the instant addressing
mode.
Example: Read and write ACC value.
; Read ACC data and store in BUF data memory
MOV
BUF, A
; Write a immediate data into ACC
MOV
A, #0FH
; Write ACC data from BUF data memory
MOV
A, BUF
The system doesn’t store ACC and PFLAG value when interrupt executed. ACC and PFLAG data must be saved to
other data memories by program.
Example: Protect ACC and working registers.
.DATA
ACCBUF
DS 1
; Define ACCBUF for store ACC data.
PFLAGBUF DS 1
; Define PFLAGBUF for store PFLAG data.
.CODE
INT_SERVICE:
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
; Exit interrupt service vector
Note: To save and re-load ACC data, users
must use “B0XCH” instruction, or else the PFLAG Register
might be modified by ACC operation.