
32
μ
PD75517(A)
3.5 ACCUMULATORS
In the
μ
PD75517(A), the A register and the XA register pair function as accumulators. The A register is mainly
used for 4-bit data processing instructions, and the XA register pair is mainly used for 8-bit data processing
instructions.
For a bit manipulation instruction, the carry flag (CY) functions as a bit accumulator.
Fig. 3-6 Accumulators
3.6 STACK POINTER (SP) AND STACK BANK SELECT REGISTER (SBS)
The
μ
PD75517(A) uses static RAM as stack memory (LIFO scheme), and the 8-bit register holding the start
address of the stack area is the stack pointer (SP).
The stack area is located at addresses 000H to 3FFH in memory banks 0, 1, 2, and 3. Either of the memory
banks is selected according to the value of the 2-bit SBS. (See
Table 3-1
.)
Table 3-1 Stack Area to Be Selected by the SBS
The SP is decremented before a write (save) operation to stack memory, and is incremented after a read
(restoration) operation from stack memory. The SBS is set with a 4-bit memory manipulation instruction. Note
that the high-order two bits are always set to 00.
Fig. 3-8 and 3-9 show data saved to and restored from stack memory in these stack operations.
To place the stack area at a given location, the SP can be initialized with an 8-bit memory manipulation
instruction, and the SBS can be initialized with a 4-bit memory manipulation instruction. Both can be read
from as well.
When the SP is initialized to 00H, a stack operation starts at the high-order address (nFFH) of memory bank
(n) specified with the SBS.
A stack area must be within the memory bank specified with the SBS. If a stack operation exceeds address
n00H, the operation returns to address nFFH of the same bank. Stacking beyond memory bank boundaries
is enabled only by resetting the SBS.
A RESET signal occurrence causes the contents of the SP and the SBS to be undefined, so that the SP must
always be initialized to a desired value at the start of the program.
Bit accumulator
4-bit accumulator
8-bit accumulator
CY
A
A
X
SBS2
0
1
0
1
SBS
Memory bank 0
Memory bank 1
Memory bank 2
Memory bank 3
Stack area
-
SBS1
0
0
1
1