User manual ZILOG Z80-CPU
DON'T FORGET : ALWAYS READ THE USER GUIDE BEFORE BUYING !!!
If this document matches the user guide, instructions manual or user manual, feature sets, schematics you are looking for, download it now. Diplodocs provides you a fast and easy access to the user manual ZILOG Z80-CPU. We hope that this ZILOG Z80-CPU user guide will be useful to you.
Manual abstract: user guide ZILOG Z80-CPU
Detailed instructions for use are in the User's Guide.
[. . . ] Z80 Family CPU User Manual
User Manual
80
=L/2* :RUOGZLGH +HDGTXDUWHUV ( +DPLOWRQ $YHQXH &DPSEHOO &$ 7HOHSKRQH )D[ ZZZ=L/2*FRP
= &38 8VHUV 0DQXDO
This publication is subject to replacement by a later edition. To determine whether a later edition exists, or to request copies of publications, contact:
ZiLOG Worldwide Headquarters 910 E. Hamilton Avenue Campbell, CA 95008 Telephone: 408. 558. 8500 Fax: 408. 558. 8300 www. ZiLOG. com
Document Disclaimer
ZiLOG is a registered trademark of ZiLOG Inc. All other products and/or service names mentioned herein may be trademarks of the companies with which they are associated. [. . . ] These general-purpose registers are used for a wide range of applications. They also simplify programing, specifically in ROM-based systems where little external read/write memory is available.
$ULWKPHWLF /RJLF 8QLW $/8
The 8-bit arithmetic and logical instructions of the CPU are executed in the ALU. Internally, the ALU communicates with the registers and the external data bus by using the internal data bus. Functions performed by the ALU include:
80
2YHUYLHZ
< %27 7UGT U /CPWCN
Add Subtract Logical AND Logical OR Logical Exclusive OR Compare Left or Right Shifts or Rotates (Arithmetic and Logical) Increment Decrement Set Bit Reset Bit Test bit
, QVWUXFWLRQ 5HJLVWHU DQG &38 &RQWURO
As each instruction is fetched from memory, it is placed in the INSTRUCTION register and decoded. The control sections performs this function and then generates and supplies the control signals necessary to read or write data from or to the registers, control the ALU, and provide required external control signals.
3, 1 '(6&5, 37, 21 2YHUYLHZ
The Z80 CPU I/O pins are illustrated in Figure 3 and the function of each is described in the following paragraphs.
80
2YHUYLHZ
< %27 7UGT U /CPWCN
M1 MREQ IORQ RD WR RFSH HALT WAIT CPU Control INT NMI RESET CPU Bus Control BUSRQ BUSACK
27 19 20 21 22 28 18 24 16 17 26 25 23
System Control
Z80 CPU
30 31 32 33 34 35 36 37 38 39 40 1 2 3 4 5
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15
Address Bus
CLK +5V GND
6 11 29
14 15 12 8 7 9 10 13
D0 D1 D2 D3 D4 D5 D6 D7
Data Bus
)LJXUH
= , 2 3LQ &RQILJXUDWLRQ
3LQ )XQFWLRQV
$$
Address Bus (output, active High, tristate). The Address Bus provides the address for memory data bus exchanges (up to 64 Kbytes) and for I/O device exchanges.
80
2YHUYLHZ
< %27 7UGT U /CPWCN
%86$&.
Bus Acknowledge (output, active Low). Bus Acknowledge indicates to the requesting device that the CPU address bus, data bus, and control signals MREQ, IORQ RD, and WR have entered their high-impedance states. The external circuitry can now control these lines.
%865(4
Bus Request (input, active Low). Bus Request has a higher priority than NMI and is always recognized at the end of the current machine cycle. BUSREQ forces the CPU address bus, data bus, and control signals MREQ IORQ, RD, and WR to go to a high-impedance state so that other devices can control these lines. BUSREQ is normally wired-OR and requires an external pull-up for these applications. Extended BUSREQ periods due to extensive DMA operations can prevent the CPU from properly refreshing dynamic RAMS.
''
Data Bus (input/output, active High, tristate). D7D0 constitute an 8-bit bidirectional data bus, used for data exchanges with memory and I/O.
+$/7
HALT State (output, active Low). HALT indicates that the CPU has executed a HALT instruction and is waiting for either a non-maskable or a maskable interrupt (with the mask enabled) before operation can resume. During HALT, the CPU executes NOPs to maintain memory refresh.
, 17
Interrupt Request (input, active Low). The CPU honors a request at the end of the current instruction if the internal software-controlled interrupt enable flip-flop (IFF) is enabled. INT is normally wired-OR and requires an external pull-up for these applications.
80
2YHUYLHZ
< %27 7UGT U /CPWCN
, 254
Input/Output Request (output, active Low, tristate). IORQ indicates that the lower half of the address bus holds a valid I/O address for an I/O read or write operation. IORQ is also generated concurrently with M1 during an interrupt acknowledge cycle to indicate that an interrupt response vector can be placed on the data bus.
0
Machine Cycle One (output, active Low). M1, together with MREQ, indicates that the current machine cycle is the opcode fetch cycle of an instruction execution. M1 together with IORQ, indicates an interrupt acknowledge cycle.
05(4
Memory Request (output, active Low, tristate). MREQ indicates that the address bus holds a valid address for a memory read of memory write operation.
10,
Non-Maskable Interrupt (input, negative edge-triggered). [. . . ] q
A9 &" q
A9 &# q
A9 &$ q
A9 "% q
EXT, ADDR IMPLIED
(nn)
"!
I R
@9 #& @9 #A
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
$OO ORDG LQVWUXFWLRQV XVLQJ LQGH[HG DGGUHVVLQJ IRU HLWKHU WKH VRXUFH RU GHVWLQDWLRQ ORFDWLRQ DFWXDOO\ XVH WKUHH E\WHV RI PHPRU\ ZLWK WKH WKLUG E\WH EHLQJ WKH GLVSODFHPHQW G )RU H[DPSOH D ORDG UHJLVWHU ( ZLWK WKH RSHUDQG SRLQWHG WR E\ , ; ZLWK DQ RIIVHW RI LV ZULWWHQ
LID E, (IX + 8)
7KH LQVWUXFWLRQ VHTXHQFH IRU WKLV LQ PHPRU\ LV
Address A A+1 A+2 DD Op Code 5E 08 Displacement Operand
7KH WZR H[WHQGHG DGGUHVVLQJ LQVWUXFWLRQV DUH DOVR WKUHH E\WH LQVWUXFWLRQV )RU H[DPSOH WKH LQVWUXFWLRQ WR ORDG WKH DFFXPXODWRU ZLWK WKH RSHUDQG LQ PHPRU\ ORFDWLRQ )+ LV ZULWWHQ
LID A, (6F 32H)
DQG LWV LQVWUXFWLRQ VHTXHQFH LV
Address A A+1 A+2 3A 32 6F Op Code Low Order Address High Order Address
1RWLFH WKDW WKH ORZ RUGHU SRUWLRQ RI WKH DGGUHVV LV DOZD\V WKH ILUVW RSHUDQG 7KH ORDG LPPHGLDWH LQVWUXFWLRQV IRU WKH JHQHUDOSXUSRVH ELW UHJLVWHUV DUH WZRE\WH LQVWUXFWLRQV 7KH LQVWUXFWLRQ ORDG UHJLVWHU + ZLWK WKH YDOXH + LV ZULWWHQ
LD H, 36H
DQG LWV VHTXHQFH LV
Address A A+1 26 36 Op Code Operand
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
/RDGLQJ D PHPRU\ ORFDWLRQ XVLQJ LQGH[HG DGGUHVVLQJ IRU WKH GHVWLQDWLRQ DQG LPPHGLDWH DGGUHVVLQJ IRU WKH VRXUFH UHTXLUHV IRXU E\WHV )RU H[DPSOH
LD (IX - 15), 21H
DSSHDUV DV
Address A A+1 A+2 A+3 DD Op Code 36 F1 21 One or Two Bytes Displacement (-15 in Signed Two's Complement Operand to Load
1RWLFH WKDW ZLWK DQ\ LQGH[HG DGGUHVVLQJ WKH GLVSODFHPHQW DOZD\V IROORZV GLUHFWO\ DIWHU WKH 2S &RGH 7DEOH VSHFLILHV WKH ELW ORDG RSHUDWLRQV 7KH H[WHQGHG DGGUHVVLQJ IHDWXUH FRYHUV DOO UHJLVWHU SDLUV 5HJLVWHU LQGLUHFW RSHUDWLRQV VSHFLI\LQJ WKH VWDFN SRLQWHU DUH WKH PUSH DQG POP LQVWUXFWLRQV 7KH PQHPRQLF IRU WKHVH LQVWUXFWLRQV LV PUSH DQG POP 7KHVH GLIIHU IURP RWKHU ELW ORDGV LQ WKDW WKH VWDFN SRLQWHU LV DXWRPDWLFDOO\ GHFUHPHQWHG DQG LQFUHPHQWHG DV HDFK E\WH LV SXVKHG RQWR RU SRSSHG IURP WKH VWDFN UHVSHFWLYHO\ )RU H[DPSOH WKH LQVWUXFWLRQ PUSH AF LV D VLQJOH E\WH LQVWUXFWLRQ ZLWK WKH 2S &RGH RI F5H 'XULQJ H[HFXWLRQ WKLV VHTXHQFH LV JHQHUDWHG
Decrement SP LD (SP), A Decrement SP LD (SP), F
7KH H[WHUQDO VWDFN QRZ DSSHDUV DV
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
(SP) (SP+1)
F A
Top of stack
7KH POP LQVWUXFWLRQ LV WKH H[DFW UHYHUVH RI D PUSH $OO PUSH DQG POP LQVWUXFWLRQV XWLOL]H D ELW RSHUDQG DQG WKH KLJK RUGHU E\WH LV DOZD\V SXVKHG ILUVW DQG SRSSHG ODVW
PUSH BC PUSH DE PUSH HL POP HL is PUSH 8 then C is PUSH D then E is PUSH H then L is POP L then H
7KH LQVWUXFWLRQ XVLQJ H[WHQGHG LPPHGLDWH DGGUHVVLQJ IRU WKH VRXUFH UHTXLUHV WZR E\WHV RI GDWD IROORZLQJ WKH 2S &RGH )RU H[DPSOH
LD DE, 0659H
DSSHDUV DV
Address A A+1 E6 07 Op Code Operand
, Q DOO H[WHQGHG LPPHGLDWH RU H[WHQGHG DGGUHVVLQJ PRGHV WKH ORZ RUGHU E\WH DOZD\V DSSHDUV ILUVW DIWHU WKH 2S &RGH 7DEOH OLVWV WKH ELW H[FKDQJH LQVWUXFWLRQV LPSOHPHQWHG LQ WKH = 2S &RGH 08H DOORZV WKH SURJUDPPHU WR VZLWFK EHWZHHQ WKH WZR SDLUV RI DFFXPXODWRU IODJ UHJLVWHUV ZKLOH D9H DOORZV WKH SURJUDPPHU WR VZLWFK EHWZHHQ WKH GXSOLFDWH VHW RI VL[ JHQHUDOSXUSRVH UHJLVWHUV 7KHVH 2S &RGHV DUH RQO\ RQH E\WH LQ OHQJWK WR PLQLPL]H WKH WLPH QHFHVVDU\ WR SHUIRUP WKH H[FKDQJH VR WKDW WKH GXSOLFDWH EDQNV FDQ EH XVHG WR PDNH YHU\ IDVW LQWHUUXSW UHVSRQVH WLPHV
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7DEOH %LW /RDG *URXS /' 386+ DQG 323
Source
Srtvr D@ @6qq SrtDqv
Register AF BC
AF
BC
DE
HL
SP
IX
IY
nn
(nn)
(SP) P1
01 n n 11 n n 21 n n F9 DD F9 FD F9 31 n n DD 21 n n FD 21 n n ED 43 n n F6 C6 ED 53 n n D6 22 n n E6 ED 73 n n DD 22 n n DD E6 FD 22 n n FD E6
ED 4B n n ED 5B n n 2A n n ED 7B n n DD 2A n n FD 2A n n
C1
DE
D1
HL
E1
SP
IX
DD E1
IY
FD E1
EXT ADDR.
(nn)
REG. PUSH Instructions IND.
(SP)
NOTE: The Push & Pop instruction adjust the SP after every execution.
POP Instructions
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7DEOH ([FKDQJHV (; DQG (;; , PSOLHG $GGUHVVLQJ $)
IMPLIED AF BC DE HL DE REG. (SP) EB E3 DD E3 FD E3 D9 08
%&
'(
DQG +/
+/
, ;
, <
%ORFN 7UDQVIHU DQG 6HDUFK
7DEOH OLVWV WKH H[WUHPHO\ SRZHUIXO EORFN WUDQVIHU LQVWUXFWLRQV $OO WKHVH LQVWUXFWLRQV RSHUDWH ZLWK WKUHH UHJLVWHUV
HL points to the source location DE points to the destination location BC is a byte counter
$IWHU WKH SURJUDPPHU KDV LQLWLDOL]HG WKHVH WKUHH UHJLVWHUV DQ\ RI WKHVH IRXU LQVWUXFWLRQV PD\ EH XVHG 7KH LDI /RDG DQG , QFUHPHQW LQVWUXFWLRQ PRYHV RQH E\WH IURP WKH ORFDWLRQ SRLQWHG WR E\ +/ WR WKH ORFDWLRQ SRLQWHG WR E\ '( 5HJLVWHU SDLUV +/ DQG '( DUH WKHQ DXWRPDWLFDOO\ LQFUHPHQWHG DQG DUH UHDG\ WR SRLQW WR WKH IROORZLQJ ORFDWLRQV 7KH E\WH FRXQWHU UHJLVWHU SDLU %& LV DOVR GHFUHPHQWHG DW WKLV WLPH 7KLV LQVWUXFWLRQ LV YDOXDEOH ZKHQ EORFNV RI GDWD PXVW EH PRYHG EXW RWKHU W\SHV RI SURFHVVLQJ DUH UHTXLUHG EHWZHHQ HDFK PRYH 7KH LDIR /RDG , QFUHPHQW DQG 5HSHDW LQVWUXFWLRQ LV DQ H[WHQVLRQ RI WKH LDI LQVWUXFWLRQ 7KH VDPH ORDG DQG LQFUHPHQW RSHUDWLRQ LV UHSHDWHG XQWLO WKH E\WH FRXQWHU UHDFKHV WKH FRXQW RI ]HUR 7KXV WKLV VLQJOH LQVWUXFWLRQ FDQ PRYH DQ\ EORFN RI GDWD IURP RQH ORFDWLRQ WR DQ\ RWKHU
80 = &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
%HFDXVH ELW UHJLVWHUV DUH XVHG WKH VL]H RI WKH EORFN FDQ EH XS WR . E\WHV . [. . . ]
DISCLAIMER TO DOWNLOAD THE USER GUIDE ZILOG Z80-CPU
Click on "Download the user Manual" at the end of this Contract if you accept its terms, the downloading of the manual ZILOG Z80-CPU will begin.