Stack Pointer Configuration; Data To Be Saved To Stack Memory; Data To Be Reset From Stack Memory - NEC PD78081(A) User Manual

8-bit single-chip microcontroller
Table of Contents

Advertisement

(3) Stack pointer (SP)
This is a 16-bit register to hold the start address of the memory stack area. Only the internal high-speed RAM
area (FE00H-FEFFH for the
PD78P083) can be set as the stack area.
15
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (reset) from
the stack memory.
Each stack operation saves/resets data as shown in Figures 3-10 and 3-11.
Caution Since RESET input makes SP contents indeterminate, be sure to initialize the SP before
instruction execution.
PUSH rp Instruction
SP _ 2
SP
SP _ 2
Register Pair Lower
SP _ 1
Register Pair Upper
SP
POP rp Instruction
SP
Register Pair Lower
Register Pair Upper
SP + 1
SP
SP + 2
CHAPTER 3 CPU ARCHITECTURE
PD78081, FD80H-FEFFH for the PD78082, and FD00H-FEFFH for the
Figure 3-9. Stack Pointer Configuration
Figure 3-10. Data to be Saved to Stack Memory
SP _ 2
SP
SP _ 2
SP _ 1
SP
Figure 3-11. Data to be Reset from Stack Memory
SP
SP + 1
SP
SP + 2
SP
CALL, CALLF, and
CALLT Instruction
SP
PC7-PC0
PC15-PC8
RET Instruction
PC7-PC0
PC15-PC8
SP
0
Interrupt and
BRK Instruction
SP _ 3
SP _ 3
PC7-PC0
SP _ 2
PC15-PC8
SP _ 1
PSW
SP
RETI and RETB
Instruction
SP
PC7-PC0
SP + 1
PC15-PC8
SP + 2
PSW
SP + 3
35

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents