www
.mcu.com.cn
14
/
239
Rev.
1.00
CMS80F731x Reference Manual
1.3
Accumulator (ACC)
The ALU is an 8Bit wide arithmetic logic unit through which all mathematical and logical operations of the MCU are
completed. It can add, subtract, shift and logical operations on data; The ALU also controls the status bits (in the PSW status
register) that represent the state of the result of the operation.
The ACC register is an 8Bit register where the results of ALU operations can be stored.
1.4
B Register(B)
The B register is used when using multiplication and division instructions. If the multiplication and division instruction is not
used, it can also be used as a universal register.
1.5
Stack Pointer Register (SP)
The SP register points to the address of the stack, and the default value after reset is 0x07, which means that the area of
the stack starts at 08H of the RAM address. The value of the SP can be modified, and if the stack region is set to start 0xC0,
the value of the SP needs to be set to 0xBF after the system reset.
Operations that affect SP are: instruction PUSH, LCALL, ACALL, POP, RET, RETI, and entering interrupts.
PUSH instructions occupy one byte in the stack, LCALL, ACALL, and interrupt occupy two bytes in the stack, POP
instructions release one byte, and RET/RETI instructions free two bytes.
Using the PUSH instruction automatically saves the current value of the operated register to RAM.
1.6
Data Pointer Register (DPTR0/DPTR1)
The data pointer is mainly used in MOVX, MOVC instructions, and its role is to locate the addresses of XRAM and ROM.
Inside the chip, there are two data pointer registers DPTR0 and DPTR1, selected by the DPS register.
Each set of pointers includes two 8-bit registers: DPTR0={DPH0,DPL0}; DPTR1={DPH1,DPL1};
For example, the assembly code for operating XRAM is as follows:
MOV
DPTR,#0001H
MOV
A,#5AH
MOVX
@DPTR,A
; Write the data in A to XRAM address 0001H