Z80 CPU
User’s Manual
Table of Contents UM008005-0205
vi
Adding RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
Memory Speed Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
Interfacing Dynamic Memories . . . . . . . . . . . . . . . . . . . . . . . . . .31
Software Implementation Examples . . . . . . . . . . . . . . . . . . . . . . . . . .33
Overview of Software Features . . . . . . . . . . . . . . . . . . . . . . . . . .33
Examples of Specific Z80 Instructions . . . . . . . . . . . . . . . . . . . . 34
Examples of Programming Tasks . . . . . . . . . . . . . . . . . . . . . . . . 37
Z80 CPU Instruction Description . . . . . . . . . . . . . . . . . . . 41
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
Instruction Op Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
Z80 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Z80 Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Z80 Status Indicator Flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Add/Subtract Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77
Z80 Instruction Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
8-Bit Load Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
16-Bit Load Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
Exchange, Block Transfer, and Search Group . . . . . . . . . . . . . .122
8-Bit Arithmetic Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140
General-Purpose Arithmetic and CPU Control Groups . . . . . . .166
16-Bit Arithmetic Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179
Rotate and Shift Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190
Bit Set, Reset, and Test Group . . . . . . . . . . . . . . . . . . . . . . . . . .224
Jump Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Call And Return Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255
Input and Output Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269