Z380 Microprocessor: Data Communications Family
Z380 Microprocessor: Data Communications Family
Z380 Microprocessor
Product Specification
PS010002-0708
As used herein
Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b)
support or sustain life and whose failure to perform when properly used in accordance with instructions for
use provided in the labeling can be reasonably expected to result in a significant injury to the user. A
critical component is any component in a life support device or system whose failure to perform can be
reasonably expected to cause the failure of the life support device or system or to affect its safety or
effectiveness.
Document Disclaimer
©2008 by Zilog, Inc. All rights reserved. Information in this publication concerning the devices,
applications, or technology described is intended to suggest possible uses and may be superseded. ZILOG,
INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY
OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT.
Z I L O G A L S O D O E S N O T A S S U M E L I A B I L I T Y F O R I N T E L L E C T U A L P R O P E RT Y
INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATION, DEVICES, OR
TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this
document has been verified according to the general principles of electrical and mechanical engineering.
Z8, Z8 Encore!, Z8 Encore! XP, Z8 Encore! MC, Crimzon, eZ80, and ZNEO are trademarks or registered
trademarks of Zilog, Inc. All other product or service names are the property of their respective owners.
Page 2 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Revision History
Each instance in Revision History reflects a change to this document from its previous
revision. For more details, refer to the corresponding pages and appropriate links in the
table below.
Page 3 of 125
PS010002-0708 Revision History
Z380 Microprocessor
Product Specification
FEATURES
• Static CMOS Design with Low-Power Standby Mode Option
• 32-Bit Internal Data Paths and ALU
• Operating Frequency
– DC-to-18 MHz at 5V
– DC-to-10 MHz at 3.3V
• Enhanced Instruction Set that Maintains Object-Code Compatibility with Z80® and
Z180 Microprocessors
• 16-Bit (64K) or 32-Bit (4G) Linear Address Space
• 16-Bit Data Bus with Dynamic Sizing
• Two-Clock Cycle Instruction Execution Minimum
• Four Banks of On-Chip Register Files
• Enhanced Interrupt Capabilities, Including 16-Bit Vector
• Undefined Opcode Trap for Z380™ Instruction Set
• On-Chip I/O Functions:
– Six-Memory Chip Selects with Programmable Waits
– Programmable I/O Waits
– DRAM Refresh Controller
• 100-Pin QFP Package
Page 4 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
GENERAL DESCRIPTION
The Z380 Microprocessor is an integrated high-performance microprocessor with fast and
efficient throughput and increased memory addressing capabilities. The Z380 offers a con-
tinuing growth path for present Z80-or Z180-based designs, while maintaining Z80® CPU
and Z180 MPU object-code compatibility. The Z380 MPU enhancements include an
improved 280 CPU, expanded 4-Gbyte space and flexible bus interface timing.
An enhanced version of the Z80 CPU is key to the Z380 MPU. The basic addressing
modes of the Z80 microprocessor have been augmented as follows: Stack Pointer Relative
loads and stores, 16-bit and 24-bit indexed offsets, and more flexible Indirect Register
addressing, with all of the addressing modes allowing access to the entire 32-bit address
space. Additions made to the instruction set, include a full complement of 16-bit arithme-
tic and logical operations, 16-bit I/O operations, multiply and divide, plus a complete set
of register-to-register loads and exchanges.
The expanded basic register file of the Z80 MPU microprocessor includes alternate regis-
ter versions of the IX and IY registers. There are four sets of this basic Z80 microproces-
sor register file present in the Z380 MPU, along with the necessary resources to manage
switching between the different register sets. All of the register-pairs and index registers in
the basic Z80 microprocessor register file are expanded to 32 bits.
The Z380 MPU expands the basic 64 Kbyte Z80 and Z180 address space to a full 4 Gbyte
(32-bit) address space. This address space is linear and completely accessible to the user
program. The I/O address space is similarly expanded to a full 4 Gbyte (32-bit) range and
16-bit I/O, and both simple and block move are added.
Some features that have traditionally been handled by external peripheral devices have
been incorporated in the design of the Z380 microprocessor. The on-chip peripherals
reduce system chip count and reduce interconnection on the external bus. The Z380 MPU
contains a refresh controller for DRAMs that employs a /CAS-before-/RAS refresh cycle
at a programmable rate and burst size.
Six programmable memory-chip selects are available, along with programmable wait-
state generators for each chip-select address range.
The Z380 MPU provides flexible bus interface timing, with separate control signals and
timing for memory and I/O. The memory bus control signals provide timing references
suitable for direct interface to DRAM, static RAM, EPROM, or ROM. Full control of the
memory bus timing is possible because the /WAIT signal is sampled three times during a
memory transaction, allowing complete user control of edge-to-edge timing between the
reference signals provided by the Z380 MPU. The I/O bus control signals allow direct
interface to members of the Z80 family of peripherals, the Z8000 family of peripherals, or
the Z8500 series of peripherals. Figure 1 shows the Z380 block diagram; Figure 2 shows
the pin assignments.
Page 5 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
All signals with a preceding front slash, "/", are active Low e.g., B//W (WORD is active
Note: Low); B/W is active Low, only)
/STNBY
/RESET
/INT3-0
/BREQ
/BACK
IOCLK
MSIZE
/HALT
CLKO
/WAIT
A31-0
D15-0
CLKI
/NMI
Chip Selects
and Waits
CPU
Refresh
Conrol
/EV
Data (16)
VDD
Page 6 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
A5 100 80 A23
1 95 90 85
A4 A24
2
A3 A25
A2 A26
A1 5 A27
A0 75 A28
VSS A29
VDD A30
VSS A31
VDD 10 VSS
/TREFR 70 VDD
/TREFA VSS
/TREFC D0
/BHEN D1
Z380
/BLEN 15 100-Pin QFP D2
/MRD 65 D3
/MWR D4
/MSIZE D5
/WAIT D6
BUSCLK 20 D7
IOCLK 60 D8
/M1 D9
/IORQ D10
/IORD D11
CLKI 25 D12
CLKO 55 D13
/IOWR D14
VSS D15
VDD VDD
VSS 30 35 40 45 50 VSS
Page 7 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
PIN DESCRIPTION
A31-A0 Address Bus (outputs, activeHigh, tri-state).These non-multiplexed address sig-
nals provide a linear memory address space of four gigabytes. The 32-address signals are
also used to access I/O devices.
/BACK Bus Acknowledge (output, active Low, tri-state). This signal, when asserted, indi-
cates that the Z380 MPU has accepted an external bus request and has tri-stated its output
drivers for the address bus, data bus and the bus control signals /TREFR, /TREFA, /
TREFC, /BHEN, /BLEN, /MRD, /MWR, /IORQ, /IORD, and /IOWR. Note that the Z380
MPU cannot provide any DRAM refresh transactions while it is in the bus acknowledge
state.
/BHEN Byte High Enable (output, active Low, tri-state). This signal is asserted at the
beginning of a memory, or refresh transaction to indicate that an operation on D15-D8 is
requested. For a 16-bit memory transaction, if /MSIZE is asserted, indicating a byte-wide
memory, another memory transaction is performed to transfer the data on D15-D8, this
time through D15-D8.
/BLEN Byte Low Enable (output, active Low, tri-state). This signal is asserted at the
beginning of a memory or refresh transaction to indicate that an operation on D7-D0 is
requested. For a 16-bit memory transaction, if /MSIZE is asserted, indicating a byte-wide
memory, only the data on D7-D0 will be transferred during this transaction, and another
transaction will be performed to transfer the data on D15-D8, this time through D7-D0.
/BREQ Bus Request (input, active Low). When this signal is asserted, an external bus
master is requesting control of the bus. /BREQ has higher priority than all nonmaskable
and maskable interrupt requests.
BUSCLK Bus Clock (output, active High, tri-state). This signal, output by the Z380 MPU,
is the reference edge for the majority of other signals generated by the Z380 MPU. BUS-
CLK is a delayed version of the CLK input.
CLKI Clock/Crystal (input, active High). An externally generated direct clock can be input
at this pin and the Z380 MPU would operate at the CLKI frequency. Alternatively, a crys-
tal up to 20 MHz can be connected across CLKI and CLKO, and the Z380 MPU would
operate at half of the crystal frequency. The two clocking options are controlled by the
CLKsel input.
CLKO Crystal (output, active High). Crystal oscillator connection. This pin should be left
open if an externally generated direct clock is input at the CLKI pin.
CLKsel Clock Option Select (input, active High). This input should be connected to VDD
to select the direct clock option and should be connected to VSS for the crystal option.
D15-D0 Data Bus (input/outputs, active High, tri-state). This bi-directional 16-bit data
bus is used for data transfer between the Z380 MPU and memory or I/O devices. Note that
for a memory word transfer, the even-addressed (A0 = 0) byte is generally transferred on
D15-D8, and the odd-addressed (A0 = 1) byte on D7-D0 (see the /MSIZE pin description).
Page 8 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
/EV Evaluation Mode (input, active Low). This input should be left unconnected for nor-
mal operation. When it is driven to logic 0, the Z380 MPU conditions itself in the reset
mode and tri-states all of its output pin drivers.
/HALT Halt Status (output, active Low, tri-state). If the Z380 MPU standby mode option
is not selected, a Sleep instruction is executed no different than a Halt instruction, and the
one HALT signal goes active to indicate the CPU's HALT state. If the standby mode
option is selected, this signal goes active only at the Halt instruction execution.
/STNBY Standby Status (output, active Low, tri-state). If the Z380 MPU standby mode is
selected, executing a sleep instruction stops clocking within the Z380 MPU and at BUS-
CLK and IOCLK after which this signal is asserted. The Z380 MPU is then in the low
power standby mode, with all operations suspended.
/INT3-0 Interrupt Requests (inputs, active Low). These signals are four asynchronous
maskable interrupt inputs.
IOCLK I/O Clock (output, active High, tri-state). This signal is a program controlled
divided-down version of BUSCLK. The division factor can be two, four, six or eight with
I/O transactions and interrupt-acknowledge transactions occurring relative to IOCLK.
/INTAK Interrupt Acknowledge Status (output, active Low, tri-state). This signal is used to
distinguish between I/O and interrupt acknowledge transactions. This signal is High dur-
ing I/O read and I/O write transactions and Low during interrupt acknowledge transac-
tions.
/IORQ Input/Output Request (output, active Low, tri-state). This signal is active during all
I/O read and write transactions and interrupt acknowledge transactions.
/M1 Machine Cycle One (output, active Low, tri-state). This signal is active during inter-
rupt acknowledge and RETI transactions.
/IORD Input, Output Read Strobe (output, active Low, tri-state). This signal is used strobe
data from the peripherals during I/O read transactions. In addition, /IORD is active during
the special RETI transaction and the I/O heartbeat cycle in the Z80 protocol case.
/IOWR Input/Output Write Strobe (output, active Low, tri-state). This signal is used to
strobe data into the peripherals during I/O write transactions.
/LMCS Low Memory Chip Select (output, active Low, tri-state). This signal is activated
during a memory read or memory write transaction when accessing the lower portion of
the linear address space within the first 16 Mbytes, but only if this chip select function is
enabled.
/MCS3-/MCS0 Mid-range Memory Chip Selects (output, active Low, tri-state). These sig-
nals are individually active during memory read or write transactions when accessing the
mid-range portions of the linear address space within the first 16 Mbytes. These signals
can be individually enabled or disabled.
/MRD Memory Read (output, active Low, tri-state). This signal indicates that the
addressed memory location should place its data on the data bus as specified by the /
Page 9 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BHEN and /BLEN control signals. /MRD is active from the end of T1 until the end of T4
during memory read transactions.
/MSIZE Memory Size (input, active Low). This input, from the addressed memory loca-
tion, indicates if it is word size (logic High) or byte size (logic Low). In the latter case, the
addressed memory should be connected to the D15-D8 portion of the data bus, and an
additional memory transaction will automatically be generated to complete a word size
data transfer.
/MWR Memory Write (output, active Low, tri-state). This signal indicates that the
addressed memory location should store the data on the data bus, as specified by the /
BHEN and /BLEN control signals. /MWR is active from the end of T2 until the end of T4
during memory write transactions.
/NMI Nonmaskable Interrupt(input, falling edge-triggered). This input has higher priority
than the maskable interrupt inputs /INT3-INT0.
/RESET Reset (input, active Low). This input must be active for a minimum of five BUS-
CLK periods to initialize the Z380 MPU. The effect of /RESET is described in detail in
the Reset section.
/TREFA Timing Reference A (output, active Low, tri-state). This timing reference signal
goes Low at the end of T2 and returns High at the end of T4 during a memory read, mem-
ory write or refresh transaction. It can be used to control the address multiplexer for a
DRAM interface or as the /RAS signal at higher processor clock rates.
/TREFC Timing Reference C (output, activeLow, tri-state). This timing reference signal
goes Low at the end of T3 and returns High at the end of T4 during a memory read, mem-
ory write or refresh transaction. It can be used as the /CAS signal for DRAM accesses.
/TREFR Timing Reference R (output, active Low, tri-state). This timing reference signal
goes Low at the end of T1 and returns High at the end of T4 during a memory read, mem-
ory write or refresh transaction. It can be used as the /RAS signal for DRAM accesses.
/UMCS Upper Memory ChipSelect (output, active Low, tri-state). This signal is activated
during a memory read, memory write, or optionally a refresh transaction when accessing
the highest portion of the linear address space within the first 16 Mbytes, but only if this
chip select function is enabled.
VDD Power Supply. These eight pins carry power to the device. They must be tied to the
same voltage externally.
VSS Ground. These eight pins are the ground references for the device. They must be tied
to the same voltage externally.
/WAIT Wait (input, active Low). This input is sampled by BUSCLK or IOCLK, as appro-
priate, to insert Wait states into the current bus transaction.
The conditioning and characteristics of the Z380 MPU pins under various operation
modes are defined in Table 1.
Page 10 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
EXTERNAL INTERFACE
Two kinds of operations can occur on the system bus: transactions and requests. At any
given time, one device (either the CPU or a bus master) has control of the bus and is
known as the bus master.
This section shows all of the transaction and request timing for the device. For the sake of
clarity, there are more figures than are actually necessary. This should aid the reader rather
than confuse. In all of the timing diagram figures, the row labelled STATUS encompasses
/BHEN, /BLEN, and the chip select signals.
Page 11 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Transactions
A transaction is initiated by the bus master and is responded to by some other device on
the bus. Only one transaction can proceed at a time; six kinds of transactions can occur:
Memory, Refresh, I/O, Interrupt Acknowledge, RETI (Return from Interrupt), and Halt.
The Z380 MPU is unique in that memory and I/O bus transactions use separate control
signals. This allows the memory interface to be optimized independently of the I/O inter-
face.
Memory Transactions
Memory transactions move instructions or data to or from memory when the Z380 MPU
performs a memory access. Thus, they are generated during program execution to fetch
instructions from memory and to fetch and store memory data. They are also generated to
store old program status and fetch new program status during interrupt and trap handling,
and are used by DMA peripherals to transfer information. A memory transaction is two
clock cycles long unless extended with wait states. Wait states may be inserted between
each of the four T states in a memory transaction and are one BUSCLK cycle long per
wait state. The external /WAIT input is sampled only after any internally-generated wait
states are inserted. Memory transactions may transfer either bytes or words. If the Z380
MPU attempts to transfer a word to a byte-wide memory, the /MSIZE signal should be
asserted Low to force this transaction to be byte-wide dynamically. The Z380 MPU will
then perform another memory transaction to transfer the byte that was not transferred dur-
ing the first transaction.
Read memory transactions are shown without wait states, with wait states between T1 and
T2, between T2 and T3, and between T3 and T4 (Figures 3 - 6). The data bus is driven by
the memory being addressed, and the memory data is latched immediately before the ris-
ing edge of BUSCLK which terminates T4.
Page 12 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 13 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T1L T1H T2 T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 14 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
(Continued)
T1 T2 T2H T2L T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 15 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T3 T3L T3H T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 16 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 17 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T1L T1H T2 T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 18 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T2H T2L T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 19 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T3 T3L T3H T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 20 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
TPH TPL
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 21 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 22 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T1L T1H T2 T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 23 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T2H T2L T3 T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 24 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
T1 T2 T3 T3L T3H T4
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 25 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
I/O Transactions
I/O transactions move data to or from an external peripheral when the Z380 MPU per-
forms an I/O access. All I/O transactions occur referenced to the IOCLK signal, when it is
a divided-down version of the BUSCLKsignal. BUSCLK may be divided by a factor of
from two to eight to form the IOCLK, under program control. An example of this division
is shown, for the four possible divisors, in Figure 16. Note that the IOCLK divider is syn-
chronized (i.e., starts with a known timing relationship) at the trailing edge of /RESET.
This is discussed in the Reset Section.
BUSCLK
IOCLK (X2)
IOCLK (X4)
IOCLK (X6)
IOCLK (X8)
Page 26 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
I/O Read transactions are shown with and without a wait state (Figures 17-18). The con-
tents of the data bus is latched immediately before the falling edge of IOCLK during the
last IOCLK cycle of the transaction.
IOCLK
ADDRESS
DATA
/WAIT
/MI
/IORQ
/IORD
/IOWR
/INTAK
Fi 8A I/O R d C l N W it
Figure 17. I/0Read Cycle, No Waits
Page 27 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
IOCLK
ADDRESS
DATA
/WAIT
/MI
/IORQ
/IORD
/IOWR
/INTAK
Fi 8B I/O R dC l T1 W it
Figure 18. I/O Read Cycle, T1 Wait
Page 28 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
IOCLK
ADDRESS
DATA
/WAIT
/MI
/IORQ
/IORD
/IOWR
/INTAK
Page 29 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
ZILOG MICROPROCE
IOCLK
ADDRESS
DATA
/WAIT
/MI
/IORQ
/IORD
/IOWR
/INTAK
Page 30 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
IOCLK
ADDRESS
DATA
/WAIT
/M1
/IORQ
/IORD
/IOWR
/INTAK
Page 31 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
IOCLK
ADDRESS
DATA
/WAIT
/MI
/IORQ
/IORD
/IOWR
/INTAK
An interrupt acknowledge transaction for /INT0 is five IOCLK cycles long unless
extended by Wait states. /WAIT is sampled at two separate points during the transaction.
/WAIT is first sampled at the end of the first IOCLK cycle during the transaction. Wait
states inserted here allow the external daisy-chain between peripherals with a longer time
to settle before the interrupt vector is requested. /WAIT is then sampled at the end of the
fourth IOCLK cycle to delay the point at which the interrupt vector is read by the Z380
MPU, after it has been requested.
The interrupt vector may be either eight or sixteen bits, under program control, and is
latched by the falling edge of IOCLK in the last cycle of the interrupt acknowledge trans-
action. When using Mode 0 interrupts, where the Z380 MPU fetches an instruction from
the interrupting device, these fetches are always eight bits wide and are transferred over
D7-D0.
Page 32 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
RETI Transactions
The RETI transaction is generated whenever an RETI instruction is executed by the Z380
MPU. This transaction is necessary because Z80 family peripherals are designed to watch
instruction fetches and take special action upon seeing a RETI instruction (this is the only
instruction that the Z80 family peripherals watch for). Since the Z380 MPU fetches
instructions using the memory control signals, a simulated RETI instruction fetch must be
placed on the bus with the appropriate I/O bus control signals. This is shown in Figure 23.
Again, note that because all I/O bus transactions start on a rising edge of IOCLK, there
may be up to n BUSCLK cycles of latency between the execution unit request for the
transaction and the transaction actually starting, where n is the programmed clock divisor
for IOCLK.
Page 33 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
1 2 3 4 5 6 7 8 9 10
IOCLK
ADDRESS
/WAIT
/M1
/IORQ
/IORD
/IOWR
/INTAK
The RETI transaction is ten IOCLK cycles long unless extended by Wait states, and
/WAIT is sampled at three separate points during the transaction. /WAIT is first sampled in
the middle of the third IOCLK cycle to allow for longer/IORDLow-time requirements.
/WAIT is then sampled again during the middle of the fifth IOCLK cycle to allow for lon-
ger internal daisy-chain settling time within the peripheral. Wait states inserted here have
the effect of separating what the peripheral sees as two separate instruction fetch cycles.
Finally, /WAIT is sampled in the middle of the ninth IOCLK cycle, again to allow for lon-
ger /IORD Low-time requirements.
The Z380 MPU drives the data bus throughout the RETI transaction, with EDEDH during
the first half of the transaction (the first byte of a RETI instruction is EDH) and with
4D4DH during the second half of the transaction (the second byte of an RETI instruction
is 4DH).
Page 34 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
HALT Transactions
A HALT transaction occurs whenever the Z380 MPU executes a Halt instruction, with the
/HALT signal activated on the falling edge of BUSCLK. If the standby mode is not
enabled, executing a Sleep instruction would also cause a Halt transaction to occur. While
in the Halt state, the Z380 MPU continues to drive the address and data buses, and the
/HALT signal remains active until either an interrupt request is acknowledged or a reset is
received. Refresh transactions may occur while in the halt state and the bus can be granted.
The timing of entry into the Halt state is shown in Figure 24, while the timing of exiting
from Halt state is shown in Figure 25.
T5 THL THH THL
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
/HALT
Page 35 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
/HALT
/INT or /NMI
Page 36 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Requests
A request can be initiated by a device that does not have control of the bus. Two types of
request can occur: Bus request and Interrupt request. When an interrupt or bus request is
made, it is answered by the CPU according to its type. For an interrupt request, the CPU
initiates an interrupt acknowledge transaction and for bus requests, the CPU enters the bus
disconnect state, relinquishes the bus, and activates an Acknowledge signal.
BUS Requests
To generate transactions on the bus, a potential bus master (such as a DMA controller)
must gain control of the bus by making a bus request. A bus request is initiated by driving
/BREQ Low. Several bus requesters may be wired-OR to the /BREQ pin; priorities are
resolved externally to the CPU, usually by a priority daisy chain.
The asynchronous /BREQ signal generates an internal /BUSREQ, which is synchronous.
If the /BREQ is active at the beginning of any transaction, the internal /BUSREQ causes
the /BACK signal to be asserted after the current transaction is completed. The Z380 MPU
then enters the Bus Disconnect state and gives up control of the bus. All Z380 MPU con-
trol signals, except /BACK, /MI and /INTAK are tri-stated. Note that release of the bus
may be inhibited under program control to allow the Z380 MPU exclusive access to a
shared resource; this is controlled by the SETC LCK and RESC LCK instructions. Entry
into the Bus Disconnect state is shown in Figure 26. The Z380 MPU regains control of the
bus after /BREQ is deasserted. This is shown in Figure 27.
Interrupt Requests
The Z380 MPU supports two types of interrupt requests, maskable /INT3-INT0 and non-
maskable (/NMI). The interrupt request line of a device that is capable of generating an
interrupt can be tied to either /NMI or one of the maskable interrupt request lines, and sev-
eral devices can be connected to one interrupt request line with the devices arranged in a
priority daisy chain. However, because of the need for Z80 family peripheral devices to
see the RETI instruction, only one daisy chain of Z80-family peripherals can be used. The
Z380 MPU handles maskable and nonmaskable interrupt requests somewhat differently,
as follows:
Any High-to-Low transition on the /NMI input is asynchronously edge-detected, and the
internal NMI latch is set. At the beginning of the last clock cycle in the last internal
machine cycle of any instruction, the maskable interrupts are sampled along with the state
of the NMI latch.
If an enabled maskable interrupt is requested, at the next possible time (the next rising
edge of IOCLK) an interrupt acknowledge transaction is generated to fetch the interrupt-
vector from the interrupting device.For a nonmaskable interrupt, no interrupt acknowledge
transaction is generated; the NMI service routine always starts at address 00000066H.
Page 37 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
/BREQ
/BACK
/MI
/IORQ
/IORD
/IOWR
/INTAK
Page 38 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
/BREQ
/BACK
/MI
/IORQ
/IORD
/IOWR
/INTAK
Page 39 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Idle Cycles
When no transactions are being performed on the bus, an idle cycle occurs (Figure 16). All
control signals, for both memory and I/O, are inactive during the Idle cycle.
TiH TiL
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
Page 40 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
IOCLK
ADDRESS
/WAIT
/MI
/IORQ
/IORD
/IOWR
/ INTAK
Page 41 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
/IOCTL3-0
/RESET
Page 42 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
ADDRESS
DATA
STATUS
/WAIT
/MSIZE
/TREFR
/TREFA
/TREFC
/MRD
/MWR
/IOCTL3-0
/RESET
Page 43 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
BUSCLK
/RESET
IOCLK
Page 44 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
CPU ARCHITECTURE
The Central Processing Unit (CPU) of the Z380 MPU is a binary-compatible extension of
the Z80 CPU and Z180 CPU architectures. High throughput rates for the Z380 CPU are
achieved by a high clock rate, high bus bandwidth and instruction fetch/execute overlap.
Communicating to the external world through an 8-or 16-bit data bus, the Z380 CPU is a
full 32-bit machine internally, with a 32-bit ALU and 32-bit registers.
Modes Of Operation
The Z380 CPU can operate in either Native or Extended mode, as controlled by a bit in the
Select Register (SR). In Native mode (the Reset configuration), all address manipulations
are performed modulo 65536 (16 bits). In this mode the Program Counter (PC) only incre-
ments across 16 bits, all address manipulation instructions (increment, decrement, add,
subtract, indexed, stack relative, and PC relative) only operate on 16 bits, and the Stack
Pointer (SP) only increments and decrements across 16 bits. The program counter high-
order word is left at all zeros, as is the high-order words of the stack pointer and the I reg-
ister. Thus Native mode is fully compatible with the Z80 CPU's 64 Kbyte address space. It
is still possible to address memory outside of the 64 Kbyte address space for data storage
and retrieved in Native mode, however, direct addresses, indirect addresses, and the high-
order word of the SP, I and the IX and IY registers may be loaded with non-zero values.
But executed code and interrupt service routines must reside in the lowest 64 Kbytes of the
address space.
In Extended mode, however, all address manipulation instructions operate on 32 bits,
allowing access to the entire 4 Gbyte address space of the Z380 MPU. In both Native and
Extended modes, the Z380 CPU drives all 32 bits of the address onto the external address
bus; only the width of manipulated addresses distinguish Native from Extended mode.
The Z380 CPU implements one instruction to allow switching from Native to Extended
mode, but once in Extended mode, only Reset returns the Z380 MPU to Native mode. This
restriction applies because of the possibility of "misplacing" interrupt service routines or
vector tables during the translation from Extended mode back to Native mode.
In addition to Native and Extended mode, which is specific to memory space addressing,
the Z380 MPU can operate in either Word or Long Word mode specific to data load and
exchange operations. In Word mode (the reset configuration), all word load and exchange
operations manipulate 16-bit quantities. For example, only the low-order words of the
source and destination are exchanged in an exchange operation, with the high-order words
unaffected. In Long Word mode, all 32 bits of the source and destination are directives to
allow switching between Word and Long Word mode; SETC LW (Set Control Long
Word) and RESC LW (Reset Control Long Word) perform a global switch, while DDIR
W, DDIR LW and their variants are decoder directives that select a particular mode only
for the instruction that they precede.
Note that all word data arithmetic (as opposed to address manipulation arithmetic), rotate,
shift and logical operations are always in 16-bit quantities. They are not controlled by
either the Native/Extended or Word/Long Word selections. The exceptions to the 16-bit
Page 45 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
quantities are, of course, those multiply and divide operations with 32-bit products or div-
idends.
Lastly, all word Input/Output operations are performed on 16-bit values.
Address Spaces
The Z380 CPU architecture supports five distinct address spaces corresponding to the dif-
ferent types of locations that can be accessed by the CPU. These five address spaces are:
CPU register space, CPU control register space, memory address space, and I/O address
space (on-chip and external).
A F
BCz B C
DEz D E
HLz H L
IXz IXU IXL
IYz IYU IYL
A' F'
BCz' B' C'
DEz' D' E'
HLz' H' L'
IXz' IXU' IXL'
IYz' IYU' IYL'
R
Iz I
SPz SP
PCz PC
Page 46 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Each register set includes the primary registers A, F, B, C, D, E, H, L, IX, and IY, as well
as the alternate registers A’, F’, B’, C’, D’, E’, H’, L’, IX’, and IY’. These byte registers
can be paired B with C, D with E, H with L, B’ with C’, D’ with E’ and H’ with L’ to form
word registers. These word registers are extended to 32 bits with the z extension to the
register. This register extension is only accessible when using the register as a 32-bit regis-
ter (the Long Word mode) or when swapping between the most-significant and least-sig-
nificant word of a 32-bit register. Whenever an instruction refers to a word register, the
implicit size is controlled by the Word or Long Word mode. Also included are the R, I and
SP registers, as well as the PC.
YSR XSR
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DSR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
IYBANK (IY Bank Select). This 2-bit field selects the register set to be used for the IY and
IY' registers. This field can be set independently of the register set selection for the other
Z380 CPU registers. Reset selects Bank 0 for IY and IY'.
IYP (IYPrime Register Select). This bit controls and reports whether IY or IY' is the cur-
rently active register. IY is selected when this bit is cleared and IY' is selected when this
bit is set. Reset clears this bit and selects IY.
IXBANK (IX Bank Select). This 2-bit field selects the register set to be used for the IX and
IX' registers. This field can be set independently of the register set selection for the other
Z380 CPU registers. Reset selects Bank 0 for IX and IX'.
Page 47 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
IXP (IXPrime Register Select). This bit controls and reports whether IX or IX' is the cur-
rently active register. IX is selected when this bit is cleared and IX' is selected when this
bit is set. Reset clears this bit and selects IX.
MAINBANK (Main Bank Select). This 2-bit field selects the register set to be used for the
A, F, BC, DE, HL, A', F', BC', DE' and HL' registers. This field can be set independently
of the register set selection for the other Z380 CPU registers. Reset selects Bank 0 for
these registers.
ALT (BC/DE/HL or BC'/DE'/HL' Register Select). This bit controls and reports whether
BC/DE/HL or BC'/DE'/HL' is the currently active bank of registers. BC/DE/HL are
selected when this bit is cleared and BC'/DE'/HL' are selected when this bit is set. Reset
clears this bit, selecting BC/DE/HL.
XM (Extended Mode). This bit controls the Extended/ Native mode selection for the Z380
CPU. This bit is set by the SETC XM instruction, and once set, it can be cleared only by a
reset on the /RESET pin. When this bit is set, the Z380 CPU is in Extended mode. Reset
clears this bit and the Z380 CPU is in Native mode.
LW (Long Word Mode). This bit controls the Long Word/ Word mode selection for the
Z380 CPU. This bit is set by the SETC LW instruction and cleared by the RESC LW
instruction. When this bit is set, the Z380 CPU is in Long Word mode; when this bit is
cleared, the Z380 CPU is in Word mode. Reset clears this bit. Note that individual instruc-
tions may be executed in either Word or Long Word load and exchange mode, using the
DDIR W and DDIR LW decoder directives.
IEF1 (Interrupt Enable Flag). This bit is the master Interrupt Enable for the Z380 CPU.
This bit is set by the EI instruction and cleared by the DI instruction. When this bit is set,
interrupts are enabled; when this bit is cleared, interrupts are disabled. Reset clears this bit.
IM (Interrupt Mode). This 2-bit field controls the interrupt mode for the /INT0 interrupt
request. These bits are controlled by the IM instructions (00 = IM 0, 01 = IM 1, 10 = IM 2,
11 = IM 3). Reset clears both of these bits, selecting Interrupt Mode 0.
LCK (Lock). This bit controls the Lock/Unlock status of the Z380 CPU. This bit is set by
the SETC LCK instruction and cleared by the RESC LCK instruction. When this bit is set,
no bus requests are accepted, providing exclusive access to the bus by the Z380 CPU.
When this bit is cleared the Z380 CPU will grant bus requests in the normal fashion. Reset
clears this bit.
AFP (AF Prime Register Select). This bit controls and reports whether AF or AF' is the
currently active pair of registers. AF is selected when this bit is cleared and AF' is selected
when this bit is set. Reset clears this bit and selects AF.
Page 48 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
The size of the data element being addressed depends on the instruction being executed as
well as the Word/Long Word mode. A bit can be addressed by specifying a byte, and a bit
within that byte. Bits are numbered from right to left, with the least significant bit being bit
0 (Figure 35).
The address of a multiple-byte entity is the same as the address of the byte with the lowest
memory address in the entity. Multiple-byte entities can be stored beginning with either
even or odd memory addresses. A word (either 2-byte or 4-byte entity) is aligned if its
address is even; otherwise, it is unaligned. Multiple bus transactions, which may be
required to access multiple-byte entities, can be minimized if alignment is maintained.
The formats of multiple-byte data types are also shown in Figure 35. Note that when a
word is stored in memory, the least significant byte precedes the more significant byte of
the word, as in the Z80 CPU architecture. Also, the lower-addressed byte is present on the
upper byte of the external data bus.
7 6 5 4 3 2 1 0
Memory addresses:
Even address (A0=0) Odd address (A0=1)
Page 49 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
TSTIO n OTDMR
When one of these I/O instructions is executed, the Z380 MPU outputs the register address
being accessed in a pseudo transaction of two BUSCLK cycles duration, with the address
signals A31-A8 all at zeros. In the pseudo transaction, all bus control signals are at their
inactive states.
Table 2. External I/O Addressing Options
Address Bus
I/O Instruction A31-A24 A23-A16 A15-A8 A7-A0
Page 50 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
DATA TYPES
The Z380 CPU can operate on bits, Binary-Coded Decimal (BCD) digits (4 bits), bytes (8
bits), words (16 bits or 32 bits), byte strings, and word strings. Bits in registers can be set,
cleared, and tested. BCD digits, packed two to a byte, can be manipulated with the Deci-
mal Adjust Accumulator instruction (in conjunction with binary addition and subtraction)
and the Rotate Digit instructions. Bytes are operated on by 8-bit load, arithmetic, logical,
and shift and rotate instructions. Words are operated on in a similar manner by the word
load, arithmetic, logical, and shift and rotate instructions. Block move and search opera-
tions can manipulate byte strings and word strings up to 64 Kbytes or words long. Block I/
O instructions have identical capabilities.
CPU Registers
The Z380 CPU contains abundant register resources (Figure 33). At any given time, the
program has immediate access to both the primary and alternate registers in the selected
register set. Changing register sets is a simple matter of a LDCTL instruction.
S Z X H X P/V N C
7 6 5 4 3 2 1 0
Page 51 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Carry (C). This flag is set when an add instruction generates a carry or a subtract instruc-
tion generates a borrow. Certain logical, rotate and shift instructions affect the Carry flag.
Add/Subtract (N). This flag is used by the Decimal Adjust Accumulator instruction to
distinguish between add and subtract operations. The flag is set for subtract operations and
cleared for add operations.
Parity/Overflow (P/V). During arithmetic operations this flag is set to indicate a two’s
complement overflow. During logical and rotate operations, this flag is set to indicate even
parity of the result or cleared to indicate odd parity.
Half Carry (H). This flag is set if an 8-bit arithmetic operation generates a carry or borrow
between bits 3 and 4, or if a 16-bit operation generates a carry or borrow between bits 11
and 12, or if a 32-bit operation generates a carry or borrow between bits 27 and 28. This
bit is used to correct the result of a packed BCD addition or subtract operation.
Zero (Z). This flag is set if the result of an arithmetic or logical operation is a zero.
Sign (S). This flag stores the state of the most significant bit of the accumulator.
Index Registers
The four index registers, IX, IX’, IY and IY’, each hold a 32-bit base address that is used
in the Indexed addressing mode. The Index registers can also function as general-purpose
registers with the upper and lower byte of the lower 16 bits being accessed individually.
These byte registers are called IXU, IXU’, IXL and IXL’ for the IX and IX’ registers, and
IYU, IYU’, IYL and IYL’ for the IY and IY’ registers.
Interrupt Register
The Interrupt register (I) is used in interrupt modes 2 and 3 for /INT0 to generate a 32-bit
indirect address to an interrupt service routine. The I register supplies the upper twenty-
four or sixteen bits of the indirect address and the interrupting peripheral supplies the
lower eight or sixteen bits. In the Assigned Vectors mode for /INT1-3 the upper sixteen
bits of the vector are supplied by the I register; bits 15-9 are the assigned vector base and
bits 8-0 are the assigned vector unique to each of /INT1-3.
Program Counter
The Program Counter (PC) is used to sequence through instructions in the currently exe-
cuting program and to generate relative addresses. The PC contains the 32-bit address of
the current instruction being fetched from memory. In the Native mode, the PC is effec-
tively only 16 bits long, as carries from bit 15 to bit 16 are inhibited in this mode. In
Extended mode, the PC is allowed to increment across all 32 bits.
R Register
The R register can be used as a general-purpose 8-bit read/write register. The R register is
not associated with the refresh controller and its contents are changed only by the user.
Page 52 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Stack Pointer
The Stack Pointer (SP) is used for saving information when an interrupt or trap occurs and
for supporting subroutine calls and returns. Stack Pointer relative addressing allows
parameter passing using the SP.
Select Register
The Select Register (SR) controls the register set selection and the operating modes of the
Z380 CPU. The reserved bits in the SR are for future expansion; they will always read as
zeros and should be written with zeros for future compatibility. The SR is shown in
Figure 34.
Addressing Modes
Addressing modes are used by the Z380 CPU to calculate the effective address of an oper-
and needed for execution of an instruction. Seven addressing modes are supported by the
Z380 CPU. Of these seven, one is an addition to the Z80 CPU addressing modes (Stack
Pointer Relative) and the remaining six modes are either existing or extensions to the Z80
CPU addressing modes.
Register. The operand is one of the 8-bit registers (A, B, C, D, E, H, L, IXU, IXL, IYU,
IYL, A', B', C', D', E', H' or L'); or is one of the 16-bit or 32-bit registers (BC, DE, HL, IX,
IY, BC', DE', HL', IX', IY' or SP) or one of the special registers (I or R).
Immediate. The operand is in the instruction itself and has no effective address. The
DDIR IB and DDIR IW decoder directives allow specification of 24-bit and 32-bit imme-
diate operands, respectively.
Indirect Register. The contents of a register specify the effective address of an operand.
The HL register is the primary register used for memory accesses, but BC and DE can also
be used. (For the JP instruction, IX and IY can also be used for indirection.) The BC regis-
ter is used for I/O space accesses.
Direct Address. The effective address of the operand is the location whose address is
contained in the instruction. Depending on the instruction, the operand is either in the I/O
or memory address space. Sixteen bits of direct address is the norm, but the DDIR IB and-
DDIR IW decoder directives allow 24-bit and 32-bit direct addresses, respectively.
Indexed. The effective address of the operand is the location computed by adding the
two's-complement signed displacement contained in the instruction to the contents of the
IX or IY register. Eight bits of index is the norm, but the DDIR IB and DDIR IW decoder
directives allow 16-bit and 24-bit indexes, respectively.
Program Counter Relative. An 8-, 16-or 24-bit displacement contained in the instruc-
tion is added to the Program Counter to generate the effective address. This mode is avail-
able only for Jump and Call instructions.
Page 53 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Stack Pointer Relative. The effective address of the operand is the location computed by
adding the two's-complement signed displacement contained in the instruction to the con-
tents of the Stack Pointer. Eight bits of index is the norm, but the DDIR IB and DDIR IW
decoder directives allow 16-and 24-bit indexes, respectively.
Page 54 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
INSTRUCTION SET
The Z380 CPU’s instruction set is a superset of the Z80 CPU’s; the Z380 CPU is opcode
compatible with the Z80 CPU. Thus a Z80 program can be executed on a Z380 MPU with-
out modification. The instruction set is divided into seventeen groups by function:
The instructions are divided into the following categories.
• 8-bit load group
• 16/32 bit load group
• Push/Pop group
• Exchanges, block transfers, and searches
• 8-bit arithmetic and logic operations
• General purpose arithmetic and CPU control
• Decoder Directive Instructions
• 16/32 bit arithmetic operations
• Multiply/Divide Instruction group
• 8-bit Rotates and shifts
• 16-bit Rotates and shifts
• 8-bit bit set, reset, and test operations
• Jumps
• Calls, returns, and restarts
• 8-bit input and output operations for External I/O address space
• 8-bit input and output operations for Internal I/O address space
• 16-bit input and output operations
Instruction Set
The following is a summary of the Z380 instruction set which shows the assembly lan-
guage mnemonic, the operation, the flag status, and gives comments on each instructions.
Note: Mnemonic and object code assignment for newly added instructions (instructions in Italic
face) are preliminary and subject to change without notice.
The Z380 Technical Manual will contain significantly more details for programming use.
A list of instructions, as well as encoding is included in Appendix A of this document.
Page 55 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
nn A 16-bit constant
d An 8-bit offset. (2’s complement)
r Any one of the CPU register A, B, C, D, E, H, L
s Any 8-bit location for all the addressing modes allowed for the particular
instruction.
dd,qq,ss,tt,uu Any 16-bit location for all the addressing modes allowed for the
particular instruction.
xxh MS Byte of the specified 16-bit location
xxl LS Byte of the specified 16-bit location
SR Select Register
XY Index register (IX or IY)
XYz Index Register Extend (IXz or IYz)
XYU MS Byte of index register (IXU or IYU)
XYL LS Byte of index register (IXL or IYL)
SP Current Stack Pointer
(C) I/O Port pointed by C register
cc Condition Code
[] Optional field
() Indirect Address Pointer or Direct Address
Page 56 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Z Zero flag
H Half carry flag
P/V Parity/Overflow flag
N Add/Subtract flag
C Carry Flag
The flag is affected according to the result of the
operation.
*Abbreviated set
Page 57 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Field Encoding
The convention for opcode binary format is shown in the following Tables. For example,
to get the opcode format on the instruction LD (IX+12h), C; first find out the entry for LD
(XY+d),r. That entry has an opcode format of:
11 y11 101
01 110 r
d
At the bottom of each Table (between Table and Notes), the binary format is the following:
r,r’ Reg s Regs y XY
000 B 000 B 0 IX
001 C 001 C 1 1Y
010 D 010 D
011 E 011 E
100 H 100 IXU (x = 0),IYU(x = 1)
101 L 101 IXL (x = 0),IYL(x = 1)
111 A 111 A
To form the opcode first look for the y field value for the IX register, which is 0. Then find
r field value for the C register, which is 001. Replace the y and r fields with the value from
the table; replace d value with the real number. The results are:
76 543 210 Hex
11 011 101 DD
01 110 001 71
00 010 010 12
Page 58 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
LD r,r’ r ← r’ • • x • x • • • 01 r r’ 1 2
LD r,n r←n • • x • x • • • 00 r 110 2 2
←⎯ n ⎯→
LD XYU,n XYU ← n • • x • x • • • 11 y11 101 3 2
00 100 110 26
←⎯ n ⎯→
LD XYL,n XYL ← n • • x • x • • • 11 y11 101 3 2
00 101 110 2E
←⎯ n ⎯→
LD r,(HL) r ← (HL) • • x • x • • • 01 r 110 1 2+r
LD r,(XY+d) r ← (XY+d) • • x • x • • • 11 y11 101 3 4+r I
01 r 110
←⎯ d ⎯→
LD (HL),r (HL) ← r • • x • x • • • 01 110 r 1 3+w
LD (XY+d),r (XY+d) ← r • • x • x • • • 11 y11 101 3 5+w I
01 110 r
←⎯ d ⎯→
LD (HL),n (HL) ← n • • x • x • • • 00 110 110 36 2 3+w
←⎯ n ⎯→
LD (XY+d),n (XY+d) ← n • • x • x • • • 11 y11 101 4 5+w I
00 110 110 36
←⎯ d ⎯→
←⎯ n ⎯→
LD A,(BC) A ← (BC) • • x • x • • • 00 001 010 0A 1 2+r
LD A,(DE) A ← (DE) • • x • x • • • 00 011 010 1A 1 2+r
LD A,(nn) A ← (nn) • • x • x • • • 00 111 010 3A 3 3+r I
←⎯ n ⎯→
←⎯ n ⎯→
LD (BC),A (BC) ← A • • x • x • • • 00 000 010 02 1 3+w
LD (DE),A (DE) ← A • • x • x • • • 00 010 010 12 1 3+w
LD (nn),A (nn) ← A • • x • x • • • 00 110 010 32 3 4+w I
←⎯ n ⎯→
←⎯ n ⎯→
Page 59 of 125
PS010002-0708
Z380 Microprocessor
Product Specification
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
Page 60 of 125
PS010002-0708
16/32 BIT LOAD GROUP
Page 61 of 125
MICROPROCESSOR
Page 62 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
L1: In Long Word mode, this instruction loads in 32 bits; dst(31-0) ← src(31-0)
Page 63 of 125
PUSH/POP INSTRUCTIONS
qq Pair y XY
00 BC 0 IX
01 DE 1 IY
10 HL
11 AF
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
L2: In Long Word mode, this instruction PUSHes the register’s extended portion (register with “z” suffix) before pushing the contents of the register
to the stack.
L3: In Long Word mode, this instruction POPs the register’s extended portion (register with “z” suffix) after popping the contents of the register to the
stack.
L4: In Long Word mode, PUSH AF and PUSH nn instructions push 0000h onto stack in the place of the extended register portion.
L5: In Long Word mode, POP AF instruction increments SP by two after POPing 1 word of data from stack.
L6: In Long Word mode, this instruction POPs one more word from stack and loads into SR(31-16), instead of duplicating (SP+1) location into SR(31-
16).
N: In Native mode, this instruction uses addresses modulo 65536.
Page 64 of 125
EXCHANGE, BLOCK TRANSFER, BLOCK SEARCH GROUPS
Page 65 of 125
EXCHANGE, BLOCK TRANSFER, BLOCK SEARCH GROUPS (Continued)
Page 66 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
r Reg pp Regs y XY
000 B 00 BC 0 IX
001 C 00 DE 1 IY
010 D 11 HL
011 E
100 H
101 L
111 A
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
L7: In Long Word mode, this instruction exchanges in 32-bits;
src(31-0) ↔ dst(31-0)
L8: In Long Word mode, this instruction transfers in 2 words and BC modified by 4 instead of 2
N: In Native mode, this instruction uses addresses modulo 65536.
Page 67 of 125
8-BIT ARITHMETIC AND LOGICAL GROUP
Page 68 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
r Reg y XY
000 B 0 IX
001 C 1 IY
010 D
011 E
100 H
101 L
111 A
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
(5): Two cycles to execute for Accumulator, three cycles to execute for any other registers.
Page 69 of 125
GENERAL PURPOSE ARITHMETIC AND CPU CONTROL GROUP
Page 70 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
vv Control Regs
01 XSR
10 DSR
11 YSR
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
L1: In Long Word mode, this instruction loads in 32 bits; dst(31-0) ← src(31-0)
L9: In Long Word mode, this instruction operates in 32-bits; If A(7) = 0 then HL(31-16) = 0000h else FFFFh
@: Converts accumulator content into packed BCD following add or subtract with packed BCD operands.
#: Interrupts are not sampled at the end of EI and DI.
Page 71 of 125
DECODER DIRECTIVE INSTRUCTIONS
Opcode # of Execute
Mnemonic Operation 76 543 210 HEX Bytes Time Notes
Page 72 of 125
16/32 BIT ARITHMETIC AND LOGICAL GROUP
Page 73 of 125
16/32 BIT ARITHMETIC AND LOGICAL GROUP (Continued)
uu is any of rr, nn, t, (IX+d), (IY+d) as shown for ADDW instruction. The indicated bits replace the (000) is the ADD set
above.
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
X1: In Extend mode, this instruction operates in 32-bits;
src(31-0) ← src(31-0) opr dst(31-0)
Page 74 of 125
MULTIPLY/DIVIDE INSTRUCTION GROUP
MULTUW uu instructions, uu is any of pp, nn, XY, (nn), (XY+d) as shown for MULTW instruction with replacing (010) by
(010). Execute time is time required for MUTW with one more clock.
Page 75 of 125
MULTIPLY/DIVIDE INSTRUCTION GROUP (Continued)
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
Page 76 of 125
8-BIT ROTATE AND SHIFT GROUP
r Reg pp Regs y XY
000 B 00 BC 0 IX
001 C 00 DE 1 IY
010 D 11 HL
011 E
100 H
101 L
111 A
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
(6): The contents of the upper half of the accumulator is unaffected.
Page 77 of 125
16/32 BIT ROTATE AND SHIFT GROUP
pp Regs y XY
00 BC 0 IX
00 DE 1 IY
11 HL
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
Page 78 of 125
8-BIT BIT SET, RESET, AND TEST GROUP
To form new opcode replace (11) of SET b,s with (10). s is any of r,(HL), (XY+d).
The notation mb indicates location m, bit b(0~7)
r Reg y XY
000 B 0 IX
001 C 1 IY
010 D
011 E
100 H
101 L
111 A
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be operate with DDIR Immediate instructions.
Page 79 of 125
JUMP GROUP
Page 80 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
cc Condition
000 NZ (Non-zero)
001 Z (Zero)
010 NC (Non-carry)
011 C (Carry)
100 PO (Parity Odd), or NV (Non-Overflow)
101 PE (Parity Even), or V (Overflow)
110 P (Sign positive), or NS (No sign)
111 M (Sign negative), or S (Sign)
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
N: In Native mode, this instruction uses addresses modulo 65536.
X2: In Extend mode, this instruction loads bit 31-16 portion of the operand into PC(31-16).
(7): e is a signed two’s complement number in the range [-126, 129], e-2 in the opcode provides an effective address of pc+e as PC is incremented
by 2 prior to the addition of e.
(8): ee is a signed two’s complement number in the range [-32765, 32770], ee-4 in the opcode provides an effective address of pc+e as PC is
incremented by 4 prior to the addition of e.
(9): eee is a signed two’s complement number in the range [-8388604, 8388611], eee-5 in the opcode provides an effective address of pc+e as PC
is incremented by 5 prior to the addition of e.
Page 81 of 125
CALL AND RETURN GROUP
Page 82 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
cc Condition t p
000 NZ (Non-zero) 000 00H
001 Z (Zero) 001 08H
010 NC (Non-carry) 010 10H
011 C (Carry) 011 18H
100 PO (Parity Odd), or NV (Non-Overflow) 100 20H
101 PE (Parity Even), or V (Overflow) 101 28H
110 P (Sign positive), or NS (No sign) 110 30H
111 M (Sign negative), or S (Sign) 111 38H
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
Page 83 of 125
8-BIT INPUT AND OUTPUT GROUP
Page 84 of 125
Symbolic Flags P/ Opcode # of Execute
Mnemonic Operation S Z x H x V N C 76 543 210 HEX Bytes Time Notes
r Reg
000 B
001 C
010 D
011 E
100 H
101 L
111 A
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
N: In Native mode, this instruction address modulo 65536.
(1): P/V flag is 0 if the result of BC-1 = 0, otherwise P/V = 1/.
(2): P/V flag is 0 only at completion of instruction.
Page 85 of 125
INPUT AND OUTPUT INSTRUCTIONS FOR ON-CHIP I/O SPACE
r Reg
010 D
011 E
100 H
101 L
111 A
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
N: In Native mode, this instruction address modulo 65536.
(1): P/V flag is 0 if the result of BC-1 = 0, otherwise P/V = 1/.
(2): P/V flag is 0 only at completion of instruction.
Page 86 of 125
16-BIT INPUT AND OUTPUT GROUP
Page 87 of 125
16-BIT INPUT AND OUTPUT GROUP (Continued)
ppp Reg
000 BC
010 DE
111 HL
Notes:
Instructions in Italic face are Z380 new instructions, instructions with underline are Z180 original instructions.
I: This instruction may be used with DDIR Immediate instructions.
N: In Native mode, this instruction uses addresses modulo 65536.
(1) If the result of B-1 is zero, the Z flag is set; otherwise it is reset.
(2) Z flag is set upon instruction completion only.
Address Bus
I/O Instruction A31-A24 A23-A16 A15-A8 A7-A0
Page 88 of 125
INTERRUPTS
The Z380 MPU’s interrupt structure provides compatibility As discussed in the CPU Architecture section, the Z380
with the existing Z80 and Z180 MPUs with the following MPU can operate in either the Native or Extended Mode.
exception: The undefined opcode trap’s occurrence is In Native Mode, PUSHing and POPing of the stack to save
with respect to the Z380 instruction set, and its response and retrieve interrupted PC values in interrupt handling are
is improved (vs the Z180) to make trap handling easier. done in 16-bit sizes, and the stack pointer rolls over at the
The Z380 MPU also offers additional features to enhance 64 Kbyte boundary. In Extended Mode, the PC PUSHes
flexibility in system design. and POPs are done in 32-bit sizes, and the stack pointer
rolls over at the 4 Gbyte memory space boundary. The
Of the five external interrupt inputs provided, the /NMI is a Z380 MPU provides an Interrupt Register Extension, whose
nonmaskable interrupt. The remaining inputs, /INT3-/INT0, contents are always outputted as the address bus signals
are four asynchronous maskable interrupt requests. A31-A16 when fetching the starting addresses of service
routines from memory in interrupt modes 2, 3 and the
In an Interrupt Acknowledge transaction, address outputs assigned vectors mode. In Native Mode, such fetches are
A31-A0 are driven to logic 1's. One output among A3-A0 is automatically done in 16-bit sizes and in Extended Mode,
driven to logic 0 to indicate the maskable interrupt request in 32-bit sizes. These starting addresses should be even-
being acknowledged. If /INT0 is being acknowledged, aligned in memory locations. That is, their least significant
A3-A1, is at logic 1's and A0 is at logic 0. bytes should have addresses with A0 = 0.
Interrupt modes 0 through 3 are supported for the external Interrupt Priority Ranking
maskable interrupt request /INT0. Modes 0, 1 and 2 have The Z380 MPU assigns a fixed priority ranking to handle its
the same schemes as those in the Z80 and Z180 MPUs. interrupt sources, as shown in Table 2.
Mode 3 is similar to mode 2, except that 16-bit interrupt
vectors are expected from the I/O devices. Note that 8-bit Table 2. Interrupt Priority Ranking
and 16-bit I/O devices can be intermixed in this mode by
having external pull up resistors at the data bus signals Priority Interrupt Sources
D15-D8, for example. Highest Trap (undefined opcode)
/NMI
The external maskable interrupt requests /INT3-/INT1 are ↓ /INT0
handled in an assigned interrupt vectors mode. /INT1
/INT2
Lowest /INT3
Page 89 of 125
Interrupt Control
The Z380 MPU’s flags and registers associated with inter- the on-chip I/O address space and can be accessed only
rupt processing are listed in Table 4. As discussed in the with reserved on-chip I/O instructions.
CPU Architecture section, some of the registers reside in
IEF1, IEF2
IEF1 controls the overall enabling and disabling of all on- end of the /NMI interrupt service routine, execution of the
chip peripheral and external maskable interrupt requests. Return From Nonmaskable Interrupt instruction, RETN,
If IEF1 is at logic 0, all such interrupts are disabled. The automatically copies the state of IEF2 back to IEF1. This is
purpose of IEF2 is to correctly manage the occurrence of a means to restore the interrupt enable condition existing
/NMI. When /NMI is acknowledged, the state of IEF1 is before the occurrence of /NMI. Table 5 summarizes the
copied to IEF2 and then IEF1 is cleared to logic 0. At the states of IEF1 and IEF2 resulting from various operations.
Note:
NC = No Change
I, I Extend
The 8-bit Interrupt Register and the 16-bit Interrupt
Register Extension are cleared during reset.
Page 90 of 125
Interrupt Enable Register
IE3-IE0 (Interrupt Request Enable Flags). These flags Reserved bits 7-4. Read as 0s, should write to as 0s.
individually indicate F /INT3, /INT2, /INT1 or /INT0 is
enabled. Note that these flags are conditioned with enable
and disable interrupt instructions (with arguments).
IER: 00000017H
Read Only
7 0
0 0 0 0 0 0 0 1 Reset Value
Encoded Interrupt
Requests
Interrupt Requests
Enable
AVBR: 00000018H
R/W
7 0
0 0 0 0 0 0 0 0 Reset Value
Reserved
Program as 0
Read as 0
Assigned Vectors
Base
Page 91 of 125
Trap and Break Register
Reserved bits 7-2. Some of these bits are reserved for Refer to the Z380 ICE specifications for details. Read as 0s,
breakpoint functions, including a Break-on-Halt feature. should write to as 0s.
TRPBK: 00000019H
R/W
7 0
-- -- -- -- -- -- TF TV
0 0 0 0 0 0 0 0 Reset Value
TF (Trap on Instruction Fetch). TF goes active to logic 1 TV (Trap on Interrupt Vector). TV goes active to logic 1
when an undefined opcode fetched in the instruction when an undefined opcode is returned as a vector in an
stream is detected. TF can be reset under program control interrupt acknowledge transaction in mode 0. TV can be
by writing it with a logic 0. However, it cannot be written with reset under program control by writing it with a logic 0.
a logic 1. However, it cannot be written with a logic 1.
Trap Interrupt
The Z380 MPU generates a trap when an undefined If the undefined opcode was a returned interrupt
opcode is encountered. The trap is enabled immediately vector (in interrupt mode 0), the interrupted PC value
after reset, and it is not maskable. This feature can be used is pushed onto the stack.
to increase software reliability or to implement extended
instructions. An undefined opcode can be fetched from 3. The states of IEF1 and IEF2 are cleared.
the instruction stream, or it can be returned as a vector in
an interrupt acknowledge transaction in interrupt mode 0. 4. The Z380 MPU commences to fetch and execute
When a trap occurs, the Z380 MPU operates as follows. instructions from address 00000000H.
1. The TF or TV bit in the Assigned Vectors Base and Trap Note that instruction execution resumes at address 0,
Register goes active, to indicate the source of the similar to the occurrence of a reset. Testing the TF and TV
undefined opcode. bits in the Assigned Vectors Base and Trap Register will
distinguish the two events. Even if trap handling is not in
2. If the undefined opcode was fetched from instruction place, repeated restarts from address 0 is an indicator of
stream, the starting address of the trap causing in- possible illegal instructions at system debugging.
struction is pushed onto the stack. (Note that the
starting address of a decoder directive preceding an
instruction encoding is considered the starting ad-
dress of the instruction.)
Page 92 of 125
Nonmaskable Interrupt Interrupt Mode 2 Response For
The nonmaskable interrupt input /NMI is edge sensitive, Maskable interrupt /INT0
with the Z380 MPU internally latching the occurrence of its During the interrupt acknowledge transaction, the external
falling edge. When the latched version of /NMI is recog- I/O device being acknowledged is expected to output a
nized, the following operations are performed. vector onto the lower portion of the data bus, D7-D0. The
interrupted PC value is PUSHed onto the stack and IEF1
1. The interrupted PC (Program Counter) value is pushed and IEF2 are reset to logic 0’s so as to disable further
onto the stack. maskable interrupt requests. The Z380 MPU then reads an
entry from a table residing in memory and loads it into the
2. The state of IEF1 is copied to IEF2, then IEF1 is cleared. PC to resume execution. The address of the table entry is
composed of the I Extend contents as A31-A16, the I
3. The Z380 MPU commences to fetch and execute in- Register contents as A15-A8 and the vector supplied by
structions from address 00000066H. the I/O device as A7-A0. Note that the table entry is
effectively the starting address of the interrupt service
Interrupt Mode 0 Response For routine designed for the I/O device being acknowledged.
Maskable Interrupt /INT0 The table, composed of starting addresses for all the
During the interrupt acknowledge transaction, the external interrupt mode 2 service routines, can be referred to as the
I/O device being acknowledged is expected to output a interrupt mode two vector table. Each table entry should
vector onto the lower portion of the data bus, D7-D0. The be word-sized if the Z380 MPU is in the Native Mode and
Z380 MPU interprets the vector as an instruction opcode, longword-sized if in the Extended Mode, in either case it is
which is usually one of the single-byte Restart (RST) even-aligned (least significant byte with address A0 = 0).
instructions that pushes the interrupted PC (Program
Counter) value onto the stack and resumes execution at a Interrupt Mode 3 Response For
fixed memory location. However, the Z380 MPU will gen- Maskable Interrupt /INT0
erate multiple transactions to capture vectors that form a Interrupt mode 3 is similar to mode 2 except that a 16-bit
multi-byte instruction. IEF1 and IEF2 are reset to logic 0’s, vector is expected to be placed on the data bus D15-D0 by
disabling all further maskable interrupt requests. Note that the I/O device during the interrupt acknowledge transac-
unlike the other interrupt responses, the PC is not automati- tion. The interrupted PC is PUSHed onto the stack. IEF1
cally PUSHed onto the stack. Note also that a trap occurs and IEF2 are reset to logic 0’s so as to disable further
if an undefined opcode is supplied by the I/O device as a maskable interrupt requests. The starting address of the
vector. service routine is fetched and loaded into the PC to resume
execution from the memory location with an address
Interrupt Mode 1 Response For composed of the I Extend contents as A31-A16 and the
Maskable Interrupt /INT0 vector supplied by the I/O device as A15-A0. Again the
An interrupt acknowledge transaction is generated, during starting address of the service routine is word-sized if the
which the data bus contents are ignored by the Z380 MPU. Z380 MPU is in the Native Mode and longword-sized if in
The interrupted PC value is PUSHed onto the stack. IEF1 the Extend Mode, in either case even-aligned.
and IEF2 are reset to logic 0’s so as to disable further
maskable interrupt requests. Instruction fetching and ex-
ecution restarts at memory location 00000038H.
Page 93 of 125
Assigned Interrupt Vectors Mode For RETI Instruction
Maskable interrupt INT3-/INT1 The Z80 family I/O devices are designed to monitor the
When the Z380 MPU recognizes one of the external Return from Interrupt opcodes in the instruction stream
maskable interrupts it generates an Interrupt Acknowl- (RETI-EDH, 4DH), signifying the end of the current inter-
edge transaction which is different than that for /INT0. The rupt service routine. When detected, the daisy chain within
Interrupt Acknowledge transaction for /INT3-/INT1 has the and among the device(s) resolves and the appropriate
I/O bus signal /INTAK active, with /MI, /IORQ, /IORD and/ interrupt-under-service condition clears. The Z380 MPU
IOWR inactive. The interrupted PC value is PUSHed onto reproduces the opcode fetch transactions on the I/O bus
the stack. IEF1 and IEF2 are reset to logic 0s, disabling when the RETI instruction is executed. Note that the Z380
further maskable interrupt requests. The starting address MPU outputs the RETI opcodes onto both portions of the
of an interrupt service routine is fetched from a table entry data bus (D15-D8 and D7-D0) in the transactions.
and loaded into the PC to resume execution. The address
of the table entry is composed of the I Extend contents as
A31-A16, the AB bits of the Assigned Vectors Base Reg-
ister as A15-A9 and an assigned interrupt vector specific
to the request being recognized as A8-A0. The assigned
vectors are defined in Table 5.
/INT1 00H
/INT2 04H
/INT3 08H
Page 94 of 125
ON-CHIP PERIPHERAL FUNCTIONS
IOCR0: 00000011H
R/W
7 0
I/O Clock
Reserved Program as 0
Read as 0
Page 95 of 125
I/O Bus Control Register 1
When this phantom register IOCR1 with address states are also inserted in each of the opcode fetch
00000012H is accessed with one of the on-chip I/O write transactions of the Return from Interrupt (RETI) instruction
instructions, a heartbeat transaction that emulates a Z80 reproduced on the I/O bus. When programmed with 0s, the
CPU instruction fetch is performed on the I/O bus. This I/O waits are disabled.
transaction provides a /M1 pulse which is necessary as
part of an interrupt enable sequence for a Z80 PIO product. RTW1-RTW0 (RETI Waits). This binary field defines up to
In the on-chip I/O write instruction, the data being "written" three wait states to be inserted between opcode fetch
can be of any value. In case of an on-chip I/O read with the transactions of the Return from Interrupt instruction repro-
IOCR1 address, the data returned is unpredictable. duced on the I/O bus.
I/O Waits Register DCW2-DCW0 (Interrupt Daisy Chain Waits). This binary
OW2-IOW0 (I/O Waits). This binary field defines up to field defines up to seven wait states to be inserted at the
seven wait states to be inserted in external I/O read and early portions of interrupt acknowledge transactions, for
write transactions, and at the latter portions of interrupt the interrupt daisy chain through the external I/O devices
transactions to capture interrupt vectors. The defined wait to settle.
IOWR: 0000000EH
R/W
7 0
Interrupt Daisy
Chain Waits
RET I Waits
I/O Waits
Page 96 of 125
MEMORY CHIP SELECTS AND WAITS
The Z380 MPU offers two schemes to generate chip select A flexible wait state insertion scheme is incorporated in the
signals to access the lowest 16 Mbytes of its memory chip select logic. A user can program T1, T2 and T3 waits
address space. The first scheme provides six chip select separately for accesses to the lower, upper and mid-range
signals, with the address space partitioned as shown in memory areas. If chip select scheme one is in effect,
Figure 30. The second scheme provides three chip select different wait states can be defined for each of the mid-
signals, and the address space partitioning is shown in range memory areas 3 through 0.
Figure 31. Note that the /MCS0 signal is used to indicate
accesses to the entire mid-range memory in the second 00FFFFFF
scheme.
Upper
/UMCS Memory
00FFFFFF
/UMCS Upper
Memory
Unused
Mid-range Mid-range
/MCS3 /MCS Memory
Memory3
Mid-range
/MCS2 Memory2
Mid-range
/MCS1 Memory1
Mid-range Lower
/LMCS
/MCS0 Memory0 Memory
Unused 00000000
Lower
/LMCS Memory
00000000
Figure 31. Chip Select Address Space
Page 97 of 125
Lower Memory Chip Select Control Lower Memory Chip Select Register 1
This memory area has its lower boundary at address MA23-MA16 (Match Address Bits 23-16). If a
000000000H. A user can define the size to be an integer match address bit is at logic 1, the corresponding address
power of two, starting at 4 Kbytes. For example, the lower signal of a memory transaction is compared for a logic 0,
memory area can be either 4 Kbytes, 8 Kbytes, 16 Kbytes, as a condition for /LMCS to become active. If the match
etc., starting from address 0. The /LMCS signal can be address bit is at logic 0, the corresponding address signal
enabled to go active during refresh transactions. is not compared (don't care). For example, MA23 deter-
mines if A23 should be tested for a logic 0 in memory
Lower Memory Chip Select Register 0 transactions. Note that in order for /LMCS to go active in a
MA15-MA12 (Match Address Bits 15-12). If a match ad- memory transaction, the /LMCS function has to be enabled
dress bit is at logic 1, the corresponding address signal of in the Memory Selects Master Enable Register (described
a memory transaction is compared for a logic 0, as a later), all the address signals A31-A24 at logic 0s, and all
condition for /LMCS to become active. If the match ad- the address signals A23-A12 programmed for address
dress bit is at logic 0, the corresponding address signal is matching in the above registers have to be at logic 0s. To
not compared (don't care). For example, MA12 deter- define the lower memory area as 4 Kbytes, MA23-MA12
mines if A12 should be tested for a logic 0 in memory should be programmed with 1s. For an area larger than 4
transactions. Kbytes, MA23-MA12 (in that order) should be programmed
with contiguous 1s followed by contiguous 0s. This is the
Reserved bits 3-1. Read as 0s, should write to as 0s. intended usage to maintain the lower memory area as a
single block. Note also that /LMCS can be enabled for
ERF (Enable for Refresh transactions). If this bit is pro- refresh transactions independent of the value programmed
grammed to a logic one, /LMCS goes active during refresh into the Memory Selects Master Enable Register.
transactions.
LMCSR1: 00000001H
R/W
LMCSR0: 00000000H
R/W 7 0
7 0
MA23 MA22 MA21 MA20 MA19 MA18 MA17 MA16
MA15 MA14 MA13 MA12 -- -- -- ERF
1 1 1 1 0 0 0 0 <- Reset Value
0 0 0 0 0 0 0 0 <- Reset Value
Page 98 of 125
Upper Memory Chip Select Control Upper Memory Chip Select Register 1
The upper boundary for this memory area is address MA23-MA16 (Match Address Bits 23-16). If a match ad-
00FFFFFFH. A user can define the area immediately below dress bit is at logic 1, the corresponding address signal of
this boundary with a size that is an integer power of two, a memory transaction is compared for a logic 1, as a
starting at 4 Kbytes. That is, the upper memory area can be condition for /UMCS to become active. If the mask address
either 4 Kbytes, 8 Kbytes, 16 Kbytes and so on. The /UMCS bit is at logic 0, the corresponding address signal is not
signal can be enabled to go active during refresh transac- compared (don't care). For example, MA23 determines if
tions. A23 should be tested for a logic 1 in memory transactions.
Note that in order for/UMCS to go active in a memory
Upper Memory Chip Select Register 0 transaction, the /UMCS function has to be enabled in the
MA15-MA12 (Match Address Bits 15-12). If a match ad- Memory Selects Master Enable Register (described later),
dress bit is at logic 1, the corresponding address signal of all the address signals A31-A24 at logic 0s, and all the
a memory transaction is compared for a logic 1, as a address signals A23-A12 programmed for address match-
condition for /UMCS to become active. If the match ad- ing in the above registers have to be at logic 1s. To define
dress bit is at logic 0, the corresponding address signal is the upper memory area as 4 Kbytes, MA23-MA12 should
not compared (don't care). For example, MA12 deter- be programmed with 1s. For an area larger than 4 Kbytes,
mines if A12 should be tested for a logic 1 in memory MA23-MA12 (in that order) should be programmed with
transactions. contiguous 1s followed by contiguous 0s. This is the
intended usage to maintain the upper memory area as a
Reserved bits 3-1. Read as 0s, should write to as 0s. single block. Note also that /UMCS can be enabled for
refresh transactions independent of the value programmed
ERF (Enable for Refresh Transactions). If this bit is pro- into the Memory Selects Master Enable Register.
grammed to a logic 1, /UMCS goes active during
refresh transactions.
UMCSR1: 00000003H
R/W
7 0
UMCSR0: 00000002H
R/W MA23 MA22 MA21 MA20 MA19 MA18 MA17 MA16
7 0
1 1 1 1 0 0 0 0 <- Reset Value
MA15 MA14 MA13 MA12 -- -- -- ERF
0 0 0 0 0 0 0 0 <- Reset Value Match Address
Bits 23-16
Enable for Refresh
Reserved
Program as 0
Read as 0
Figure 35. Upper Memory Chip Select Register 1
Match Address Bits 15-12
Page 99 of 125
Mid-range Memory Chip Select(s) Control Mid-range Memory Chip Select Register 1
In chip select scheme 1, a user can define the base MA23-MA16 (Match Address bits). In chip select scheme
address and the total size of the mid-range memory area. 1, if a match address bit is at logic 1, the corresponding
The /MCS0 signal would be active for the lowest quarter address signal of a memory transaction is compared with
portion of the area defined, starting from the base address. the corresponding base address bit for a match, as a
Each of the /MCS1-/MCS3 signals would be active, corre- condition for one of /MCS3-/MCS0 to become active. If the
sponding to the successively higher quarter portions of the match address bit is at logic 0, the corresponding address
total mid-range memory area. In chip select scheme 2, the signal and base address bit are not compared (don't
mid-range memory area is between the lower and upper care). For example, MA23 determines if A23 should be
memory areas. The /MCS3-/MCS0 signals can be individu- compared for a match with BA23. The contents of this
ally enabled to go active in refresh transactions. register have no effects in chip select scheme 2.
Reserved bits 5-4. Read as 0s, should write to as 0s. Mid-range Memory Chip Select
Register 2 & 3
ERF3-ERF0 (Enable for Refresh Transactions). The mid-
range memory chip select signals can be individually
enabled to go active during refresh transactions. As an MMCSR2: 00000006H
example, /MCS0 goes active in refresh transactions if R/W
ERF0 is programmed at logic 1. 7 0
BA15 BA14 -- -- -- -- -- --
Reserved Bits
Match Address
Bits 15-14
BA23 BA22 BA21 BA20 BA19 BA18 BA17 BA16 T3W2-T3W0 (T3 Waits). This binary field defines up to
0 0 0 0 0 0 0 0 <- Reset Value seven T3 wait states to be inserted in transactions access-
ing the upper memory area.
T3 Waits T1 Waits
T2 Waits
T2W1-T2W0 (T2 Waits). This binary field defines up to T2W1-T2W0 (T2 Waits). This binary field defines up to
three T2 wait states to be inserted in transactions access- three T2 wait states to be inserted in transactions access-
ing the mid-range memory area 2 in chip select scheme 1. ing the mid-range memory area 3 in chip select scheme 1.
T3W2-T3W0 (T3 Waits). This binary field defines up to T3W2-T3W0 (T3 Waits). This binary field defines up to
seven T3 wait states to be inserted in transactions access- seven T3 wait states to be inserted in transactions access-
ing the mid-range memory area 2 in chip select scheme 1. ing the mid-range memory area 3 in chip select scheme 1.
The contents of this register have no effects in chip select The contents of this register have no effects in chip select
scheme 2. scheme 2.
T1W2 T1W1 T1W0 T2W1 T2W0 T3W2 T3W1 T3W0 T1W2 T1W1 T1W0 T2W1 T2W0 T3W2 T3W1 T3W0
T3 Waits T3 Waits
T2 Waits T2 Waits
T1 Waits T1 Waits
Figure 44. Mid-Range Memory Waits Register 2 Figure 45. Mid-range Memory Waits Register 3
MSMER: 00000010H
R/W
7 0
ENLM (Enable Lower Memory Chip Select and Waits). This SR (Set Reset Control). When writing to the Memory
bit at logic 1 enables the /LMCS signal to go active starting Selects Master Enable Register with SR = 1, bits 7-4
at T1 cycle time of a memory transaction accessing the that are selected with logic 1s are set. When writing with
lower memory area. The associated programmed wait SR = 0, bits 7-4 that are selected with logic 1s are cleared.
states are automatically inserted in the transaction. In either case, the bits not selected are not modified. The
SR bit is always read as a logic 0.
ENUM (Enable Upper Memory Chip Select and Waits).
This bit at logic 1 enables the /UMCS signal to go active Additional Comments. In either chip select scheme, if the
starting at T1 cycle time of a memory transaction access- chip select and waits functions are enabled, or their
ing the upper memory area. The associated programmed memory areas are defined to cause overlaps, the prece-
wait states are automatically inserted in the transaction. dence of conflict resolution is /LMCS, then /UMCS, then
/MCS3-/MCS0. As an example, consider the case where
ENM1 (Enable Mid-range Memory Chip Select Scheme 1 both the lower and mid-range memory area 0 are defined
and Waits). This bit at logic 1 enables one of /MCS3- to occupy the same address space. With ENLM = 1 in
/MCS0 to go active starting at T1 cycle time of a memory the Memory Selects Master Enable Register (ENM1 can
transaction, depending on which of the mid-range memory be either 0 or 1), /LMCS goes active in the memory
areas 3-0 is being accessed. The corresponding pro- transaction that accesses the overlapped address space.
grammed wait states are automatically inserted in the With ENLM = 0 and ENM1 = 1, /MCS0 would go active in
transaction. the transaction instead. Regardless of the state of
the address bus, the chip select signals are at their inac-
ENM2 (Enable Mid-range Memory Chip Select Scheme 2 tive logic 1s when the corresponding enable bits in the
and Waits). This bit at logic 1 enables the /MCS0 to go Memory Selects Master Enable Register (MSMER) are at
active starting at T1 cycle time of a memory transaction logic 0s, except during DRAM refresh transactions if so
accessing the mid-range memory area. The correspond- enabled, or the Z380 MPUs CPU is in its halt state, except
ing programmed wait states are automatically inserted in during DRAM refresh transactions if so enabled, or the
the transaction. Z380 MPU relinquishes the system bus with its /BREQ
input active, or the Z380 MPU is in the low power standby
Reserved bits 3-1. Read as 0s, should write to as 0s. mode.
Refresh Register 0
RI7-RI0 (Request Interval). RI7-RI0 defines the interval Figure 48. Refresh Register 1
between refresh requests to the Z380 MPU's External
Interface Logic. A value n specified in this field denotes the
request interval to be (4 x n) BUSCLK periods. If RI7-RI0
are programmed as 0s, the request interval is 1024 BUSCLK
periods.
RFSHR0: 00000013H
R/W
7 0
Request Interval
Reserved bit 6. Read as 0, should write to as 0. T1W1-T2W0 (T2 Waits). This binary field defines up to
three T2 wait states to be inserted in refresh transactions.
BS5-BS0 (Burst Size). This field defines the number of
refresh transactions per refresh request made to the Z380 T3W2-T3W0 (T3 Waits). This binary field defines up to
MPU's External Interface Logic. The burst size ranges from seven T3 wait states to be inserted in refresh transactions.
1 to 64, with the highest size specified with BS5-BS0 equal Note that care should be exercised in defining refresh
to 0s. burst size and request intervals to avoid over-burdening
the system bus with refresh transactions. The memory chip
select signals can be selectively enabled to go active
RFSHR2: 00000015H
R/W during refresh transactions, such enabling is described in
7 0 the Memory Chip Selects and Waits section.
T3 Waits
Figure 49. Refresh Register 2
T2 Waits
T1 Waits
The Z380 MPU provides an optional standby mode to to further reduce power dissipation for the overall system.
minimize power consumption during system idle time. If The standby mode can be exited by asserting any of the
this option is enabled, executing the Sleep instruction /RESET, /NMI, /INT3-/INT0 (if enabled), or optionally,
would stop clocking internal to the Z380 MPU, as well as at /BREQ inputs.
the BUSCLK and IOCLK outputs. The /STNBY signal goes
to active logic 0, indicating the Z380 MPU is entering the If the standby mode option is not enabled, the Sleep
standby mode. All Z380 MPU operations are suspended, instruction is interpreted and executed no different than
the bus control signals are driven inactive and the address the HALT instruction, stopping the Z30 MPU from further
bus is driven to logic 1s. Note that if an external crystal instruction execution. In this case, /HALT goes to active
oscillator is used to drive the Z380 MPU’s CLKI input, logic 0 to indicate the Z380 MPU's halt status.
/STNBY can be used to stop its operation. This is a means
SMCR: 00000016H
R/W
7 0
0 0 0 0 0 0 0 0 Reset Value
BUSCLK
IOCLK
/STNBY
/BREQ
/BACK
ADDRESS FFFFFFFFH
DATA
BUS
CNTLS
BUSCLK
IOCLK
/STNBY
ADDRESS FFFFFFFFH
DATA
OPCODE
FETCH
BUSCLK
IOCLK
/STNBY
/RESET
DATA
Appropriate
Acknowledge
BUSCLK
IOCLK
/STNBY
/NMI
/INT3,2,1,0
ADDRESS FFFFFFFFH
The Z380 MPU is placed in a dormant state when the Note that if a user system has devices external to the Z380
/RESET input is asserted. All its operations are terminated, MPU that are clocked by IOCLK, these devices may
including any interrupt, bus request or bus transaction that require a /RESET pulse width that spans over a number of
may be in progress. Its IOCLK goes Low on the next IOCLK cycles (now at BUSCLK/8) for proper initialization.
BUSCLK rising edge, and enters into the BUSCLK divided-
down-by-eight mode. The address and data buses are tri- The Z380 MPU proceeds to fetch its first instruction 3.5
stated, and the bus control signals are driven to their BUSCLK cycles after /RESET is deasserted, provided
inactive states. The effect of a reset on the Z380 CPU and such deassertion meets the proper setup and hold times
related I/O registers is depicted in Table 6, and the effect with reference to the falling edge of BUSCLK, as depicted
on the on-chip peripheral functions is summarized in in Figure 20 in the External Interface Section. Figure 19 in
Table 8. the same section indicates a synchronization of IOCLK
when /RESET is deasserted. Again with the proper setup
The /RESET input may be asynchronous to BUSCLK, and hold times being met, IOCLK’s first rising edge is 11.5
though it is sampled internally at BUSCLK’s falling edges. BUSCLK cycles after the /RESET deassertion, preceded
For proper initialization of the Z380 MPU, VDD must be by a minimum of 4 BUSCLK cycles where IOCLK is at Low.
within operating specification and its BUSCLK must be
stable for more than five cycles with /RESET held Low. The Note that if /BREQ is active when /RESET is deasserted, the
/RESET input has a built-in Schmitt trigger buffer to facili- Z380 MPU would relinquish the bus instead of fetching its
tate power-on reset generation through an RC network. first instruction. IOCLK synchronization would still take
place as described before.
Memory Chip Selects and Waits Lower Memory Chip Select Signal enabled for lowest 1 MBytes
(00000000H-000FFFFFH), with 7 T1, 3 T2, and 7 T3 waits.
Upper Memory Chip Select Signal enabled for highest
16th MBytes (00F00000H - 00FFFFFFH),
with 7 T1, 3 T2, and 7 T3 waits.
Midrange Memory Chip Select Signal and waits disabled.
I/O Waits External I/O read, write -- 7 waits.
RETI -- 3 waits.
Interrupt daisy chain -- 7 waits.
DRAM Refresh Controller Disabled
DC CHARACTERISTICS
Z380™ Version
Notes:
1. 0.4 V < VIN < 2.4 V
2. 0.4 V < VOUT < 2.4 V
3. VDD = 5.0 V, VIH = 4.8 V, VIL = 0.2 V
4. VDD = 5.0 V, VIH = 4.8 V, VIL = 0.2 V
5. Unmeasured pins returned to VSS.
Z8038018
No. Symbol Parameter Min Max Note
Notes:
1. VIN = 0.4 V
2. 0.4 V < VOUT < 2.15 V
3. VDD = 3.3 V, VIH = 3.0 V, VIL = 0.2 V
4. VDD = 3.3 V, VIH = 3.0 V, VIL = 0.2 V
5. Unmeasured pins returned to VSS.
Z8L38010
No. Symbol Parameter Min Max Note
1
3 2
CLK
5 4
BUSCLK
6 7
OUTPUT
OUTPUT
INPUT
10 14 18 11 15 19
INPUT
12 16 20 13 17 21
/NMI
22
/RESET
23
Z380 MPU
Package
F = Plastic Quad Flat Pack
Temperature
S = 0°C to +70°C
Environmental
C = Plastic Standard Flow
Example:
Z 80380 18 F S C is a Z380, 18 MHz, Plastic Quad Flat Pack, 0°C to +70°C, Plastic Standard Flow
Environmental Flow
Temperature
Package
Speed
Product Number
Zilog Prefix
© 1997 by Zilog, Inc. All rights reserved. No part of this document Zilog’s products are not authorized for use as critical compo-
may be copied or reproduced in any form or by any means nents in life support devices or systems unless a specific written
without the prior written consent of Zilog, Inc. The information in agreement pertaining to such intended use is executed between
this document is subject to change without notice. Devices sold the customer and Zilog prior to use. Life support devices or
by Zilog, Inc. are covered by warranty and patent indemnification systems are those which are intended for surgical implantation
provisions appearing in Zilog, Inc. Terms and Conditions of Sale into the body, or which sustains life whose failure to perform,
only. when properly used in accordance with instructions for use
provided in the labeling, can be reasonably expected to result in
ZILOG, INC. MAKES NO WARRANTY, EXPRESS, STATUTORY, significant injury to the user.
IMPLIED OR BY DESCRIPTION, REGARDING THE INFORMA-
TION SET FORTH HEREIN OR REGARDING THE FREEDOM OF Zilog, Inc. 210 East Hacienda Ave.
THE DESCRIBED DEVICES FROM INTELLECTUAL PROPERTY Campbell, CA 95008-6600
INFRINGEMENT. ZILOG, INC. MAKES NO WARRANTY OF MER- Telephone (408) 370-8000
CHANTABILITY OR FITNESS FOR ANY PURPOSE. Telex 910-338-7621
FAX 408 370-8056
Zilog, Inc. shall not be responsible for any errors that may appear Internet: http://www.zilog.co
in this document. Zilog, Inc. makes no commitment to update or
keep current the information contained in this document.