Stack Pointer (Sp) And Stack Bank Select Register (Sbs); Stack Area To Be Selected By The Sbs - NEC PD750004 User Manual

4 bit single-chip microcomputer
Table of Contents

Advertisement

µPD750008 USER'S MANUAL

4.7 STACK POINTER (SP) AND STACK BANK SELECT REGISTER (SBS)

The µPD750008 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 1FFH in memory banks 0 and 1. One memory bank is
selected according to the value of the 2-bit SBS. (See Table 4-2.)
The SP is decremented before a write (save) operation to stack memory, and is incremented after a read
(restoration) operation from stack memory.
Figures 4-12 to 4-15 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 in the same bank. Linear stacking beyond memory bank
boundaries is enabled only by resetting the SBS.
A RESET signal causes the contents of the SP to be undefined, and causes the contents of the SBS to
be 1000B. Remember to initialize the SP and SBS to a desired value at the start of a program.
5 8
Table 4-2. Stack Area to Be Selected by the SBS
SBS
SBS1
SBS0
0
0
Other than above
Stack area
0
Memory bank 0
1
Memory bank 1
Not to be set

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd750006Pd750008Pd75p0016

Table of Contents