Stack Pointer Configuration; Data To Be Saved To Stack Memory; Data To Be Restored From Stack Memory - NEC PD789488 User Manual

Pd789489 subseries 8-bit single-chip microcontrollers
Table of Contents

Advertisement

(3)
Stack pointer (SP)
This is a 16-bit register that holds the start address of the memory stack area. Only the internal high-speed
RAM area can be set as the stack area.
15
SP
SP15
SP14
SP13 SP12 SP11 SP10
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (restore)
from the stack memory.
Each stack operation saves/restores data as shown in Figures 3-12 and 3-13.
Caution Since RESET input makes the SP contents undefined, be sure to initialize the SP before
instruction execution.
PUSH rp
instruction
SP _ 2
SP
Lower
SP _ 2
register pairs
Higher
SP _ 1
register pairs
SP
POP rp
instruction
Lower
SP
register pairs
Higher
SP + 1
register pairs
SP
SP + 2
60
CHAPTER 3 CPU ARCHITECTURE
Figure 3-11. Stack Pointer Configuration
SP9
SP8
Figure 3-12. Data to Be Saved to Stack Memory
SP _ 2
SP
SP _ 2
SP _ 1
SP
Figure 3-13. Data to Be Restored from Stack Memory
SP
SP + 1
SP
SP + 2
User's Manual U15331EJ4V1UD
SP7
SP6
SP5
SP4
CALL, CALLT
instructions
SP _ 3
SP
SP _ 3
SP _ 2
PC7 to PC0
SP _ 1
PC15 to PC8
SP
RET instruction
PC7 to PC0
PC15 to PC8
SP + 1
SP + 2
SP
SP + 3
0
SP3
SP2
SP1
SP0
Interrupt
PC7 to PC0
PC15 to PC8
PSW
RETI instruction
SP
PC7 to PC0
PC15 to PC8
PSW

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd78f9488Pd78f9489Pd789489

Table of Contents