1 ! Copyright (C) 2006 Chris Double.
2 ! See https://factorcode.org/license.txt for BSD license.
4 USING: cpu.8080.emulator ;
7 INSTRUCTION: NOP ; opcode: 00 cycles: 04
8 INSTRUCTION: LD BC,nn ; opcode: 01 cycles: 10
9 INSTRUCTION: LD (BC),A ; opcode: 02 cycles: 07
10 INSTRUCTION: INC BC ; opcode: 03 cycles: 06
11 INSTRUCTION: INC B ; opcode: 04 cycles: 05
12 INSTRUCTION: DEC B ; opcode: 05 cycles: 05
13 INSTRUCTION: LD B,n ; opcode: 06 cycles: 07
14 INSTRUCTION: RLCA ; opcode: 07 cycles: 04
15 ! INSTRUCTION: NOP ; opcode: 08 cycles: 04
16 INSTRUCTION: ADD HL,BC ; opcode: 09 cycles: 11
17 INSTRUCTION: LD A,(BC) ; opcode: 0A cycles: 07
18 INSTRUCTION: DEC BC ; opcode: 0B cycles: 06
19 INSTRUCTION: INC C ; opcode: 0C cycles: 05
20 INSTRUCTION: DEC C ; opcode: 0D cycles: 05
21 INSTRUCTION: LD C,n ; opcode: 0E cycles: 07
22 INSTRUCTION: RRCA ; opcode: 0F cycles: 04
23 INSTRUCTION: LD DE,nn ; opcode: 11 cycles: 10
24 INSTRUCTION: LD (DE),A ; opcode: 12 cycles: 07
25 INSTRUCTION: INC DE ; opcode: 13 cycles: 06
26 INSTRUCTION: INC D ; opcode: 14 cycles: 05
27 INSTRUCTION: DEC D ; opcode: 15 cycles: 05
28 INSTRUCTION: LD D,n ; opcode: 16 cycles: 07
29 INSTRUCTION: RLA ; opcode: 17 cycles: 04
30 INSTRUCTION: ADD HL,DE ; opcode: 19 cycles: 11
31 INSTRUCTION: LD A,(DE) ; opcode: 1A cycles: 07
32 INSTRUCTION: DEC DE ; opcode: 1B cycles: 06
33 INSTRUCTION: INC E ; opcode: 1C cycles: 05
34 INSTRUCTION: DEC E ; opcode: 1D cycles: 05
35 INSTRUCTION: LD E,n ; opcode: 1E cycles: 07
36 INSTRUCTION: RRA ; opcode: 1F cycles: 04
37 INSTRUCTION: LD HL,nn ; opcode: 21 cycles: 10
38 INSTRUCTION: LD (nn),HL ; opcode: 22 cycles: 16
39 INSTRUCTION: INC HL ; opcode: 23 cycles: 06
40 INSTRUCTION: INC H ; opcode: 24 cycles: 05
41 INSTRUCTION: DEC H ; opcode: 25 cycles: 05
42 INSTRUCTION: LD H,n ; opcode: 26 cycles: 07
43 INSTRUCTION: DAA ; opcode: 27 cycles: 04
44 INSTRUCTION: ADD HL,HL ; opcode: 29 cycles: 11
45 INSTRUCTION: LD HL,(nn) ; opcode: 2A cycles: 16
46 INSTRUCTION: DEC HL ; opcode: 2B cycles: 06
47 INSTRUCTION: INC L ; opcode: 2C cycles: 05
48 INSTRUCTION: DEC L ; opcode: 2D cycles: 05
49 INSTRUCTION: LD L,n ; opcode: 2E cycles: 07
50 INSTRUCTION: CPL ; opcode: 2F cycles: 04
51 INSTRUCTION: LD SP,nn ; opcode: 31 cycles: 10
52 INSTRUCTION: LD (nn),A ; opcode: 32 cycles: 13
53 INSTRUCTION: INC SP ; opcode: 33 cycles: 06
54 INSTRUCTION: INC (HL) ; opcode: 34 cycles: 10
55 INSTRUCTION: DEC (HL) ; opcode: 35 cycles: 10
56 INSTRUCTION: LD (HL),n ; opcode: 36 cycles: 10
57 INSTRUCTION: SCF ; opcode: 37 cycles: 04
58 INSTRUCTION: ADD HL,SP ; opcode: 39 cycles: 11
59 INSTRUCTION: LD A,(nn) ; opcode: 3A cycles: 13
60 INSTRUCTION: DEC SP ; opcode: 3B cycles: 06
61 INSTRUCTION: INC A ; opcode: 3C cycles: 05
62 INSTRUCTION: DEC A ; opcode: 3D cycles: 05
63 INSTRUCTION: LD A,n ; opcode: 3E cycles: 07
64 INSTRUCTION: CCF ; opcode: 3F cycles: 04
65 INSTRUCTION: LD B,B ; opcode: 40 cycles: 05
66 INSTRUCTION: LD B,C ; opcode: 41 cycles: 05
67 INSTRUCTION: LD B,D ; opcode: 42 cycles: 05
68 INSTRUCTION: LD B,E ; opcode: 43 cycles: 05
69 INSTRUCTION: LD B,H ; opcode: 44 cycles: 05
70 INSTRUCTION: LD B,L ; opcode: 45 cycles: 05
71 INSTRUCTION: LD B,(HL) ; opcode: 46 cycles: 07
72 INSTRUCTION: LD B,A ; opcode: 47 cycles: 05
73 INSTRUCTION: LD C,B ; opcode: 48 cycles: 05
74 INSTRUCTION: LD C,C ; opcode: 49 cycles: 05
75 INSTRUCTION: LD C,D ; opcode: 4A cycles: 05
76 INSTRUCTION: LD C,E ; opcode: 4B cycles: 05
77 INSTRUCTION: LD C,H ; opcode: 4C cycles: 05
78 INSTRUCTION: LD C,L ; opcode: 4D cycles: 05
79 INSTRUCTION: LD C,(HL) ; opcode: 4E cycles: 07
80 INSTRUCTION: LD C,A ; opcode: 4F cycles: 05
81 INSTRUCTION: LD D,B ; opcode: 50 cycles: 05
82 INSTRUCTION: LD D,C ; opcode: 51 cycles: 05
83 INSTRUCTION: LD D,D ; opcode: 52 cycles: 05
84 INSTRUCTION: LD D,E ; opcode: 53 cycles: 05
85 INSTRUCTION: LD D,H ; opcode: 54 cycles: 05
86 INSTRUCTION: LD D,L ; opcode: 55 cycles: 05
87 INSTRUCTION: LD D,(HL) ; opcode: 56 cycles: 07
88 INSTRUCTION: LD D,A ; opcode: 57 cycles: 05
89 INSTRUCTION: LD E,B ; opcode: 58 cycles: 05
90 INSTRUCTION: LD E,C ; opcode: 59 cycles: 05
91 INSTRUCTION: LD E,D ; opcode: 5A cycles: 05
92 INSTRUCTION: LD E,E ; opcode: 5B cycles: 05
93 INSTRUCTION: LD E,H ; opcode: 5C cycles: 05
94 INSTRUCTION: LD E,L ; opcode: 5D cycles: 05
95 INSTRUCTION: LD E,(HL) ; opcode: 5E cycles: 07
96 INSTRUCTION: LD E,A ; opcode: 5F cycles: 05
97 INSTRUCTION: LD H,B ; opcode: 60 cycles: 05
98 INSTRUCTION: LD H,C ; opcode: 61 cycles: 05
99 INSTRUCTION: LD H,D ; opcode: 62 cycles: 05
100 INSTRUCTION: LD H,E ; opcode: 63 cycles: 05
101 INSTRUCTION: LD H,H ; opcode: 64 cycles: 05
102 INSTRUCTION: LD H,L ; opcode: 65 cycles: 05
103 INSTRUCTION: LD H,(HL) ; opcode: 66 cycles: 07
104 INSTRUCTION: LD H,A ; opcode: 67 cycles: 05
105 INSTRUCTION: LD L,B ; opcode: 68 cycles: 05
106 INSTRUCTION: LD L,C ; opcode: 69 cycles: 05
107 INSTRUCTION: LD L,D ; opcode: 6A cycles: 05
108 INSTRUCTION: LD L,E ; opcode: 6B cycles: 05
109 INSTRUCTION: LD L,H ; opcode: 6C cycles: 05
110 INSTRUCTION: LD L,L ; opcode: 6D cycles: 05
111 INSTRUCTION: LD L,(HL) ; opcode: 6E cycles: 07
112 INSTRUCTION: LD L,A ; opcode: 6F cycles: 05
113 INSTRUCTION: LD (HL),B ; opcode: 70 cycles: 07
114 INSTRUCTION: LD (HL),C ; opcode: 71 cycles: 07
115 INSTRUCTION: LD (HL),D ; opcode: 72 cycles: 07
116 INSTRUCTION: LD (HL),E ; opcode: 73 cycles: 07
117 INSTRUCTION: LD (HL),H ; opcode: 74 cycles: 07
118 INSTRUCTION: LD (HL),L ; opcode: 75 cycles: 07
119 INSTRUCTION: HALT ; opcode: 76 cycles: 07
120 INSTRUCTION: LD (HL),A ; opcode: 77 cycles: 07
121 INSTRUCTION: LD A,B ; opcode: 78 cycles: 05
122 INSTRUCTION: LD A,C ; opcode: 79 cycles: 05
123 INSTRUCTION: LD A,D ; opcode: 7A cycles: 05
124 INSTRUCTION: LD A,E ; opcode: 7B cycles: 05
125 INSTRUCTION: LD A,H ; opcode: 7C cycles: 05
126 INSTRUCTION: LD A,L ; opcode: 7D cycles: 05
127 INSTRUCTION: LD A,(HL) ; opcode: 7E cycles: 07
128 INSTRUCTION: LD A,A ; opcode: 7F cycles: 05
129 INSTRUCTION: ADD A,B ; opcode: 80 cycles: 04
130 INSTRUCTION: ADD A,C ; opcode: 81 cycles: 04
131 INSTRUCTION: ADD A,D ; opcode: 82 cycles: 04
132 INSTRUCTION: ADD A,E ; opcode: 83 cycles: 04
133 INSTRUCTION: ADD A,H ; opcode: 84 cycles: 04
134 INSTRUCTION: ADD A,L ; opcode: 85 cycles: 04
135 INSTRUCTION: ADD A,(HL) ; opcode: 86 cycles: 07
136 INSTRUCTION: ADD A,A ; opcode: 87 cycles: 04
137 INSTRUCTION: ADC A,B ; opcode: 88 cycles: 04
138 INSTRUCTION: ADC A,C ; opcode: 89 cycles: 04
139 INSTRUCTION: ADC A,D ; opcode: 8A cycles: 04
140 INSTRUCTION: ADC A,E ; opcode: 8B cycles: 04
141 INSTRUCTION: ADC A,H ; opcode: 8C cycles: 04
142 INSTRUCTION: ADC A,L ; opcode: 8D cycles: 04
143 INSTRUCTION: ADC A,(HL) ; opcode: 8E cycles: 07
144 INSTRUCTION: ADC A,A ; opcode: 8F cycles: 04
145 INSTRUCTION: SUB B ; opcode: 90 cycles: 04
146 INSTRUCTION: SUB C ; opcode: 91 cycles: 04
147 INSTRUCTION: SUB D ; opcode: 92 cycles: 04
148 INSTRUCTION: SUB E ; opcode: 93 cycles: 04
149 INSTRUCTION: SUB H ; opcode: 94 cycles: 04
150 INSTRUCTION: SUB L ; opcode: 95 cycles: 04
151 INSTRUCTION: SUB (HL) ; opcode: 96 cycles: 07
152 INSTRUCTION: SUB A ; opcode: 97 cycles: 04
153 INSTRUCTION: SBC A,B ; opcode: 98 cycles: 04
154 INSTRUCTION: SBC A,C ; opcode: 99 cycles: 04
155 INSTRUCTION: SBC A,D ; opcode: 9A cycles: 04
156 INSTRUCTION: SBC A,E ; opcode: 9B cycles: 04
157 INSTRUCTION: SBC A,H ; opcode: 9C cycles: 04
158 INSTRUCTION: SBC A,L ; opcode: 9D cycles: 04
159 INSTRUCTION: SBC A,(HL) ; opcode: 9E cycles: 07
160 INSTRUCTION: SBC A,A ; opcode: 9F cycles: 04
161 INSTRUCTION: AND B ; opcode: A0 cycles: 04
162 INSTRUCTION: AND C ; opcode: A1 cycles: 04
163 INSTRUCTION: AND D ; opcode: A2 cycles: 04
164 INSTRUCTION: AND E ; opcode: A3 cycles: 04
165 INSTRUCTION: AND H ; opcode: A4 cycles: 04
166 INSTRUCTION: AND L ; opcode: A5 cycles: 04
167 INSTRUCTION: AND (HL) ; opcode: A6 cycles: 07
168 INSTRUCTION: AND A ; opcode: A7 cycles: 04
169 INSTRUCTION: XOR B ; opcode: A8 cycles: 04
170 INSTRUCTION: XOR C ; opcode: A9 cycles: 04
171 INSTRUCTION: XOR D ; opcode: AA cycles: 04
172 INSTRUCTION: XOR E ; opcode: AB cycles: 04
173 INSTRUCTION: XOR H ; opcode: AC cycles: 04
174 INSTRUCTION: XOR L ; opcode: AD cycles: 04
175 INSTRUCTION: XOR (HL) ; opcode: AE cycles: 07
176 INSTRUCTION: XOR A ; opcode: AF cycles: 04
177 INSTRUCTION: OR B ; opcode: B0 cycles: 04
178 INSTRUCTION: OR C ; opcode: B1 cycles: 04
179 INSTRUCTION: OR D ; opcode: B2 cycles: 04
180 INSTRUCTION: OR E ; opcode: B3 cycles: 04
181 INSTRUCTION: OR H ; opcode: B4 cycles: 04
182 INSTRUCTION: OR L ; opcode: B5 cycles: 04
183 INSTRUCTION: OR (HL) ; opcode: B6 cycles: 07
184 INSTRUCTION: OR A ; opcode: B7 cycles: 04
185 INSTRUCTION: CP B ; opcode: B8 cycles: 04
186 INSTRUCTION: CP C ; opcode: B9 cycles: 04
187 INSTRUCTION: CP D ; opcode: BA cycles: 04
188 INSTRUCTION: CP E ; opcode: BB cycles: 04
189 INSTRUCTION: CP H ; opcode: BC cycles: 04
190 INSTRUCTION: CP L ; opcode: BD cycles: 04
191 INSTRUCTION: CP (HL) ; opcode: BE cycles: 07
192 INSTRUCTION: CP A ; opcode: BF cycles: 04
193 INSTRUCTION: RET NZ ; opcode: C0 cycles: 05
194 INSTRUCTION: POP BC ; opcode: C1 cycles: 10
195 INSTRUCTION: JP NZ,nn ; opcode: C2 cycles: 10
196 INSTRUCTION: JP nn ; opcode: C3 cycles: 10
197 INSTRUCTION: CALL NZ,nn ; opcode: C4 cycles: 11
198 INSTRUCTION: PUSH BC ; opcode: C5 cycles: 11
199 INSTRUCTION: ADD A,n ; opcode: C6 cycles: 07
200 INSTRUCTION: RST 0 ; opcode: C7 cycles: 11
201 INSTRUCTION: RET Z ; opcode: C8 cycles: 05
202 INSTRUCTION: RET nn ; opcode: C9 cycles: 10
203 INSTRUCTION: JP Z,nn ; opcode: CA cycles: 10
204 INSTRUCTION: CALL Z,nn ; opcode: CC cycles: 11
205 INSTRUCTION: CALL nn ; opcode: CD cycles: 17
206 INSTRUCTION: ADC A,n ; opcode: CE cycles: 07
207 INSTRUCTION: RST 8 ; opcode: CF cycles: 11
208 INSTRUCTION: RET NC ; opcode: D0 cycles: 05
209 INSTRUCTION: POP DE ; opcode: D1 cycles: 10
210 INSTRUCTION: JP NC,nn ; opcode: D2 cycles: 10
211 INSTRUCTION: OUT (n),A ; opcode: D3 cycles: 10
212 INSTRUCTION: CALL NC,nn ; opcode: D4 cycles: 11
213 INSTRUCTION: PUSH DE ; opcode: D5 cycles: 11
214 INSTRUCTION: SUB n ; opcode: D6 cycles: 07
215 INSTRUCTION: RST 10H ; opcode: D7 cycles: 11
216 INSTRUCTION: RET C ; opcode: D8 cycles: 05
217 INSTRUCTION: JP C,nn ; opcode: DA cycles: 10
218 INSTRUCTION: IN A,(n) ; opcode: DB cycles: 10
219 INSTRUCTION: CALL C,nn ; opcode: DC cycles: 11
220 INSTRUCTION: SBC A,n ; opcode: DE cycles: 07
221 INSTRUCTION: RST 18H ; opcode: DF cycles: 11
222 INSTRUCTION: RET PO ; opcode: E0 cycles: 05
223 INSTRUCTION: POP HL ; opcode: E1 cycles: 10
224 INSTRUCTION: JP PO,nn ; opcode: E2 cycles: 10
225 INSTRUCTION: EX (SP),HL ; opcode: E3 cycles: 04
226 INSTRUCTION: CALL PO,nn ; opcode: E4 cycles: 11
227 INSTRUCTION: PUSH HL ; opcode: E5 cycles: 11
228 INSTRUCTION: AND n ; opcode: E6 cycles: 07
229 INSTRUCTION: RST 20H ; opcode: E7 cycles: 11
230 INSTRUCTION: RET PE ; opcode: E8 cycles: 05
231 INSTRUCTION: JP (HL) ; opcode: E9 cycles: 04
232 INSTRUCTION: JP PE,nn ; opcode: EA cycles: 10
233 INSTRUCTION: EX DE,HL ; opcode: EB cycles: 04
234 INSTRUCTION: CALL PE,nn ; opcode: EC cycles: 11
235 INSTRUCTION: XOR n ; opcode: EE cycles: 07
236 INSTRUCTION: RST 28H ; opcode: EF cycles: 11
237 INSTRUCTION: RET P ; opcode: F0 cycles: 05
238 INSTRUCTION: POP AF ; opcode: F1 cycles: 10
239 INSTRUCTION: JP P,nn ; opcode: F2 cycles: 10
240 INSTRUCTION: DI ; opcode: F3 cycles: 04
241 INSTRUCTION: CALL P,nn ; opcode: F4 cycles: 11
242 INSTRUCTION: PUSH AF ; opcode: F5 cycles: 11
243 INSTRUCTION: OR n ; opcode: F6 cycles: 07
244 INSTRUCTION: RST 30H ; opcode: F7 cycles: 11
245 INSTRUCTION: RET M ; opcode: F8 cycles: 05
246 INSTRUCTION: LD SP,HL ; opcode: F9 cycles: 06
247 INSTRUCTION: JP M,nn ; opcode: FA cycles: 10
248 INSTRUCTION: EI ; opcode: FB cycles: 04
249 INSTRUCTION: CALL M,nn ; opcode: FC cycles: 11
250 INSTRUCTION: CP n ; opcode: FE cycles: 07
251 INSTRUCTION: RST 38H ; opcode: FF cycles: 11