Stack Pointer (Sp); Stack Pointer Configuration; Data To Be Saved To Stack Memory; Data To Be Reset From Stack Memory - NEC 78K/0 Series User Manual

Nec computer hardware user's manual
Hide thumbs Also See for 78K/0 Series:
Table of Contents

Advertisement

2.1.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
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 2-4 and 2-5.
Caution Since RESET input makes SP contents undefined, be sure to initialize the SP before instruction
execution.
PUSH rp
instruction
SP _ 2
SP
Lower half
SP _ 2
register pairs
Upper half
SP _ 1
register pairs
SP
POP rp
instruction
Lower half
SP
register pairs
Upper half
SP + 1
register pairs
SP
SP + 2
16
CHAPTER 2 REGISTERS
Figure 2-3. Stack Pointer Configuration
SP
Figure 2-4. Data to Be Saved to Stack Memory
CALL, CALLF and
CALLT instructions
SP _ 2
SP
SP _ 2
SP _ 1
SP
Figure 2-5. Data to Be Reset from Stack Memory
RET instruction
SP
SP + 1
SP
SP + 2
User's Manual U12326EJ4V0UM
SP _ 3
SP
SP _ 3
SP _ 2
PC7-PC0
SP _ 1
PC15-PC8
SP
PC7-PC0
SP
PC15-PC8
SP + 1
SP + 2
SP
SP + 3
0
Interrupt and
BRK instructions
PC7-PC0
PC15-PC8
PSW
RETI and RETB
instructions
PC7-PC0
PC15-PC8
PSW

Advertisement

Table of Contents
loading

Table of Contents