Z8 Microcontrollers
External Interface
ZiLOG
10-4
UM001600-Z8X0599
10.4 EXTERNAL STACKS
The Z8 architecture supports stack operations in either the
Z8 Standard Register File or External Data Memory. A
stack’s location is determined by bit 2 in the Port 0-1 Mode
Register (F8H). If bit 2 is set to 0, the stack is in External
Data Memory. (Figure 10-3).
The instruction used to change the stack selection bit
should not be immediately followed by the instructions
RET or IRET, because this will cause indeterminate pro-
gram flow. After a
RESET
, the internal stack is selected.
Please note that if Port 0 is configured as A15 - A8 and the
stack is selected as internal, any stack operation will cause
the contents in register FEH to be displayed on Port 0.
10.5 DATA MEMORY
The two Z8 external memory spaces, data and program,
are addressed as two separate spaces of up to 64 Kbytes
each. External Program Memory and External Data Mem-
ory are logically selected by the Data Memory select out-
put (
DM
).
DM
is made available on Port 3, bit 4 (P34) by
setting bit 4 and bit 3 in the Port 3 Mode Register (F7H) to
10 or 01 (Figure 10-4).
DM
is active Low during the execu-
tion of the LDE, LDEI instructions, and High for the execu-
tion of program instructions.
DM
is also active Low during
the execution of CALL, POP, PUSH, RET and IRET in-
structions if the stack resides in External Data Memory. Af-
ter a
RESET
,
DM
is not selected.
Figure 10-3. Z8 Stack Selection
D7 D6 D5 D4 D3 D2 D1 D0
(Write-Only)
Port 0-1 Register
Register F8H (P01M)
Z8 Stack Selection
0 = External
1 = Internal
Figure 10-4. Port 3 Data Memory Operation
D7 D6 D5 D4 D3 D2 D1 D0
(Write-Only)
Bits Configuration
00 P33 = Input P34 = Output
01 P33 = Input P34 = /DM
10 P33 = Input P34 = /DM
11 P33 = /DAV1/RDY1 P34 = RDY1//DAV1
Port 3 Mode Register
Register F7H (P3M)