English
Language : 

Z86E3016PSG Datasheet, PDF (48/348 Pages) Zilog, Inc. – Z86E3016PSG
Z8 Family of Microcontrollers
User Manual
30
Z8 Stacks
Stack operations can occur in either the Z8® Standard Register File or
external data memory. Under software control, Port 0–1 Mode register
(F8h) selects the stack location. Only the General-Purpose Registers can
be used for the stack when the internal stack is selected.
The register pair FEh and FFh form the 16-bit Stack Pointer (SP), that is
used for all stack operations. The stack address is stored with the MSB in
FEh and LSB in FFh; see Figure 10.
FFh
LOWER Byte Stack Pointer Low
FEh
UPPER Byte
Stack Pointer High
Figure 10. Stack Pointer
The stack address is decremented prior to a PUSH operation and incre-
mented after a POP operation. The stack address always points to the data
stored on the top of the stack. The Z8® CPU stack is a return stack for
CALL instructions and interrupts, as well as a data stack.
During a CALL instruction, the contents of the PC are saved on the stack.
The PC is restored during a RETURN instruction. Interrupts cause the
contents of the PC and Flag registers to be saved on the stack. The IRET
instruction restores them Figure 11.
When the Z8® CPU is configured for an internal stack (using the Z8®
Standard Register File), register FFh serves as the Stack Pointer. The
Address Space
UM001602-0904