
33
μ
PD75237
3.5
ACCUMULATOR
In the
μ
PD75237, A register and XA register pair function as an accumulator. The 4-bit data processing instruction
is executed mainly by A register and the 8-bit data processing instruction is executed mainly by XA register pair.
For execution of the bit manipulation instruction, the carry flag (CY) functions as a bit accumulator.
Fig. 3-7 Accumulator
3.6
STACK POINTER (SP) AND STACK BANK SELECT REGISTER (SBS)
In the
μ
PD75237, the static RAM is used as a static memory (LIFO type) and the 8-bit register which holds the
start address information in the stack area is a stack pointer (SP).
The stack area is located at addresses 000H to 3FFH of memory banks 0, 1, 2 and 3. Specify one memory bank
by a 4-bit SBS.
The SP is decremented prior to a write (save) to the stack memory and incremented after a read (restore) from
the stack memory. Set SBS by the 4-bit memory manipulation instruction. In this case, set the higher 2-bits to 00.
The data to be saved/restored by each stack operation is shown in Figs. 3-9 and 3-10.
The SP initial value is set by the 8-bit memory manipulation instruction and the SBS initial value is set by the
4-bit memory manipulation instruction and then the stack area is determined. The SP and SBS contents can also
be read.
Table 3-1 Stack Areas to be Selected by SBS
When the SP initial value is set to 00H, stack starts with the most significant address (nFFH) of the memory bank
(n: n = 0, 1, 2, 3) specified by SBS.
The stack area is limited to the memory bank specified by SBS. When stack operation is further carried out at
address n00H, the address is reset to nFFH in the same bank. Linear stack past the memory bank boundary is not
possible without rewriting SBS.
Since RESET input makes the SP and SBS undefined, be sure to initialize the SP and SBS to any desired value
at the beginning of the program.
SBS
SBS1
SBS0
0
0
Memory bank 0
0
1
Memory bank 1
1
0
Memory bank 2
1
1
Memory bank 3
Stack Area
-
CY
Bit Accumulator
A
4-Bit Accumulator
X
A
8-Bit Accumulator