Stack Pointer And Stack Bank Selection Register Configuration - NEC PD754144 User Manual

4-bit single-chip microcontrollers
Table of Contents

Advertisement

When 00H is set to SP as the initial value, memory bank 0 specified by SBS is used as the stack area, starting
from the highest address (07FH).
The stack area can be used only in memory bank 0. If stack operation is performed from address 000H onwards,
the stack pointer will point to unmounted area 0FFH. Therefore, be careful not to allow the stack pointer to exceed
000H.
The contents of SP become undefined and the contents of SBS become 1000B when the RESET signal is asserted.
Therefore, be sure to initialize these to the desired values at the beginning of the program.
Figure 4-8. Stack Pointer and Stack Bank Selection Register Configuration
Address
F80H
SP7
SP6
F84H
Example of SP initialization
To set the stack area in memory bank 0, and perform stack operations from address 07FH.
SEL MB15
; Or CLR1 MBE
MOV A, #0
MOV SBS, A
; Specify memory bank 0 as stack area
MOV XA, #80H
; SP ← 80H (stack operations from 7FH)
MOV SP, XA
CHAPTER 4 INTERNAL CPU FUNCTION
SP5
SP4
SP3
SP2
SP1
SBS3 SBS2 SBS1 SBS0
000H
07FH
Memory Bank 0
080H
Unmounted
0FFH
User's Manual U10676EJ3V0UM
Symbol
0
SP
SBS
Fix to 0
Mk I/Mk II mode switching
If the stack pointer exceeds
00H, it will point to the
unmounted area 00FH, and
SP
therefore attention should be
paid to the depth of the stack to
ensure that the stack pointer
does not exceed 00H.
71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents