SN8P275X Series
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 31
Version 0.7
2.1.4.4
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. “PUSH”, “POP” save and load 0x80~0x87 system registers data into buffers. Users have to save
ACC data by program.
¾
Example: Protect ACC and working registers.
.DATA
ACCBUF
DS 1
; Define ACCBUF for store ACC data.
.CODE
INT_SERVICE:
B0XCH
A, ACCBUF
; Save ACC to buffer.
PUSH
; Save PFLAG and working registers to buffer.
…
.
…
POP
; Load PFLAG and working registers form buffers.
B0XCH
A, ACCBUF
; Load ACC form 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.