English
Language : 

MC81F4332 Datasheet, PDF (50/198 Pages) Finechips – ABOV SEMICONDUCTOR 8-BIT SINGLE-CHIP MICROCONTROLLERS
MC81F4x16
Stack Address (100H – 1FFH)
15
87
01H
SP
Hardware fixed
0
00H – 0FFH
Figure 9-3 Stack Pointer
Stack Pointer: Stack Pointer is an 8-bit register which indicates the current „push‟ point in the stack
area. It is used to push and pop when interrupts or general function call is occurred. Stack Pointer
identifies the location in the stack to be accessed (save or restore).
Generally, SP is automatically updated when a subroutine call is executed or an interrupt is accepted.
However, if it is used in excess of the stack area permitted by the data memory allocating
configuration, the user-processed data may be lost.
The stack can be located at any position within 100H to 1FFH of the internal data memory. The SP is
not initialized by hardware, requiring to write the initial value (the location with which the use of the
stack starts) by using the initialization routine. Normally, the initial value of “FFH” is used.
At execution of
A CALL/TCALL/PCALL
At execution
of RET instruction
At acceptance
of interrupt
At execution
of RETI instruction
01FF PCH
Push 01FF PCH
Pop
01FE PCL
down 01FE PCL
up
01FD
01FD
01FC
01FC
01FF
01FE
01FD
01FC
PCH
PCL
PSW
Push
down
01FF PCH
01FE PCL
Pop
up
01FD PSW
01FC
SP befor
execution
SP after
exccution
01FF
01FD
01FD
01FF
01FF
01FC
01FC
01FF
At execution
Of PUSH instruction
PUSH A(X,Y,PSW)
01FF
A
01FE
01FD
01FC
Push
down
SP befor
execution
SP after
exccution
01FF
01FE
At execution
Of POP instruction
POP A(X,Y,PSW)
01FF
A
Pop
up
01FE
01FD
01FC
01FF
01FE
01FF
Stack
Depth
0100
Figure 9-4 Stack Operation
50
October 19, 2009 Ver.1.35