Z80 instruction set summary

Version 2000c

Mnemonic Time Size CNPHZS OP-Code
ADC A,(HL) 7 1 +0V+++ 8E
ADC A,(IX+N) 19 3 +0V+++ DD 8E nn
ADC A,(IY+N) 19 3 +0V+++ FD 8E nn
ADC A,r 4 1 +0V+++ 88
ADC A,HX 2 +0V+++ DD 8C
ADC A,HY 2 +0V+++ FD 8C
ADC A,LX 2 +0V+++ DD 8D
ADC A,LY 2 +0V+++ FD 8D
ADC A,N 7 2 +0V+++ CE nn
ADC HL,BC 15 2 +0V ++ ED 4A
ADC HL,DE 15 2 +0V ++ ED 5A
ADC HL,HL 15 2 +0V ++ ED 6A
ADC HL,SP 15 2 +0V ++ ED 7A
ADD A,(HL) 7 1 +0V+++ 86
ADD A,(IX+N) 19 3 +0V+++ DD 86 nn
ADD A,(IY+N) 19 3 +0V+++ FD 86 nn
ADD A,r 4 1 +0V+++ 80
ADD A,HX 2 +0V+++ DD 84
ADD A,HY 2 +0V+++ FD 84
ADD A,LX 2 +0V+++ DD 85
ADD A,LY 2 +0V+++ FD 85
ADD A,N 7 2 +0V+++ C6 nn
ADD HL,BC 11 1 +0- -- 09
ADD HL,DE 11 1 +0- -- 19
ADD HL,HL 11 1 +0- -- 29
ADD HL,SP 11 1 +0- -- 39
ADD IX,BC 15 2 +0- -- DD 09
ADD IX,DE 15 2 +0- -- DD 19
ADD IX,IX 15 2 +0- -- DD 29
ADD IX,SP 15 2 +0- -- DD 39
ADD IY,BC 15 2 +0- -- FD 09
ADD IY,DE 15 2 +0- -- FD 19
ADD IY,IY 15 2 +0- -- FD 29
ADD IY,SP 15 2 +0- -- FD 39
AND (HL) 7 1 00P1++ A6
AND (IX+N) 19 3 00P1++ DD A6 nn
AND (IY+N) 19 3 00P1++ FD A6 nn
AND r 4 1 00P1++ A0
AND HX 2 00P1++ DD A4
AND HY 2 00P1++ FD A4
AND LX 2 00P1++ DD A5
AND LY 2 00P1++ FD A5
AND N 7 2 00P1++ E6 nn
BIT b,(HL) 12 2 -0 1+ CB 46*
BIT b,(IX+N) 20 4 -0 1+ DD CB nn 46*
BIT b,(IY+N) 20 4 -0 1+ FD CB nn 46*
BIT b,r 8 2 -0 1+ CB 40*
CALL C,NN 17 3 ------ DC nn nn
CALL M,NN 17 3 ------ FC nn nn
CALL NC,NN 17 3 ------ D4 nn nn
CALL NC,NN 17 3 ------ D4 nn nn
CALL NN 17 3 ------ CD nn nn
CALL NZ,NN 17 3 ------ C4 nn nn
CALL P,NN 17 3 ------ F4 nn nn
CALL PE,NN 17 3 ------ EC nn nn
CALL PO,NN 17 3 ------ E4 nn nn
CALL Z,NN 17 3 ------ CC nn nn
CCF 4 1 +0- -- 3F
CP (HL) 7 1 +1V+++ BE
CP (IX+N) 19 3 +1V+++ DD BE nn
CP (IY+N) 19 3 +1V+++ FD BE nn
CP r 4 1 +1V+++ B8
CP HX 2 +1V+++ DD BC
CP HY 2 +1V+++ FD BC
CP LX 2 +1V+++ DD BD
CP LY 2 +1V+++ FD BD
CP N 7 2 +1V+++ FE nn
CPD 16 2 -1++++ ED A9
CPDR 21 2 -1++++ ED B9
CPI 16 2 -1++++ ED A1
CPIR 21 2 -1++++ ED B1
CPL 4 1 -1-1-- 2F
DAA 4 1 +-P+++ 27
DEC (HL) 11 1 -1V+++ 35
DEC (IX+N) 23 3 -1V+++ DD 35 nn
DEC (IY+N) 23 3 -1V+++ FD 35 nn
DEC A 4 1 -1V+++ 3D
DEC B 4 1 -1V+++ 05
DEC BC 6 1 ------ 0B
DEC C 4 1 -1V+++ 0D
DEC D 4 1 -1V+++ 15
DEC DE 6 1 ------ 1B
DEC E 4 1 -1V+++ 1D
DEC H 4 1 -1V+++ 25
DEC HL 6 1 ------ 2B
DEC IX 10 2 ------ DD 2B
DEC IY 10 2 ------ FD 2B
DEC L 4 2 -1V+++ 2D
DEC SP 6 1 ------ 3B
DI 4 1 ------ F3
DJNZ $N+2 13 2 ------ 10 nn
EI 4 1 ------ FB
EX (SP),HL 19 1 ------ E3
EX (SP),IX 23 2 ------ DD E3
EX (SP),IY 23 2 ------ FD E3
EX AF,AF' 4 1 ------ 08
EX DE,HL 4 1 ------ EB
EXX 4 1 ------ D9
HALT 4+ 1 ------ 76
IM 0 8 2 ------ ED 46
IM 1 8 2 ------ ED 56
IM 2 8 2 ------ ED 5E
IN A,(C) 12 2 -0P+++ ED 78
IN A,(N) 11 2 ------ DB nn
IN B,(C) 12 2 -0P+++ ED 40
IN C,(C) 12 2 -0P+++ ED 48
IN D,(C) 12 2 -0P+++ ED 50
IN E,(C) 12 2 -0P+++ ED 58
IN H,(C) 12 2 -0P+++ ED 60
IN L,(C) 12 2 -0P+++ ED 68
IN (C) 12 2 -0P+++ ED 70
INC (HL) 11 1 - V + 34
INC (IX+N) 23 3 - V + DD 34 nn
INC (IY+N) 23 3 - V + FD 34 nn
INC A 4 1 -0V+++ 3C
INC B 4 1 -0V+++ 04
INC BC 6 1 ------ 03
INC C 4 1 -0V+++ 0C
INC D 4 1 -0V+++ 14
INC DE 6 1 ------ 13
INC E 4 1 -0V+++ 1C
INC H 4 1 -0V+++ 24
INC HL 6 1 ------ 23
INC HX 2 -0V+++ DD 24
INC HY 2 -0V+++ FD 24
INC IX 10 2 ------ DD 23
INC IY 10 2 ------ FD 23
INC L 4 1 -0V+++ 2C
INC LX 2 -0V+++ DD 2C
INC LY 2 -0V+++ FD 2C
INC SP 6 1 ------ 33
IND 16 2 -1 + ED AA
INDR 21 2 -1 1 ED BA
INI 16 2 -1 + ED A2
INIR 21 2 -1 1 ED B2
JP $NN 10 3 ------ C3 nn nn
JP (HL) 4 1 ------ E9
JP (IX) 8 2 ------ DD E9
JP (IY) 8 2 ------ FD E9
JP C,$NN 10 3 ------ DA nn nn
JP M,$NN 10 3 ------ FA nn nn
JP NC,$NN 10 3 ------ D2 nn nn
JP NZ,$NN 10 3 ------ C2 nn nn
JP P,$NN 10 3 ------ F2 nn nn
JP PE,$NN 10 3 ------ EA nn nn
JP PO,$NN 10 3 ------ E2 nn nn
JP Z,$NN 10 3 ------ CA nn nn
JR $N+2 12 2 ------ 18 nn
JR C,$N+2 12 2 ------ 38 nn
JR NC,$N+2 12 2 ------ 30 nn
JR NZ,$N+2 12 2 ------ 20 nn
JR Z,$N+2 12 2 ------ 28 nn
LD (BC),A 7 1 ------ 02
LD (DE),A 7 1 ------ 12
LD (HL),r 7 1 ------ 70
LD (HL),N 10 2 ------ 36 nn
LD (IX+N),r 19 3 ------ DD 70 nn
LD (IX+N),N 19 4 ------ DD 36 nn nn
LD (IY+N),r 19 3 ------ FD 70 nn
LD (IY+N),N 19 4 ------ FD 36 nn nn
LD (NN),A 13 3 ------ 32 nn nn
LD (NN),BC 20 4 ------ ED 43 nn nn
LD (NN),DE 20 4 ------ ED 53 nn nn
LD (NN),HL 16 3 ------ 22 nn nn
LD (NN),IX 20 4 ------ DD 22 nn nn
LD (NN),IY 20 4 ------ FD 22 nn nn
LD (NN),SP 20 4 ------ ED 73 nn nn
LD A,(BC) 7 1 ------ 0A
LD A,(DE) 7 1 ------ 1A
LD A,(HL) 7 1 ------ 7E
LD A,(IX+N) 19 3 ------ DD 7E nn
LD A,(IY+N) 19 3 ------ FD 7E nn
LD A,(NN) 13 3 ------ 3A nn nn
LD A,r 4 1 ------ 78
LD A,HX 2 ------ DD 7C
LD A,HY 2 ------ FD 7C
LD A,LX 2 ------ DD 7D
LD A,LY 2 ------ FD 7D
LD A,I 9 2 -0+0++ ED 57
LD A,N 7 2 ------ 3E nn
LD A,R 9 2 -0+0++ ED 5F
LD B,(HL) 7 1 ------ 46
LD B,(IX+N) 19 3 ------ DD 46 nn
LD B,(IY+N) 19 3 ------ FD 46 nn
LD B,HX 2 ------ DD 44
LD B,HY 2 ------ FD 44
LD B,LX 2 ------ DD 45
LD B,LY 2 ------ FD 45
LD B,r 4 1 ------ 40
LD B,N 7 2 ------ 06 nn
LD BC,(NN) 20 4 ------ ED 4B nn nn
LD BC,NN 10 3 ------ 01 nn nn
LD C,(HL) 7 1 ------ 4E
LD C,(IX+N) 19 3 ------ DD 4E nn
LD C,(IY+N) 19 3 ------ FD 4E nn
LD C,HX 2 ------ DD 4C
LD C,HY 2 ------ FD 4C
LD C,LX 2 ------ DD 4D
LD C,LY 2 ------ FD 4D
LD C,r 4 1 ------ 48
LD C,N 7 2 ------ 0E nn
LD D,(HL) 7 1 ------ 56
LD D,(IX+N) 19 3 ------ DD 56 nn
LD D,(IY+N) 19 3 ------ FD 56 nn
LD D,HX 2 ------ DD 54
LD D,HY 2 ------ FD 54
LD D,LX 2 ------ DD 55
LD D,LY 2 ------ FD 55
LD D,r 4 1 ------ 50
LD D,N 7 2 ------ 16 nn
LD DE,(NN) 20 4 ------ ED 5B nn nn
LD DE,NN 10 3 ------ 11 nn nn
LD E,(HL) 7 1 ------ 5E
LD E,(IX+N) 19 3 ------ DD 5E nn
LD E,(IY+N) 19 3 ------ FD 5E nn
LD E,HX 2 ------ DD 5C
LD E,HY 2 ------ FD 5C
LD E,LX 2 ------ DD 5D
LD E,LY 2 ------ FD 5D
LD E,r 4 1 ------ 58
LD E,N 7 2 ------ 1E nn
LD H,(HL) 7 1 ------ 66
LD H,(IX+N) 19 3 ------ DD 66 nn
LD H,(IY+N) 19 3 ------ FD 66 nn
LD H,r 4 1 ------ 60
LD H,N 7 2 ------ 26 nn
LD HL,(NN) 20 3 ------ 2A nn nn
LD HL,NN 10 3 ------ 21 nn nn
LD HX,r* 2 ------ DD 60*
LD HX,N 3 ------ DD 26 nn
LD HY,r* 2 ------ FD 60*
LD HY,N 3 ------ FD 26 nn
LD I,A 9 2 ------ ED 47
LD IX,(NN) 20 4 ------ DD 2A nn nn
LD IX,NN 14 4 ------ DD 21 nn nn
LD IY,(NN) 20 4 ------ FD 2A nn nn
LD IY,NN 14 4 ------ FD 21 nn nn
LD L,(HL) 7 1 ------ 6E
LD L,(IX+N) 19 3 ------ DD 6E nn
LD L,(IY+N) 19 3 ------ FD 6E nn
LD L,r 4 1 ------ 68
LD L,N 7 2 ------ 2E nn
LD LX,r* 2 ------ DD 68*
LD LX,N 3 ------ FD 2E nn
LD LY,r* 2 ------ DD 68*
LD LY,N 3 ------ FD 2E nn
LD R,A 9 2 ------ ED 4F
LD SP,(NN) 20 4 ------ ED 7B nn nn
LD SP,HL 6 1 ------ F9
LD SP,IX 10 2 ------ DD F9
LD SP,IY 10 2 ------ FD F9
LD SP,NN 10 3 ------ 31 nn nn
LDD 16 2 -0+0-- ED A8
LDDR 21 2 -000-- ED B8
LDI 16 2 -0+0-- ED A0
LDIR 21 2 -000-- ED B0
NEG 8 2 +1V+++ ED 44
NOP 4 1 ------ 00
OR (HL) 7 1 00P0++ B6
OR (IX+N) 19 3 00P0++ DD B6 nn
OR (IY+N) 19 3 00P0++ FD B6 nn
OR r 4 1 00P0++ B0
OR HX 2 00P0++ DD B4
OR HY 2 00P0++ FD B4
OR LX 2 00P0++ DD B5
OR LY 2 00P0++ FD B5
OR N 7 2 00P0++ F6 nn
OTDR 21 2 -1 1 ED BB
OTIR 21 2 -1 1 ED B3
OUT (C),A 12 2 ------ ED 79
OUT (C),B 12 2 ------ ED 41
OUT (C),C 12 2 ------ ED 49
OUT (C),D 12 2 ------ ED 51
OUT (C),E 12 2 ------ ED 59
OUT (C),H 12 2 ------ ED 61
OUT (C),L 12 2 ------ ED 69
OUT (C),0 12 2 ------ ED 71
OUT (N),A 11 2 ------ D3 nn
OUTD 16 2 -1 + ED AB
OUTI 16 2 -1 + ED A3
POP AF 10 1 ------ F1
POP BC 10 1 ------ C1
POP DE 10 1 ------ D1
POP HL 10 1 ------ E1
POP IX 14 2 ------ DD E1
POP IY 14 2 ------ FD E1
PUSH AF 11 1 ------ F5
PUSH BC 11 1 ------ C5
PUSH DE 11 1 ------ D5
PUSH HL 11 1 ------ E5
PUSH IX 15 2 ------ DD E5
PUSH IY 15 2 ------ FD E5
RES b,(HL) 15 2 ------ CB 86*
RES b,(IX+N) 23 4 ------ DD CB nn 86*
RES b,(IY+N) 23 4 ------ FD CB nn 86*
RES b,r 8 2 ------ CB 80*
RET 10 1 ------ C9
RET C 11 1 ------ D8
RET M 11 1 ------ F8
RET NC 11 1 ------ D0
RET NZ 11 1 ------ C0
RET P 11 1 ------ F0
RET PE 11 1 ------ E8
RET PO 11 1 ------ E0
RET Z 11 1 ------ C8
RETI 14 2 ------ ED 4D
RETN 14 2 ------ ED 45
RL (HL) 15 2 +0P0++ CB 16
RL r 8 2 +0P0++ CB 10
RL (IX+N) 23 4 +0P0++ DD CB nn 16
RL (IY+N) 23 4 +0P0++ FD CB nn 16
RLA 4 1 +0-0-- 17
RLC (HL) 15 2 +0P0++ CB 06
RLC (IX+N) 23 4 +0P0++ DD CB nn 06
RLC (IY+N) 23 4 +0P0++ FD CB nn 06
RLC r 8 2 +0P0++ CB 00
RLCA 4 1 +0-0-- 07
RLD 18 2 -0P0++ ED 6F
RR (HL) 15 2 +0P0++ CB 1E
RR r 8 2 +0P0++ CB 18
RR (IX+N) 23 4 +0P0++ DD CB nn 1E
RR (IY+N) 23 4 +0P0++ FD CB nn 1E
RRA 4 1 +0-0-- 1F
RRC (HL) 15 2 +0P0++ CB 0E
RRC (IX+N) 23 4 +0P0++ DD CB nn 0E
RRC (IY+N) 23 4 +0P0++ FD CB nn 0E
RRC r 8 2 +0P0++ CB 08
RRCA 4 1 +0-0-- 0F
RRD 18 2 -0P0++ ED 67
RST 0 11 1 ------ C7
RST 8H 11 1 ------ CF
RST 10H 11 1 ------ D7
RST 18H 11 1 ------ DF
RST 20H 11 1 ------ E7
RST 28H 11 1 ------ EF
RST 30H 11 1 ------ F7
RST 38H 11 1 ------ FF
SBC A,(HL) 7 1 +1V+++ 9E
SBC A,(IX+N) 19 3 +1V+++ DD 9E nn
SBC A,(IY+N) 19 3 +1V+++ FD 9E nn
SBC A,r 4 1 +1V+++ 98
SBC HX 2 +1V+++ DD 9C
SBC HY 2 +1V+++ FD 9C
SBC LX 2 +1V+++ DD 9D
SBC LY 2 +1V+++ FD 9D
SBC A,N 7 2 +1V+++ DE nn
SBC HL,BC 15 2 +1V ++ ED 42
SBC HL,DE 15 2 +1V ++ ED 52
SBC HL,HL 15 2 +1V ++ ED 62
SBC HL,SP 15 2 +1V ++ ED 72
SCF 4 1 10-0-- 37
SET b,(HL) 15 2 ------ CB C6*
SET b,(IX+N) 23 4 ------ DD CB nn C6*
SET b,(IY+N) 23 4 ------ FD CB nn C6*
SET b,r 8 2 ------ CB C0*
SLA (HL) 15 2 +0P0++ CB 26
SLA (IX+N) 23 4 +0P0++ DD CB nn 26
SLA (IY+N) 23 4 +0P0++ FD CB nn 26
SLA r 8 2 +0P0++ CB 20
SLL (HL) 15 2 +0P0++ CB 36
SLL (IX+N) 23 4 +0P0++ DD CB nn 36
SLL (IY+N) 23 4 +0P0++ FD CB nn 36
SLL r 8 2 +0P0++ CB 30
SRA (HL) 15 2 +0P0++ CB 2E
SRA (IX+N) 23 4 +0P0++ DD CB nn 2E
SRA (IY+N) 23 4 +0P0++ FD CB nn 2E
SRA r 8 2 +0P0++ CB 28
SRL (HL) 15 2 +0P0++ CB 3E
SRL (IX+N) 23 4 +0P0++ DD CB nn 3E
SRL (IY+N) 23 4 +0P0++ FD CB nn 3E
SRL r 8 2 +0P0++ CB 38
SUB (HL) 7 1 ++V+++ 96
SUB (IX+N) 19 3 ++V+++ DD 96 nn
SUB (IY+N) 19 3 ++V+++ FD 96 nn
SUB r 4 1 ++V+++ 90
SUB HX 2 ++V+++ DD 94
SUB HY 2 ++V+++ FD 94
SUB LX 2 ++V+++ DD 95
SUB LY 2 ++V+++ FD 95
SUB N 7 2 ++V+++ D6 nn
XOR (HL) 7 1 00P0++ AE
XOR (IX+N) 19 3 00P0++ DD AE nn
XOR (IY+N) 19 3 00P0++ FD AE nn
XOR r 4 1 00P0++ A8
XOR HX 2 00P0++ DD AC
XOR HY 2 00P0++ FD AC
XOR LX 2 00P0++ DD AD
XOR LY 2 00P0++ FD AD
XOR N 7 2 00P0++ EE nn
                        ││││││
Bit 0            CarrY ─┘│││││
Bit 1 (N) add/subtract ──┘││││
Bit 2  Parity/oVerflow ───┘│││
Bit 4       Half Carry ────┘││
Bit 6             Zero ─────┘│
Bit 7             Sign ──────┘

+:Affected   -:Unaffected   1:Set   0:Reset

r means register (A,B,C,D,E,H,L)
 (r* register H/L are HX/LX)
Add this to last byte of OP-code:
     r  nibble   r*  nibble
     A = 7        A = 7
     B = 0        B = 0
     C = 1        C = 1
     D = 2        D = 2
     E = 3        E = 3
     H = 4       HX = 4
     L = 5       LX = 5
( (HL) = 6 )

b means bit (can be 0-7 - well duh)
Increase the last byte of OP-code with 8*b

If there is two numbers given at Clock then the highest is when the jump is taken

Unsupported instructions: (use op.codes)

By Shiar. Used data from: