18.2.4 Extended stack pointer of 94/96/97 series core
The M8051 uses IRAM area for Stack Pointer. However, 94-series and 97-series microcontrollers use
both IRAM area and XRAM area for the Stack Pointer by configuring additional registers.
The XSP and XSPCR registers are involved in this functionality as described below:
By configuring the XSP/XSPCR register, you can use the XRAM area for the Stack Pointer.
− The XSPCR decides whether to use XRAM for the Stack Pointer.
◆ If XSPCR = ’0’, the IRAM is available for the Stack Pointer.
◆ If XSPCR = ’1’, the XRAM is available for the Stack Pointer.
− The XSP decides a position of XRAM Stack Pointer.
◆ This is valid only if XSPCR=’1’.
Figure 100. Configuration of the Extended Stack Pointer
STACK_POINTER = {XSP[7:0],SP[7:0]} = XRAM_TOP – STACK_SIZE
Ex) If only 256bytes of XRAM will be used for stack,
XRAM_TOP = 4K(0x0FFF)
STACK_SIZE = 256byte(0x0100)
XSPCR= 1, XSP= 0x0E
SP=0xFF setting
Stack Pointer Position = 0x0FFF - 0x0100= 0x0EFF