At the heart of the Spectrum (and many other computers, such as the Amstrad CPC, MSX, CP/M machines and the Gameboy) is the Zilog Z80A CPU, which runs at approximately 3.5MHz.
The instruction set is large and comprehensive, which can make it intimidating. However, once you start learning, you soon learn patterns and realise that it is made up of just a few types of command, most of which are either for arithmetic or loading values from processor registers or memory. Indeed, there are so many that there are several sets; in addition to the normal 256, you can access three further sets of 256 by adding one of three prefixes. Some of these are undocumented and can be unreliable or incompatible on different version of the CPU or on different machines.
If the instruction requires a prefix or arguments, it may be longer than one byte, and it is possible for a single instruction to be up to five bytes in length.
Each instruction takes a certain number of CPU cycles to run, depending on the complexity and whether memory or I/O ports need to be accessed. In the case of our table, some of this timing information is currently unavailable, and so the value has been left blank.
Dec | Hex | Character | Opcode | Length | Cycles | After CB | Length | Cycles | After DDFDCB | Length | Cycles | After ED | Length | Cycles |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 00 | Not used | NOP | 1 | 4 | RLC B | 1 | 8 | LD B, RLC (HL) | 1 | 0 | |||
1 | 01 | Not used | LD BC, ^ | 3 | 10 | RLC C | 1 | 8 | LD C, RLC (HL) | 1 | 0 | |||
2 | 02 | Not used | LD BC, (A) | 1 | 7 | RLC D | 1 | 8 | LD D, RLC (HL) | 1 | 0 | |||
3 | 03 | Not used | INC BC | 1 | 6 | RLC E | 1 | 8 | LD E, RLC (HL) | 1 | 0 | |||
4 | 04 | Not used | INC B | 1 | 4 | RLC H | 1 | 8 | LD H, RLC (HL) | 1 | 0 | |||
5 | 05 | Not used | DEC B | 1 | 4 | RLC L | 1 | 8 | LD L, RLC (HL) | 1 | 0 | |||
6 | 06 | PRINT comma | LD B, $ | 2 | 7 | RLC (HL) | 1 | 15 | RLC (HL) | 1 | 15 | |||
7 | 07 | EDIT | RLCA | 1 | 4 | RLC A | 1 | 8 | LD A, RLC (HL) | 1 | 0 | |||
8 | 08 | EX AF, AF' | 1 | 4 | RRC B | 1 | 8 | LD B, RRC (HL) | 1 | 0 | ||||
9 | 09 | ADD HL, BC | 1 | 11 | RRC C | 1 | 8 | LD C, RRC (HL) | 1 | 0 | ||||
10 | 0A | LD A, (BC) | 1 | 7 | RRC D | 1 | 8 | LD D, RRC (HL) | 1 | 0 | ||||
11 | 0B | DEC BC | 1 | 6 | RRC E | 1 | 8 | LD E, RRC (HL) | 1 | 0 | ||||
12 | 0C | DELETE | INC C | 1 | 4 | RRC H | 1 | 8 | LD H, RRC (HL) | 1 | 0 | |||
13 | 0D | ENTER | DEC C | 1 | 4 | RRC L | 1 | 8 | LD L, RRC (HL) | 1 | 0 | |||
14 | 0E | number | LD C, $ | 2 | 7 | RRC (HL) | 1 | 15 | RRC (HL) | 1 | 15 | |||
15 | 0F | not used | RRCA | 1 | 4 | RRC A | 1 | 8 | LD A, RRC (HL) | 1 | 0 | |||
16 | 10 | INK control | DJNZ % | 2 | 13 / 8 | RL B | 1 | 8 | LD B, RL (HL) | 1 | 0 | |||
17 | 11 | PAPER control | LD DE, ^ | 3 | 10 | RL C | 1 | 8 | LD C, RL (HL) | 1 | 0 | |||
18 | 12 | FLASH control | LD (DE), A | 1 | 7 | RL D | 1 | 8 | LD D, RL (HL) | 1 | 0 | |||
19 | 13 | BRIGHT control | INC DE | 1 | 6 | RL E | 1 | 8 | LD E, RL (HL) | 1 | 0 | |||
20 | 14 | INVERSE control | INC D | 1 | 4 | RL H | 1 | 8 | LD H, RL (HL) | 1 | 0 | |||
21 | 15 | OVER control | DEC D | 1 | 4 | RL L | 1 | 8 | LD L, RL (HL) | 1 | 0 | |||
22 | 16 | AT control | LD D, $ | 2 | 7 | RL (HL) | 1 | 15 | RL (HL) | 1 | 15 | |||
23 | 17 | TAB control | RLA | 1 | 4 | RL A | 1 | 8 | LD A, RL (HL) | 1 | 0 | |||
24 | 18 | Not used | JR % | 2 | 12 | RR B | 1 | 8 | LD B, RR (HL) | 1 | 0 | |||
25 | 19 | Not used | ADD HL, DE | 1 | 11 | RR C | 1 | 8 | LD C, RR (HL) | 1 | 0 | |||
26 | 1A | Not used | LD A, (DE) | 1 | 7 | RR D | 1 | 8 | LD D, RR (HL) | 1 | 0 | |||
27 | 1B | Not used | DEC DE | 1 | 6 | RR E | 1 | 8 | LD E, RR (HL) | 1 | 0 | |||
28 | 1C | Not used | INC E | 1 | 4 | RR H | 1 | 8 | LD H, RR (HL) | 1 | 0 | |||
29 | 1D | Not used | DEC E | 1 | 4 | RR L | 1 | 8 | LD L, RR (HL) | 1 | 0 | |||
30 | 1E | Not used | LD E, $ | 2 | 7 | RR (HL) | 1 | 15 | RR (HL) | 1 | 15 | |||
31 | 1F | Not used | RRA | 1 | 4 | RR A | 1 | 8 | LD A, RR (HL) | 1 | 0 | |||
32 | 20 | space | JR NZ, % | 2 | 12 / 7 | SLA B | 1 | 8 | LD B, SLA (HL) | 1 | 0 | |||
33 | 21 | ! | LD HL, ^ | 3 | 10 | SLA C | 1 | 8 | LD C, SLA (HL) | 1 | 0 | |||
34 | 22 | " | LD (^), HL | 3 | 16 | SLA D | 1 | 8 | LD D, SLA (HL) | 1 | 0 | |||
35 | 23 | # | INC HL | 1 | 6 | SLA E | 1 | 8 | LD E, SLA (HL) | 1 | 0 | |||
36 | 24 | $ | INC H | 1 | 4 | SLA H | 1 | 8 | LD H, SLA (HL) | 1 | 0 | |||
37 | 25 | % | DEC H | 1 | 4 | SLA L | 1 | 8 | LD L, SLA (HL) | 1 | 0 | |||
38 | 26 | & | LD H, $ | 2 | 7 | SLA (HL) | 1 | 15 | SLA (HL) | 1 | 15 | |||
39 | 27 | , | DAA | 1 | 4 | SLA A | 1 | 8 | LD A, SLA (HL) | 1 | 0 | |||
40 | 28 | ( | JR Z, % | 2 | 12 / 7 | SRA B | 1 | 8 | LD B, SRA (HL) | 1 | 0 | |||
41 | 29 | ) | ADD HL, HL | 1 | 11 | SRA C | 1 | 8 | LD C, SRA (HL) | 1 | 0 | |||
42 | 2A | * | LD HL, (^) | 3 | 16 | SRA D | 1 | 8 | LD D, SRA (HL) | 1 | 0 | |||
43 | 2B | + | DEC HL | 1 | 6 | SRA E | 1 | 8 | LD E, SRA (HL) | 1 | 0 | |||
44 | 2C | , | INC L | 1 | 4 | SRA H | 1 | 8 | LD H, SRA (HL) | 1 | 0 | |||
45 | 2D | - | DEC L | 1 | 4 | SRA L | 1 | 8 | LD L, SRA (HL) | 1 | 0 | |||
46 | 2E | . | LD L, $ | 2 | 7 | SRA (HL) | 1 | 15 | SRA (HL) | 1 | 15 | |||
47 | 2F | / | CPL | 1 | 4 | SRA A | 1 | 8 | LD A, SRA (HL) | 1 | 0 | |||
48 | 30 | 0 | JR NC, % | 2 | 12 / 7 | SLL B | 1 | 8 | LD B, SLL (HL) | 1 | 0 | |||
49 | 31 | 1 | LD SP, ^ | 3 | 10 | SLL C | 1 | 8 | LD C, SLL (HL) | 1 | 0 | |||
50 | 32 | 2 | LD (^), A | 3 | 13 | SLL D | 1 | 8 | LD D, SLL (HL) | 1 | 0 | |||
51 | 33 | 3 | INC SP | 1 | 6 | SLL E | 1 | 8 | LD E, SLL (HL) | 1 | 0 | |||
52 | 34 | 4 | INC (HL) | 1 | 11 | SLL H | 1 | 8 | LD H, SLL (HL) | 1 | 0 | |||
53 | 35 | 5 | DEC (HL) | 1 | 11 | SLL L | 1 | 8 | LD L, SLL (HL) | 1 | 0 | |||
54 | 36 | 6 | LD (HL), $ | 2 | 10 | SLL (HL) | 1 | 15 | SLL (HL) | 1 | 15 | |||
55 | 37 | 7 | SCF | 1 | 4 | SLL A | 1 | 8 | LD A, SLL (HL) | 1 | 0 | |||
56 | 38 | 8 | JR C, % | 2 | 12 / 7 | SRL B | 1 | 8 | LD B, SRL (HL) | 1 | 0 | |||
57 | 39 | 9 | ADD HL, SP | 1 | 11 | SRL C | 1 | 8 | LD C, SRL (HL) | 1 | 0 | |||
58 | 3A | : | LD A, (^) | 3 | 13 | SRL D | 1 | 8 | LD D, SRL (HL) | 1 | 0 | |||
59 | 3B | ; | DEC SP | 1 | 6 | SRL E | 1 | 8 | LD E, SRL (HL) | 1 | 0 | |||
60 | 3C | < | INC A | 1 | 4 | SRL H | 1 | 8 | LD H, SRL (HL) | 1 | 0 | |||
61 | 3D | = | DEC A | 1 | 4 | SRL L | 1 | 8 | LD L, SRL (HL) | 1 | 0 | |||
62 | 3E | > | LD A, $ | 2 | 7 | SRL (HL) | 1 | 15 | SRL (HL) | 1 | 15 | |||
63 | 3F | ? | CCF | 1 | 4 | SRL A | 1 | 8 | LD A, SRL (HL) | 1 | 0 | |||
64 | 40 | @ | LD B, B | 1 | 4 | BIT 0, B | 1 | 8 | BIT 0, (HL) | 1 | 12 | IN B, (C) | 1 | 12 |
65 | 41 | A | LD B, C | 1 | 4 | BIT 0, C | 1 | 8 | BIT 0, (HL) | 1 | 12 | OUT (C), B | 1 | 12 |
66 | 42 | B | LD B, D | 1 | 4 | BIT 0, D | 1 | 8 | BIT 0, (HL) | 1 | 12 | SBC HL, BC | 1 | 15 |
67 | 43 | C | LD B, E | 1 | 4 | BIT 0, E | 1 | 8 | BIT 0, (HL) | 1 | 12 | LD (^), BC | 3 | 20 |
68 | 44 | D | LD B, H | 1 | 4 | BIT 0, H | 1 | 8 | BIT 0, (HL) | 1 | 12 | NEG | 1 | 8 |
69 | 45 | E | LD B, L | 1 | 4 | BIT 0, L | 1 | 8 | BIT 0, (HL) | 1 | 12 | RETN | 1 | 14 |
70 | 46 | F | LD B, (HL) | 1 | 7 | BIT 0, (HL) | 1 | 12 | BIT 0, (HL) | 1 | 12 | IM 0 | 1 | 8 |
71 | 47 | G | LD B, A | 1 | 4 | BIT 0, A | 1 | 8 | BIT 0, (HL) | 1 | 12 | LD I, A | 1 | 9 |
72 | 48 | H | LD C, B | 1 | 4 | BIT 1, B | 1 | 8 | BIT 1, (HL) | 1 | 12 | IN C, (C) | 1 | 12 |
73 | 49 | I | LD C, C | 1 | 4 | BIT 1, C | 1 | 8 | BIT 1, (HL) | 1 | 12 | OUT (C), C | 1 | 12 |
74 | 4A | J | LD C, D | 1 | 4 | BIT 1, D | 1 | 8 | BIT 1, (HL) | 1 | 12 | ADC HL, BC | 1 | 15 |
75 | 4B | K | LD C, E | 1 | 4 | BIT 1, E | 1 | 8 | BIT 1, (HL) | 1 | 12 | LD BC, (^) | 3 | 20 |
76 | 4C | L | LD C, H | 1 | 4 | BIT 1, H | 1 | 8 | BIT 1, (HL) | 1 | 12 | NEG | 1 | 8 |
77 | 4D | M | LD C, L | 1 | 4 | BIT 1, L | 1 | 8 | BIT 1, (HL) | 1 | 12 | RETN | 1 | 14 |
78 | 4E | N | LD C, (HL) | 1 | 7 | BIT 1, (HL) | 1 | 12 | BIT 1, (HL) | 1 | 12 | IM 0 | 1 | 8 |
79 | 4F | O | LD C, A | 1 | 4 | BIT 1, A | 1 | 8 | BIT 1, (HL) | 1 | 12 | LD R, A | 1 | 9 |
80 | 50 | P | LD D, B | 1 | 4 | BIT 2, B | 1 | 8 | BIT 2, (HL) | 1 | 12 | IN D, (C) | 1 | 12 |
81 | 51 | Q | LD D, C | 1 | 4 | BIT 2, C | 1 | 8 | BIT 2, (HL) | 1 | 12 | OUT (C), D | 1 | 12 |
82 | 52 | R | LD D, D | 1 | 4 | BIT 2, D | 1 | 8 | BIT 2, (HL) | 1 | 12 | SBC HL, DE | 1 | 15 |
83 | 53 | S | LD D, E | 1 | 4 | BIT 2, E | 1 | 8 | BIT 2, (HL) | 1 | 12 | LD (^), DE | 3 | 20 |
84 | 54 | T | LD D, H | 1 | 4 | BIT 2, H | 1 | 8 | BIT 2, (HL) | 1 | 12 | NEG | 1 | 8 |
85 | 55 | U | LD D, L | 1 | 4 | BIT 2, L | 1 | 8 | BIT 2, (HL) | 1 | 12 | RETN | 1 | 14 |
86 | 56 | V | LD D, (HL) | 1 | 7 | BIT 2, (HL) | 1 | 12 | BIT 2, (HL) | 1 | 12 | IM 1 | 1 | 8 |
87 | 57 | W | LD D, A | 1 | 4 | BIT 2, A | 1 | 8 | BIT 2, (HL) | 1 | 12 | LD A, I | 1 | 9 |
88 | 58 | X | LD E, B | 1 | 4 | BIT 3, B | 1 | 8 | BIT 3, (HL) | 1 | 12 | IN E, (C) | 1 | 12 |
89 | 59 | Y | LD E, C | 1 | 4 | BIT 3, C | 1 | 8 | BIT 3, (HL) | 1 | 12 | OUT (C), E | 1 | 12 |
90 | 5A | Z | LD E, D | 1 | 4 | BIT 3, D | 1 | 8 | BIT 3, (HL) | 1 | 12 | ADC HL, DE | 1 | 15 |
91 | 5B | [ | LD E, E | 1 | 4 | BIT 3, E | 1 | 8 | BIT 3, (HL) | 1 | 12 | LD DE, (^) | 3 | 20 |
92 | 5C | / | LD E, H | 1 | 4 | BIT 3, H | 1 | 8 | BIT 3, (HL) | 1 | 12 | NEG | 1 | 8 |
93 | 5D | ] | LD E, L | 1 | 4 | BIT 3, L | 1 | 8 | BIT 3, (HL) | 1 | 12 | RETN | 1 | 14 |
94 | 5E | ^ | LD E, (HL) | 1 | 7 | BIT 3, (HL) | 1 | 12 | BIT 3, (HL) | 1 | 12 | IM 2 | 1 | 8 |
95 | 5F | _ | LD E, A | 1 | 4 | BIT 3, A | 1 | 8 | BIT 3, (HL) | 1 | 12 | LD A, R | 1 | 9 |
96 | 60 | ukp | LD H, B | 1 | 4 | BIT 4, B | 1 | 8 | BIT 4, (HL) | 1 | 12 | IN H, (C) | 1 | 12 |
97 | 61 | a | LD H, C | 1 | 4 | BIT 4, C | 1 | 8 | BIT 4, (HL) | 1 | 12 | OUT (C), H | 1 | 12 |
98 | 62 | b | LD H, D | 1 | 4 | BIT 4, D | 1 | 8 | BIT 4, (HL) | 1 | 12 | SBC HL, HL | 1 | 15 |
99 | 63 | c | LD H, E | 1 | 4 | BIT 4, E | 1 | 8 | BIT 4, (HL) | 1 | 12 | LD (^), HL | 3 | 20 |
100 | 64 | d | LD H, H | 1 | 4 | BIT 4, H | 1 | 8 | BIT 4, (HL) | 1 | 12 | NEG | 1 | 8 |
101 | 65 | e | LD H, L | 1 | 4 | BIT 4, L | 1 | 8 | BIT 4, (HL) | 1 | 12 | RETN | 1 | 14 |
102 | 66 | f | LD H, (HL) | 1 | 7 | BIT 4, (HL) | 1 | 12 | BIT 4, (HL) | 1 | 12 | IM 0 | 1 | 8 |
103 | 67 | g | LD H, A | 1 | 4 | BIT 4, A | 1 | 8 | BIT 4, (HL) | 1 | 12 | RRD | 1 | 18 |
104 | 68 | h | LD L, B | 1 | 4 | BIT 5, B | 1 | 8 | BIT 5, (HL) | 1 | 12 | IN L, (C) | 1 | 12 |
105 | 69 | i | LD L, C | 1 | 4 | BIT 5, C | 1 | 8 | BIT 5, (HL) | 1 | 12 | OUT (C), L | 1 | 12 |
106 | 6A | j | LD L, D | 1 | 4 | BIT 5, D | 1 | 8 | BIT 5, (HL) | 1 | 12 | ADC HL, HL | 1 | 15 |
107 | 6B | k | LD L, E | 1 | 4 | BIT 5, E | 1 | 8 | BIT 5, (HL) | 1 | 12 | LD HL, (^) | 3 | 20 |
108 | 6C | l | LD L, H | 1 | 4 | BIT 5, H | 1 | 8 | BIT 5, (HL) | 1 | 12 | NEG | 1 | 8 |
109 | 6D | m | LD L, L | 1 | 4 | BIT 5, L | 1 | 8 | BIT 5, (HL) | 1 | 12 | RETN | 1 | 14 |
110 | 6E | n | LD L, (HL) | 1 | 7 | BIT 5, (HL) | 1 | 12 | BIT 5, (HL) | 1 | 12 | IM 0 | 1 | 8 |
111 | 6F | o | LD L, A | 1 | 4 | BIT 5, A | 1 | 8 | BIT 5, (HL) | 1 | 12 | RLD | 1 | 18 |
112 | 70 | p | LD (HL), B | 1 | 7 | BIT 6, B | 1 | 8 | BIT 6, (HL) | 1 | 12 | IN F, (C) | 1 | 12 |
113 | 71 | q | LD (HL), C | 1 | 7 | BIT 6, C | 1 | 8 | BIT 6, (HL) | 1 | 12 | OUT (C), 0 | 1 | 12 |
114 | 72 | r | LD (HL), D | 1 | 7 | BIT 6, D | 1 | 8 | BIT 6, (HL) | 1 | 12 | SBC HL, SP | 1 | 15 |
115 | 73 | s | LD (HL), E | 1 | 7 | BIT 6, E | 1 | 8 | BIT 6, (HL) | 1 | 12 | LD (^), SP | 3 | 20 |
116 | 74 | t | LD (HL), H | 1 | 7 | BIT 6, H | 1 | 8 | BIT 6, (HL) | 1 | 12 | NEG | 1 | 8 |
117 | 75 | u | LD (HL), L | 1 | 7 | BIT 6, L | 1 | 8 | BIT 6, (HL) | 1 | 12 | RETN | 1 | 14 |
118 | 76 | v | HALT | 1 | 4 | BIT 6, (HL) | 1 | 12 | BIT 6, (HL) | 1 | 12 | IM 1 | 1 | 8 |
119 | 77 | w | LD (HL), A | 1 | 7 | BIT 6, A | 1 | 8 | BIT 6, (HL) | 1 | 12 | |||
120 | 78 | x | LD A, B | 1 | 4 | BIT 7, B | 1 | 8 | BIT 7, (HL) | 1 | 12 | IN A, (C) | 1 | 12 |
121 | 79 | y | LD A, C | 1 | 4 | BIT 7, C | 1 | 8 | BIT 7, (HL) | 1 | 12 | OUT (C), A | 1 | 12 |
122 | 7A | z | LD A, D | 1 | 4 | BIT 7, D | 1 | 8 | BIT 7, (HL) | 1 | 12 | ADC HL, SP | 1 | 15 |
123 | 7B | { | LD A, E | 1 | 4 | BIT 7, E | 1 | 8 | BIT 7, (HL) | 1 | 12 | LD SP, (^) | 3 | 20 |
124 | 7C | | | LD A, H | 1 | 4 | BIT 7, H | 1 | 8 | BIT 7, (HL) | 1 | 12 | NEG | 1 | 8 |
125 | 7D | } | LD A, L | 1 | 4 | BIT 7, L | 1 | 8 | BIT 7, (HL) | 1 | 12 | RETN | 1 | 14 |
126 | 7E | - | LD A, (HL) | 1 | 7 | BIT 7, (HL) | 1 | 12 | BIT 7, (HL) | 1 | 12 | IM 2 | 1 | 8 |
127 | 7F | © | LD A, A | 1 | 4 | BIT 7, A | 1 | 8 | BIT 7, (HL) | 1 | 12 | |||
128 | 80 | ADD A, B | 1 | 4 | RES 0, B | 1 | 8 | LD B, RES 0, (HL) | 1 | 0 | ||||
129 | 81 | ADD A, C | 1 | 4 | RES 0, C | 1 | 8 | LD C, RES 0, (HL) | 1 | 0 | ||||
130 | 82 | ADD A, D | 1 | 4 | RES 0, D | 1 | 8 | LD D, RES 0, (HL) | 1 | 0 | ||||
131 | 83 | ADD A, E | 1 | 4 | RES 0, E | 1 | 8 | LD E, RES 0, (HL) | 1 | 0 | ||||
132 | 84 | ADD A, H | 1 | 4 | RES 0, H | 1 | 8 | LD H, RES 0, (HL) | 1 | 0 | ||||
133 | 85 | ADD A, L | 1 | 4 | RES 0, L | 1 | 8 | LD L, RES 0, (HL) | 1 | 0 | ||||
134 | 86 | ADD A, (HL) | 1 | 7 | RES 0, (HL) | 1 | 15 | RES 0, (HL) | 1 | 15 | ||||
135 | 87 | ADD A, A | 1 | 4 | RES 0, A | 1 | 8 | LD L, RES 0, (HL) | 1 | 0 | ||||
136 | 88 | ADC A, B | 1 | 4 | RES 1, B | 1 | 8 | LD B, RES 1, (HL) | 1 | 0 | ||||
137 | 89 | ADC A, C | 1 | 4 | RES 1, C | 1 | 8 | LD C, RES 1, (HL) | 1 | 0 | ||||
138 | 8A | ADC A, D | 1 | 4 | RES 1, D | 1 | 8 | LD D, RES 1, (HL) | 1 | 0 | ||||
139 | 8B | ADC A, E | 1 | 4 | RES 1, E | 1 | 8 | LD E, RES 1, (HL) | 1 | 0 | ||||
140 | 8C | ADC A, H | 1 | 4 | RES 1, H | 1 | 8 | LD H, RES 1, (HL) | 1 | 0 | ||||
141 | 8D | ADC A, L | 1 | 4 | RES 1, L | 1 | 8 | LD L, RES 1, (HL) | 1 | 0 | ||||
142 | 8E | ADC A, (HL) | 1 | 7 | RES 1, (HL) | 1 | 15 | RES 1, (HL) | 1 | 15 | ||||
143 | 8F | ADC A, A | 1 | 4 | RES 1, A | 1 | 8 | LD L, RES 1, (HL) | 1 | 0 | ||||
144 | 90 | (a) | SUB A, B | 1 | 4 | RES 2, B | 1 | 8 | LD B, RES 2, (HL) | 1 | 0 | |||
145 | 91 | (b) | SUB A, C | 1 | 4 | RES 2, C | 1 | 8 | LD C, RES 2, (HL) | 1 | 0 | |||
146 | 92 | (c) | SUB A, D | 1 | 4 | RES 2, D | 1 | 8 | LD D, RES 2, (HL) | 1 | 0 | |||
147 | 93 | (d) | SUB A, E | 1 | 4 | RES 2, E | 1 | 8 | LD E, RES 2, (HL) | 1 | 0 | |||
148 | 94 | (e) | SUB A, H | 1 | 4 | RES 2, H | 1 | 8 | LD H, RES 2, (HL) | 1 | 0 | |||
149 | 95 | (f) | SUB A, L | 1 | 4 | RES 2, L | 1 | 8 | LD L, RES 2, (HL) | 1 | 0 | |||
150 | 96 | (g) | SUB A, (HL) | 1 | 7 | RES 2, (HL) | 1 | 15 | RES 2, (HL) | 1 | 15 | |||
151 | 97 | (h) | SUB A, A | 1 | 4 | RES 2, A | 1 | 8 | LD L, RES 2, (HL) | 1 | 0 | |||
152 | 98 | (i) | SBC A, B | 1 | 4 | RES 3, B | 1 | 8 | LD B, RES 3, (HL) | 1 | 0 | |||
153 | 99 | (j) | SBC A, C | 1 | 4 | RES 3, C | 1 | 8 | LD C, RES 3, (HL) | 1 | 0 | |||
154 | 9A | (k) | SBC A, D | 1 | 4 | RES 3, D | 1 | 8 | LD D, RES 3, (HL) | 1 | 0 | |||
155 | 9B | (l) | SBC A, E | 1 | 4 | RES 3, E | 1 | 8 | LD E, RES 3, (HL) | 1 | 0 | |||
156 | 9C | (m) | SBC A, H | 1 | 4 | RES 3, H | 1 | 8 | LD H, RES 3, (HL) | 1 | 0 | |||
157 | 9D | (n) | SBC A, L | 1 | 4 | RES 3, L | 1 | 8 | LD L, RES 3, (HL) | 1 | 0 | |||
158 | 9E | (o) | SBC A, (HL) | 1 | 7 | RES 3, (HL) | 1 | 15 | RES 3, (HL) | 1 | 15 | |||
159 | 9F | (p) | SBC A, A | 1 | 4 | RES 3, A | 1 | 8 | LD L, RES 3, (HL) | 1 | 0 | |||
160 | A0 | (q) | AND A, B | 1 | 4 | RES 4, B | 1 | 8 | LD B, RES 4, (HL) | 1 | 0 | LDI | 1 | 16 |
161 | A1 | (r) | AND A, C | 1 | 4 | RES 4, C | 1 | 8 | LD C, RES 4, (HL) | 1 | 0 | CPI | 1 | 16 |
162 | A2 | (s) | AND A, D | 1 | 4 | RES 4, D | 1 | 8 | LD D, RES 4, (HL) | 1 | 0 | INI | 1 | 16 |
163 | A3 | (t) | AND A, E | 1 | 4 | RES 4, E | 1 | 8 | LD E, RES 4, (HL) | 1 | 0 | OUTI | 1 | 16 |
164 | A4 | (u) | AND A, H | 1 | 4 | RES 4, H | 1 | 8 | LD H, RES 4, (HL) | 1 | 0 | |||
165 | A5 | RND | AND A, L | 1 | 4 | RES 4, L | 1 | 8 | LD L, RES 4, (HL) | 1 | 0 | |||
166 | A6 | INKEY$ | AND A, (HL) | 1 | 7 | RES 4, (HL) | 1 | 15 | RES 4, (HL) | 1 | 15 | |||
167 | A7 | PI | AND A, A | 1 | 4 | RES 4, A | 1 | 8 | LD L, RES 4, (HL) | 1 | 0 | |||
168 | A8 | FN | XOR A, B | 1 | 4 | RES 5, B | 1 | 8 | LD B, RES 5, (HL) | 1 | 0 | LDD | 1 | 16 |
169 | A9 | POINT | XOR A, C | 1 | 4 | RES 5, C | 1 | 8 | LD C, RES 5, (HL) | 1 | 0 | CPD | 1 | 16 |
170 | AA | SCREEN$ | XOR A, D | 1 | 4 | RES 5, D | 1 | 8 | LD D, RES 5, (HL) | 1 | 0 | IND | 1 | 16 |
171 | AB | ATTR | XOR A, E | 1 | 4 | RES 5, E | 1 | 8 | LD E, RES 5, (HL) | 1 | 0 | OUTD | 1 | 16 |
172 | AC | AT | XOR A, H | 1 | 4 | RES 5, H | 1 | 8 | LD H, RES 5, (HL) | 1 | 0 | |||
173 | AD | TAB | XOR A, L | 1 | 4 | RES 5, L | 1 | 8 | LD L, RES 5, (HL) | 1 | 0 | |||
174 | AE | VAL$ | XOR A, (HL) | 1 | 7 | RES 5, (HL) | 1 | 15 | RES 5, (HL) | 1 | 15 | |||
175 | AF | CODE | XOR A, A | 1 | 4 | RES 5, A | 1 | 8 | LD L, RES 5, (HL) | 1 | 0 | |||
176 | B0 | VAL | OR A, B | 1 | 4 | RES 6, B | 1 | 8 | LD B, RES 6, (HL) | 1 | 0 | LDIR | 1 | 21 / 16 |
177 | B1 | LEN | OR A, C | 1 | 4 | RES 6, C | 1 | 8 | LD C, RES 6, (HL) | 1 | 0 | CPIR | 1 | 21 / 16 |
178 | B2 | SIN | OR A, D | 1 | 4 | RES 6, D | 1 | 8 | LD D, RES 6, (HL) | 1 | 0 | INIR | 1 | 21 / 16 |
179 | B3 | COS | OR A, E | 1 | 4 | RES 6, E | 1 | 8 | LD E, RES 6, (HL) | 1 | 0 | OTIR | 1 | 21 / 16 |
180 | B4 | TAN | OR A, H | 1 | 4 | RES 6, H | 1 | 8 | LD H, RES 6, (HL) | 1 | 0 | |||
181 | B5 | ASN | OR A, L | 1 | 4 | RES 6, L | 1 | 8 | LD L, RES 6, (HL) | 1 | 0 | |||
182 | B6 | ACS | OR A, (HL) | 1 | 7 | RES 6, (HL) | 1 | 15 | RES 6, (HL) | 1 | 15 | |||
183 | B7 | ATN | OR A, A | 1 | 4 | RES 6, A | 1 | 8 | LD L, RES 6, (HL) | 1 | 0 | |||
184 | B8 | LN | CP B | 1 | 4 | RES 7, B | 1 | 8 | LD B, RES 7, (HL) | 1 | 0 | LDDR | 1 | 21 / 16 |
185 | B9 | EXP | CP C | 1 | 4 | RES 7, C | 1 | 8 | LD C, RES 7, (HL) | 1 | 0 | CPDR | 1 | 21 / 16 |
186 | BA | INT | CP D | 1 | 4 | RES 7, D | 1 | 8 | LD D, RES 7, (HL) | 1 | 0 | INDR | 1 | 21 / 16 |
187 | BB | SOR | CP E | 1 | 4 | RES 7, E | 1 | 8 | LD E, RES 7, (HL) | 1 | 0 | OTDR | 1 | 21 / 16 |
188 | BC | SGN | CP H | 1 | 4 | RES 7, H | 1 | 8 | LD H, RES 7, (HL) | 1 | 0 | |||
189 | BD | ABS | CP L | 1 | 4 | RES 7, L | 1 | 8 | LD L, RES 7, (HL) | 1 | 0 | |||
190 | BE | PEEK | CP (HL) | 1 | 7 | RES 7, (HL) | 1 | 15 | RES 7, (HL) | 1 | 15 | |||
191 | BF | IN | CP A | 1 | 4 | RES 7, A | 1 | 8 | LD L, RES 7, (HL) | 1 | 0 | |||
192 | C0 | USR | RET NZ | 1 | 11 / 5 | SET 0, B | 1 | 8 | LD B, SET 0, (HL) | 1 | 0 | |||
193 | C1 | STR$ | POP BC | 1 | 10 | SET 0, C | 1 | 8 | LD C, RES 0, (HL) | 1 | 0 | |||
194 | C2 | CHR$ | JP NZ, ^ | 3 | 12 / 7 | SET 0, D | 1 | 8 | LD D, RES 0, (HL) | 1 | 0 | |||
195 | C3 | NOT | JP ^ | 3 | 10 | SET 0, E | 1 | 8 | LD E, RES 0, (HL) | 1 | 0 | |||
196 | C4 | BIN | CALL NZ, ^ | 3 | 17 / 10 | SET 0, H | 1 | 8 | LD H, RES 0, (HL) | 1 | 0 | |||
197 | C5 | OR | PUSH BC | 1 | 11 | SET 0, L | 1 | 8 | LD L, RES 0, (HL) | 1 | 0 | |||
198 | C6 | AND | ADD A, $ | 2 | 7 | SET 0, (HL) | 1 | 15 | RES 0, (HL) | 1 | 15 | |||
199 | C7 | <= | RST 00 | 1 | 11 | SET 0, A | 1 | 8 | LD L, RES 0, (HL) | 1 | 0 | |||
200 | C8 | >= | RET Z | 1 | 11 / 5 | SET 1, B | 1 | 8 | LD B, RES 1, (HL) | 1 | 0 | |||
201 | C9 | <> | RET | 1 | 10 | SET 1, C | 1 | 8 | LD C, RES 1, (HL) | 1 | 0 | |||
202 | CA | LINE | JP Z, ^ | 3 | 12 / 7 | SET 1, D | 1 | 8 | LD D, RES 1, (HL) | 1 | 0 | |||
203 | CB | THEN | 0 | SET 1, E | 1 | 8 | LD E, RES 1, (HL) | 1 | 0 | |||||
204 | CC | TO | CALL Z, ^ | 3 | 17 / 10 | SET 1, H | 1 | 8 | LD H, RES 1, (HL) | 1 | 0 | |||
205 | CD | STEP | CALL ^ | 3 | 17 | SET 1, L | 1 | 8 | LD L, RES 1, (HL) | 1 | 0 | |||
206 | CE | DEF FN | ADC A, $ | 2 | 7 | SET 1, (HL) | 1 | 15 | RES 1, (HL) | 1 | 15 | |||
207 | CF | CAT | RST 08 | 1 | 11 | SET 1, A | 1 | 8 | LD L, RES 1, (HL) | 1 | 0 | |||
208 | D0 | FORMAT | RET NC | 1 | 11 / 5 | SET 2, B | 1 | 8 | LD B, RES 2, (HL) | 1 | 0 | |||
209 | D1 | MOVE | POP DE | 1 | 10 | SET 2, C | 1 | 8 | LD C, RES 2, (HL) | 1 | 0 | |||
210 | D2 | ERASE | JP NC, ^ | 3 | 12 / 7 | SET 2, D | 1 | 8 | LD D, RES 2, (HL) | 1 | 0 | |||
211 | D3 | OPEN # | OUT ($), A | 2 | 11 | SET 2, E | 1 | 8 | LD E, RES 2, (HL) | 1 | 0 | |||
212 | D4 | CLOSE # | CALL NC, ^ | 3 | 17 / 10 | SET 2, H | 1 | 8 | LD H, RES 2, (HL) | 1 | 0 | |||
213 | D5 | MERGE | PUSH DE | 1 | 11 | SET 2, L | 1 | 8 | LD L, RES 2, (HL) | 1 | 0 | |||
214 | D6 | VERIFY | SUB $ | 2 | 7 | SET 2, (HL) | 1 | 15 | RES 2, (HL) | 1 | 15 | |||
215 | D7 | BEEP | RST 10 | 1 | 11 | SET 2, A | 1 | 8 | LD L, RES 2, (HL) | 1 | 0 | |||
216 | D8 | CIRCLE | RET C | 1 | 11 / 5 | SET 3, B | 1 | 8 | LD B, RES 3, (HL) | 1 | 0 | |||
217 | D9 | INK | EXX | 1 | 4 | SET 3, C | 1 | 8 | LD C, RES 3, (HL) | 1 | 0 | |||
218 | DA | PAPER | JP C, ^ | 3 | 12 / 7 | SET 3, D | 1 | 8 | LD D, RES 3, (HL) | 1 | 0 | |||
219 | DB | FLASH | IN A, ($) | 2 | 11 | SET 3, E | 1 | 8 | LD E, RES 3, (HL) | 1 | 0 | |||
220 | DC | BRIGHT | CALL C, ^ | 3 | 17 / 10 | SET 3, H | 1 | 8 | LD H, RES 3, (HL) | 1 | 0 | |||
221 | DD | INVERSE | 0 | SET 3, L | 1 | 8 | LD L, RES 3, (HL) | 1 | 0 | |||||
222 | DE | OVER | SBC A, $ | 2 | 7 | SET 3, (HL) | 1 | 15 | RES 3, (HL) | 1 | 15 | |||
223 | DF | OUT | RST 18 | 1 | 11 | SET 3, A | 1 | 8 | LD L, RES 3, (HL) | 1 | 0 | |||
224 | E0 | LPRINT | RET PO | 1 | 11 / 5 | SET 4, B | 1 | 8 | LD B, RES 4, (HL) | 1 | 0 | |||
225 | E1 | LLIST | POP HL | 1 | 10 | SET 4, C | 1 | 8 | LD C, RES 4, (HL) | 1 | 0 | |||
226 | E2 | STOP | JP PO, ^ | 3 | 12 / 7 | SET 4, D | 1 | 8 | LD D, RES 4, (HL) | 1 | 0 | |||
227 | E3 | READ | EX (SP), HL | 1 | 19 | SET 4, E | 1 | 8 | LD E, RES 4, (HL) | 1 | 0 | |||
228 | E4 | DATA | CALL PO, ^ | 3 | 17 / 10 | SET 4, H | 1 | 8 | LD H, RES 4, (HL) | 1 | 0 | |||
229 | E5 | RESTORE | PUSH HL | 1 | 11 | SET 4, L | 1 | 8 | LD L, RES 4, (HL) | 1 | 0 | |||
230 | E6 | NEW | AND $ | 2 | 7 | SET 4, (HL) | 1 | 15 | RES 4, (HL) | 1 | 15 | |||
231 | E7 | BORDER | RST 20 | 1 | 11 | SET 4, A | 1 | 8 | LD L, RES 4, (HL) | 1 | 0 | |||
232 | E8 | CONTINUE | RET PE | 1 | 11 / 5 | SET 5, B | 1 | 8 | LD B, RES 5, (HL) | 1 | 0 | |||
233 | E9 | DIM | JP HL | 1 | 4 | SET 5, C | 1 | 8 | LD C, RES 5, (HL) | 1 | 0 | |||
234 | EA | REM | JP PE, ^ | 3 | 12 / 7 | SET 5, D | 1 | 8 | LD D, RES 5, (HL) | 1 | 0 | |||
235 | EB | FOR | EX DE, HL | 1 | 4 | SET 5, E | 1 | 8 | LD E, RES 5, (HL) | 1 | 0 | |||
236 | EC | GO TO | CALL PE, ^ | 3 | 17 / 10 | SET 5, H | 1 | 8 | LD H, RES 5, (HL) | 1 | 0 | |||
237 | ED | GO SUB | 0 | SET 5, L | 1 | 8 | LD L, RES 5, (HL) | 1 | 0 | |||||
238 | EE | INPUT | XOR $ | 2 | 7 | SET 5, (HL) | 1 | 15 | RES 5, (HL) | 1 | 15 | |||
239 | EF | LOAD | RST 28 | 1 | 11 | SET 5, A | 1 | 8 | LD L, RES 5, (HL) | 1 | 0 | |||
240 | F0 | LIST | RET P | 1 | 11 / 5 | SET 6, B | 1 | 8 | LD B, RES 6, (HL) | 1 | 0 | |||
241 | F1 | LET | POP AF | 1 | 10 | SET 6, C | 1 | 8 | LD C, RES 6, (HL) | 1 | 0 | |||
242 | F2 | PAUSE | JP P, ^ | 3 | 12 / 7 | SET 6, D | 1 | 8 | LD D, RES 6, (HL) | 1 | 0 | |||
243 | F3 | NEXT | DI | 1 | 4 | SET 6, E | 1 | 8 | LD E, RES 6, (HL) | 1 | 0 | |||
244 | F4 | POKE | CALL P, ^ | 3 | 17 / 10 | SET 6, H | 1 | 8 | LD H, RES 6, (HL) | 1 | 0 | |||
245 | F5 | PUSH AF | 1 | 11 | SET 6, L | 1 | 8 | LD L, RES 6, (HL) | 1 | 0 | ||||
246 | F6 | PLOT | OR $ | 2 | 7 | SET 6, (HL) | 1 | 15 | RES 6, (HL) | 1 | 15 | |||
247 | F7 | RUN | RST 30 | 1 | 11 | SET 6, A | 1 | 8 | LD L, RES 6, (HL) | 1 | 0 | |||
248 | F8 | SAVE | RET M | 1 | 11 / 5 | SET 7, B | 1 | 8 | LD B, RES 7, (HL) | 1 | 0 | |||
249 | F9 | RANDOMIZE | LD SP, HL | 1 | 6 | SET 7, C | 1 | 8 | LD C, RES 7, (HL) | 1 | 0 | |||
250 | FA | IF | JP M, ^ | 3 | 12 / 7 | SET 7, D | 1 | 8 | LD D, RES 7, (HL) | 1 | 0 | |||
251 | FB | CLS | EI | 1 | 4 | SET 7, E | 1 | 8 | LD E, RES 7, (HL) | 1 | 0 | |||
252 | FC | DRAW | CALL M, ^ | 3 | 17 / 10 | SET 7, H | 1 | 8 | LD H, RES 7, (HL) | 1 | 0 | |||
253 | FD | CLEAR | FDOP | 0 | SET 7, L | 1 | 8 | LD L, RES 7, (HL) | 1 | 0 | ||||
254 | FE | RETURN | CP $ | 2 | 7 | SET 7, (HL) | 1 | 15 | RES 7, (HL) | 1 | 15 | |||
255 | FF | COPY | RST 38 | 1 | 11 | SET 7, A | 1 | 8 | LD L, RES 7, (HL) | 1 | 0 |
Key
^ 16-bit number (two bytes)
$ 8-bit number (one byte)
% 2s comp offset (1 byte)
You can also download a version in Microsoft Excel format – Z80 instruction set with mnemonics, length and timing.
Credit for the information needs to go to Time Proofing and MSX Assembly Page. All information regarding the Z80 family of CPUs is copyright of Zilog.