General-Purpose Registers; Data Saved To The Stack Area; Data Restored From The Stack Area - NEC PD78212 User Manual

8-bit single-chip microcomputer sub-series
Table of Contents

Advertisement

PUSH rp instruction
SP ← SP – 2
SP – 2
Register pair, low
SP – 1
Register pair, high
SP ⇒
POP rp instruction
SP ⇒
Register pair, low
Register pair, high
SP + 1
SP + 2
SP ← SP + 2
Cautions 1. In stack addressing, the entire 64K bytes can be accessed. A stack area cannot be mapped in the SFR area or internal ROM area.
2. The SP becomes undefined when RESET is input. Meanwhile, nonmaskable interrupts can be acknowledged immediately after
a reset is released. If a nonmaskable interrupt request occurs, while the SP is undefined, immediately after a reset is released,
an unpredictable operation may be carried out. To minimize this danger, initialize the SP immediately after a reset is released.
For details, see Section 12.3.2.

3.2.4 General-Purpose Registers

(1) Configuration
General-purpose registers are mapped to special addresses (0FEE0H to 0FEFFH) in data memory. The
registers are grouped into four banks, each of which consists of eight 8-bit registers (X, A, C, B, E, D, L, H) (see
Fig. 3-11).
Fig. 3-9 Data Saved to the Stack Area
CALL, CALLF, and CALLT instructions
Stack
SP ← SP – 2
SP – 2
SP – 1
SP ⇒
Fig. 3-10 Data Restored from the Stack Area
Stack
SP ⇒
SP + 1
SP + 2
SP ← SP + 2
Stack
SP ← SP – 3
PC7-PC0
SP – 3
PC15-PC8
SP – 2
SP – 1
SP ⇒
RET instruction
Stack
SP ⇒
PC7-PC0
PC15-PC8
SP + 1
SP + 2
SP + 3
SP ← SP + 3
Chapter 3 CPU Function
Interrupt
Stack
PC7-PC0
PC15-PC8
PSW
RETI instruction
Stack
PC7-PC0
PC15-PC8
PSW
3
47

Advertisement

Table of Contents
loading

Table of Contents