English
Language : 

UPD784938 Datasheet, PDF (88/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 3 CPU ARCHITECTURE
3.7.4 Stack pointer (SP)
The stack pointer is a 24-bit register that holds the start address of the stack area (LIFO type: 00000H to FFFFFFH) (see
Figure 3-9). It is used to address the stack area when subroutine processing or interrupt servicing is performed. Be sure to
write “0” in the high-order 4 bits.
The contents of the SP are decremented before a write to the stack area and incremented after a read from the stack area
(see Figures 3-10 and 3-11).
The SP is accessed by dedicated instructions.
The SP contents are undefined after RESET input, and therefore the SP must always be initialized by an initialization program
directly after reset release (before a subroutine call or interrupt acknowledgment).
Example SP initialization
MOVG SP, #0FEE0H;SP ← 0FEE0H (when used from FEDFH)
Figure 3-9. Stack Pointer (SP) Format
23
0
SP
88
Preliminary User’s Manual U13987EJ1V0UM00