]>
Commit | Line | Data |
---|---|---|
e7a0f403 | 1 | ; 8080/Z80 Interpreter. |
fa9059af L |
2 | ; This is part of the Z80-CP/M emulator written by Sprite_tm. |
3 | ; | |
4 | ||
5 | ; Copyright (C) 2010 Sprite_tm | |
6 | ; Copyright (C) 2010 Leo C. | |
7 | ; Copyright (C) 2010 Horst S. | |
8 | ||
9 | ; This file is part of avrcpm. | |
10 | ; | |
11 | ; avrcpm is free software: you can redistribute it and/or modify it | |
12 | ; under the terms of the GNU General Public License as published by | |
13 | ; the Free Software Foundation, either version 3 of the License, or | |
14 | ; (at your option) any later version. | |
15 | ; | |
16 | ; avrcpm is distributed in the hope that it will be useful, | |
17 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ; GNU General Public License for more details. | |
20 | ; | |
21 | ; You should have received a copy of the GNU General Public License | |
22 | ; along with avrcpm. If not, see <http://www.gnu.org/licenses/>. | |
23 | ; | |
24 | ; $Id$ | |
25 | ; | |
26 | ||
825ecc9d L |
27 | #if EM_Z80 |
28 | ||
fa9059af | 29 | .dseg |
e7a0f403 | 30 | z_regs: |
825ecc9d L |
31 | z_c2: |
32 | .equ oz_c2 = z_c2 - z_regs | |
33 | .byte 1 | |
34 | z_b2: | |
35 | .equ oz_b2 = z_b2 - z_regs | |
36 | .byte 1 | |
37 | z_e2: | |
38 | .equ oz_e2 = z_e2 - z_regs | |
39 | .byte 1 | |
40 | z_d2: | |
41 | .equ oz_d2 = z_d2 - z_regs | |
42 | .byte 1 | |
43 | z_l2: | |
44 | .equ oz_l2 = z_l2 - z_regs | |
45 | .byte 1 | |
46 | z_h2: | |
47 | .equ oz_h2 = z_h2 - z_regs | |
48 | .byte 1 | |
49 | z_f2: | |
50 | .equ oz_f2 = z_f2 - z_regs | |
51 | .byte 1 | |
52 | z_a2: | |
53 | .equ oz_a2 = z_a2 - z_regs | |
54 | .byte 1 | |
55 | ||
56 | z_xl: | |
57 | .equ oz_xl = z_xl - z_regs | |
58 | .byte 1 | |
59 | z_xh: | |
60 | .equ oz_xh = z_xh - z_regs | |
61 | .byte 1 | |
62 | z_yl: | |
63 | .equ oz_yl = z_yl - z_regs | |
64 | .byte 1 | |
65 | z_yh: | |
66 | .equ oz_yh = z_yh - z_regs | |
67 | .byte 1 | |
68 | z_i: | |
69 | .equ oz_i = z_i - z_regs | |
70 | .byte 1 | |
71 | z_r: | |
72 | .equ oz_r = z_r - z_regs | |
73 | .byte 1 | |
74 | ||
75 | z_istat: | |
76 | .equ oz_istat = z_istat - z_regs | |
77 | .byte 1 | |
4c92af0d L |
78 | |
79 | .equ IM_MASK = 0x03 ;Mask IM 0..2 | |
80 | .equ IM0 = 0 | |
81 | .equ IM1 = 1 | |
82 | .equ IM2 = 2 | |
80e1fa71 | 83 | |
4c92af0d L |
84 | .equ IFF1 = 2 ;IFF1 Flag |
85 | .equ IFF2 = 3 ;IFF2 Flag | |
fa9059af L |
86 | #endif |
87 | ||
88 | .cseg | |
89 | ||
90 | ;Init z80 | |
91 | z80_init: | |
e7a0f403 L |
92 | ldiw z_pc,IPLADDR |
93 | ldiw y,z_regs | |
fa9059af | 94 | |
fa9059af | 95 | clr intstat |
e7a0f403 | 96 | |
fa9059af | 97 | printnewline |
80e1fa71 | 98 | |
e7a0f403 L |
99 | .if INS_DEBUG |
100 | sbr intstat,(1<<i_trace) | |
101 | .endif | |
80e1fa71 L |
102 | |
103 | printstring "Ok, "CPUSTR"-CPU is live!" | |
fa9059af L |
104 | printnewline |
105 | ||
106 | main: | |
fa9059af L |
107 | |
108 | .if PRINT_PC | |
109 | cpi z_pch,DBG_TRACE_BOTTOM | |
110 | brlo noprintpc | |
111 | cpi z_pch,DBG_TRACE_TOP | |
112 | brsh noprintpc | |
113 | ||
114 | printnewline | |
115 | printstring "PC=" | |
116 | movw temp,z_pcl | |
80e1fa71 | 117 | lcall printhexw |
fa9059af L |
118 | printstring " " |
119 | noprintpc: | |
120 | .endif | |
121 | ||
fa9059af L |
122 | ;TODO: hier kommt die Interruptbehandlung rein |
123 | ||
825ecc9d | 124 | cpse intstat,_0 ;Fast path if no trace, int, break, ... |
fa9059af L |
125 | rjmp int_test |
126 | ||
80e1fa71 | 127 | int_instr: |
fa9059af L |
128 | mem_read_ds zl,z_pc ;zl = memReadByte(z_pc) |
129 | adiw z_pcl,1 ;++z_pc | |
130 | ldi zh,high(opcjmp) ; | |
131 | icall | |
132 | rjmp main ; | |
133 | ||
134 | int_test: | |
80e1fa71 L |
135 | sbrs intstat,i_trace |
136 | rjmp int_notrace | |
825ecc9d L |
137 | sbrs intstat,i_halt |
138 | rjmp int_notrace | |
80e1fa71 L |
139 | cpi z_pch,DBG_TRACE_BOTTOM |
140 | brlo int_notrace | |
141 | cpi z_pch,DBG_TRACE_TOP | |
142 | brsh int_notrace | |
143 | lcall printregs | |
144 | int_notrace: | |
fa9059af | 145 | sbrs intstat,i_break |
80e1fa71 L |
146 | rjmp int_nobreak |
147 | cbr intstat,(1<<i_break)|(1<<i_halt) | |
fa9059af L |
148 | printnewline |
149 | printstring "Break detected! " | |
150 | mov z_pcl,_0 | |
151 | mov z_pch,_0 | |
80e1fa71 L |
152 | int_nobreak: |
153 | ||
fb050095 | 154 | rjmp int_instr ;Continue with normal instruction interpretation |
fa9059af | 155 | |
fa9059af L |
156 | |
157 | ;-------------------------------------------------- | |
158 | ; init opcode table | |
159 | ; | |
623dd899 | 160 | ; opctable opc_name, pos |
fa9059af | 161 | ; |
e7a0f403 | 162 | |
fa9059af L |
163 | .macro opctable |
164 | ||
623dd899 L |
165 | |
166 | .set opcjmp_table_pos_ = (@1 + 255) & -0x100 ;0xff00 | |
167 | ||
fa9059af | 168 | .ifndef opc_tabnext_ |
623dd899 L |
169 | .set opc_tabnext_ = opcjmp_table_pos_ |
170 | ||
171 | .set opc_tablow_0 = 0 | |
172 | .set opc_tablen_0 = 0 | |
173 | .set opc_tablow_1 = 0 | |
174 | .set opc_tablen_1 = 0 | |
175 | .endif | |
176 | ||
177 | .if opcjmp_table_pos_ < opc_tabnext_ | |
178 | .set opcjmp_table_pos_ = opc_tabnext_ | |
fa9059af L |
179 | .endif |
180 | ||
623dd899 L |
181 | .if opc_tablow_0 == 0 |
182 | .set opc_tablow_0 = opcjmp_table_pos_ | |
183 | .set opc_tablen_0 = 256 | |
184 | ;.message "add tab_0" | |
185 | .elif opc_tablow_1 == 0 | |
186 | .if (opc_tablow_0 + opc_tablen_0) == opcjmp_table_pos_ | |
187 | .set opc_tablen_0 = opc_tablen_0 + 256 | |
188 | ;.message " tab_0++" | |
189 | .else | |
190 | .set opc_tablow_1 = opcjmp_table_pos_ | |
191 | .set opc_tablen_1 = 256 | |
192 | ;.message "add tab_1" | |
193 | .endif | |
194 | .else | |
195 | .if (opc_tablow_1 + opc_tablen_1) == opcjmp_table_pos_ | |
196 | .set opc_tablen_1 = opc_tablen_1 + 256 | |
197 | ;.message "tab_1++" | |
198 | .else | |
199 | .error "Tab full_" | |
200 | .endif | |
201 | .endif | |
fa9059af | 202 | |
623dd899 | 203 | .set opc_tabnext_ = opcjmp_table_pos_ + 256 |
fa9059af L |
204 | .equ @0 = opcjmp_table_pos_ |
205 | ||
623dd899 | 206 | .endm |
e7a0f403 | 207 | |
623dd899 L |
208 | ;-------------------------------------------------- |
209 | ; | |
210 | ; checkspace frompos, size | |
211 | ; | |
212 | .macro checkspace | |
213 | ||
214 | .ifdef opc_tablow_0 | |
215 | .if @0 <= opc_tablow_0 | |
216 | .if (@0 + @1) > opc_tablow_0 | |
217 | .org opc_tablow_0 + opc_tablen_0 | |
218 | ; .message "skip tab, remove tab_0" | |
219 | .if opc_tablow_1 == 0 | |
220 | .set opc_tablow_0 = 0 | |
221 | .set opc_tablen_0 = 0 | |
222 | .else | |
223 | .set opc_tablow_0 = opc_tablow_1 | |
224 | .set opc_tablen_0 = opc_tablen_1 | |
225 | .set opc_tablow_1 = 0 | |
226 | .set opc_tablen_1 = 0 | |
227 | ; .message "remove tab_1" | |
228 | .endif | |
229 | .endif | |
230 | .endif | |
231 | .endif | |
fa9059af L |
232 | .endm |
233 | ||
fa9059af L |
234 | ;-------------------------------------------------- |
235 | ; Generate a table entry for one instruction | |
236 | ; | |
237 | ; instr fetch, op, store | |
238 | ; | |
239 | .macro instr | |
240 | ||
2217c855 L |
241 | .set fetch_ = (do_@0 != do_fetch_nop) ; must call or jump to fetch action |
242 | .set op_ = (do_@1 != do_op_nop) ; must call or jump to op action | |
243 | .set store_ = (do_@2 != do_store_nop) ; must jump to store action | |
244 | .set cnt_ = fetch_ + op_ + store_ ; number of actions for this instruction | |
245 | ||
2217c855 | 246 | |
623dd899 L |
247 | .set done_ = 0 |
248 | .set pc_save_ = PC | |
249 | ||
250 | .if cnt_ == 0 ; nothing to do (nop) | |
251 | .org opcjmp_table_pos_ | |
252 | ret ; go back to main | |
253 | .org pc_save_ | |
254 | .set done_ = 1 | |
255 | .elif cnt_ == 1 ; jump direct to action | |
2217c855 L |
256 | .if fetch_ |
257 | .set action_1_ = do_@0 | |
258 | .elif op_ | |
259 | .set action_1_ = do_@1 | |
260 | .else | |
261 | .set action_1_ = do_@2 | |
262 | .endif | |
623dd899 L |
263 | .if (opcjmp_table_pos_ - action_1_) <= 2047 |
264 | .org opcjmp_table_pos_ | |
2217c855 | 265 | rjmp action_1_ ; do op and return to main |
623dd899 L |
266 | .org pc_save_ |
267 | .set done_ = 1 | |
2217c855 | 268 | .endif |
e7a0f403 L |
269 | .endif |
270 | ||
623dd899 | 271 | .if !done_ |
2217c855 | 272 | |
2217c855 | 273 | .if defined (l_@0_@1_@2) |
e7a0f403 | 274 | |
623dd899 L |
275 | .if (opcjmp_table_pos_ - l_@0_@1_@2) <= 2047 |
276 | .org opcjmp_table_pos_ | |
277 | rjmp l_@0_@1_@2 ; generate a jump to action table | |
278 | .org pc_save_ | |
279 | .else | |
280 | checkspace pc_save_, 2 | |
281 | .set pc_save_ = PC | |
282 | .org opcjmp_table_pos_ | |
283 | rjmp pc_save_ | |
284 | .org pc_save_ | |
e7a0f403 | 285 | jmp l_@0_@1_@2 |
e7a0f403 | 286 | .endif |
fa9059af | 287 | |
623dd899 L |
288 | .else |
289 | ||
290 | checkspace pc_save_, 2*cnt_ | |
291 | .set pc_save_ = PC | |
e7a0f403 | 292 | |
623dd899 L |
293 | .org opcjmp_table_pos_ |
294 | .equ l_@0_@1_@2 = pc_save_ ; make a label | |
e7a0f403 L |
295 | rjmp l_@0_@1_@2 ; generate a jump to action table |
296 | ||
297 | .org l_@0_@1_@2 | |
fa9059af L |
298 | |
299 | .if fetch_ ; must fetch | |
e7a0f403 L |
300 | .if op_ || store_ |
301 | .if do_@0 == 0 | |
302 | m_do_@0 | |
303 | .else | |
304 | lcall do_@0 ; fetch and come back here | |
305 | .endif | |
306 | .else | |
307 | .if do_@0 == 0 | |
308 | m_do_@0 | |
309 | ret | |
310 | .else | |
311 | ljmp do_@0 ; do op and return to main | |
312 | .endif | |
fa9059af L |
313 | .endif |
314 | .endif | |
315 | .if op_ ; must exec op | |
316 | .if store_ | |
e7a0f403 L |
317 | .if do_@1 == 0 |
318 | m_do_@1 | |
319 | .else | |
320 | lcall do_@1 ; fetch and come back here | |
321 | .endif | |
fa9059af | 322 | .else |
e7a0f403 L |
323 | .if do_@1 == 0 |
324 | m_do_@1 | |
325 | ret | |
326 | .else | |
327 | ljmp do_@1 ; do op and return to main | |
328 | .endif | |
fa9059af L |
329 | .endif |
330 | .endif | |
e7a0f403 L |
331 | .if store_ ; must store |
332 | .if do_@2 == 0 | |
333 | m_do_@2 | |
334 | ret | |
335 | .else | |
336 | ljmp do_@2 ; store is allways last | |
337 | .endif | |
fa9059af | 338 | .endif |
e7a0f403 | 339 | |
fa9059af L |
340 | .endif |
341 | .endif | |
342 | ||
623dd899 | 343 | .set opcjmp_table_pos_ = opcjmp_table_pos_ + 1 |
fa9059af L |
344 | |
345 | .endm | |
346 | ||
e7a0f403 L |
347 | |
348 | do_x_nop: | |
349 | ret | |
350 | ||
fa9059af L |
351 | ; ------------ Fetch phase stuff ----------------- |
352 | ||
623dd899 | 353 | |
fa9059af | 354 | fetch_ops: |
e7a0f403 L |
355 | .equ do_fetch_nop = do_x_nop |
356 | ||
623dd899 L |
357 | do_fetch_rst: |
358 | movw x,z_pcl | |
359 | sbiw x,1 | |
360 | mem_read_d opl | |
361 | andi opl,0x38 | |
362 | ldi oph,0 | |
363 | ret | |
fa9059af | 364 | |
e7a0f403 | 365 | .macro m_do_fetch_a |
fa9059af | 366 | mov opl,z_a |
e7a0f403 | 367 | .endm |
fa9059af | 368 | |
e7a0f403 L |
369 | .equ do_fetch_a = 0 |
370 | ; mov opl,z_a | |
371 | ; ret | |
fa9059af | 372 | |
e7a0f403 | 373 | .macro m_do_fetch_b |
825ecc9d | 374 | mov opl,z_b |
e7a0f403 | 375 | .endm |
fa9059af | 376 | |
e7a0f403 | 377 | .equ do_fetch_b = 0 |
825ecc9d | 378 | ; mov opl,z_b |
e7a0f403 L |
379 | ; ldd opl,y+oz_b |
380 | ; ret | |
fa9059af | 381 | |
e7a0f403 | 382 | .macro m_do_fetch_c |
825ecc9d | 383 | mov opl,z_c |
e7a0f403 | 384 | .endm |
fa9059af | 385 | |
e7a0f403 | 386 | .equ do_fetch_c = 0 |
825ecc9d | 387 | ; mov opl,z_c |
e7a0f403 L |
388 | ; ldd opl,y+oz_c |
389 | ; ret | |
fa9059af | 390 | |
e7a0f403 | 391 | .macro m_do_fetch_d |
825ecc9d | 392 | mov opl,z_d |
e7a0f403 L |
393 | .endm |
394 | ||
395 | .equ do_fetch_d = 0 | |
396 | ; ldd opl,y+oz_d | |
397 | ; ret | |
398 | ||
399 | .macro m_do_fetch_e | |
825ecc9d | 400 | mov opl,z_e |
e7a0f403 L |
401 | .endm |
402 | ||
403 | .equ do_fetch_e = 0 | |
404 | ; ldd opl,y+oz_e | |
405 | ; ret | |
406 | ||
407 | .macro m_do_fetch_h | |
825ecc9d | 408 | mov opl,z_h |
e7a0f403 L |
409 | .endm |
410 | ||
411 | .equ do_fetch_h = 0 | |
825ecc9d | 412 | ; mov opl,z_h |
e7a0f403 L |
413 | ; ret |
414 | ||
415 | .macro m_do_fetch_l | |
825ecc9d | 416 | mov opl,z_l |
e7a0f403 L |
417 | .endm |
418 | ||
419 | .equ do_fetch_l = 0 | |
825ecc9d | 420 | ; mov opl,z_l |
e7a0f403 | 421 | ; ret |
fa9059af L |
422 | |
423 | do_fetch_af: | |
825ecc9d | 424 | movw opl,z_flags |
fa9059af L |
425 | ret |
426 | ||
825ecc9d L |
427 | .macro m_do_fetch_bc |
428 | movw opl,z_c | |
429 | .endm | |
fa9059af | 430 | |
825ecc9d L |
431 | .equ do_fetch_bc = 0 |
432 | ; movw opl,z_c | |
433 | ; ret | |
434 | ||
435 | .macro m_do_fetch_de | |
436 | movw opl,z_e | |
437 | .endm | |
fa9059af | 438 | |
825ecc9d L |
439 | .equ do_fetch_de = 0 |
440 | ; ldd opl,y+oz_e | |
441 | ; ldd oph,y+oz_d | |
fa9059af L |
442 | ret |
443 | ||
825ecc9d L |
444 | .macro m_do_fetch_hl |
445 | movw opl,z_l | |
446 | .endm | |
447 | ||
448 | .equ do_fetch_hl = 0 | |
449 | ; movw opl,z_l | |
450 | ; ret | |
451 | ||
e7a0f403 | 452 | .macro m_do_fetch_sp |
fa9059af | 453 | movw opl,z_spl |
e7a0f403 L |
454 | .endm |
455 | ||
456 | .equ do_fetch_sp = 0 | |
457 | ; movw opl,z_spl | |
458 | ; ret | |
fa9059af L |
459 | |
460 | do_fetch_mbc: | |
825ecc9d | 461 | movw x,z_c |
fa9059af L |
462 | mem_read_d z_a |
463 | ret | |
464 | ||
465 | do_fetch_mde: | |
825ecc9d L |
466 | movw x,z_e |
467 | ; ldd xh,y+oz_d | |
468 | ; ldd xl,y+oz_e | |
fa9059af L |
469 | mem_read_d z_a |
470 | ret | |
471 | ||
472 | do_fetch_mhl: | |
825ecc9d | 473 | movw x,z_l |
fa9059af L |
474 | mem_read_d opl |
475 | ret | |
476 | ||
477 | do_fetch_msp: | |
478 | movw x,z_spl | |
479 | mem_read_d opl | |
480 | adiw x,1 | |
481 | mem_read_d oph | |
482 | ret | |
483 | ||
484 | do_fetch_dir8: | |
485 | mem_read_ds opl, z_pc | |
486 | adiw z_pcl,1 | |
487 | ret | |
488 | ||
489 | do_fetch_dir16: | |
490 | mem_read_ds opl, z_pc | |
491 | adiw z_pcl,1 | |
492 | mem_read_ds oph, z_pc | |
493 | adiw z_pcl,1 | |
494 | ret | |
495 | ||
fa9059af L |
496 | ; ------------ Store phase stuff ----------------- |
497 | ||
fa9059af | 498 | store_ops: |
e7a0f403 L |
499 | .equ do_store_nop = do_x_nop |
500 | ||
fa9059af L |
501 | |
502 | do_store_a: | |
503 | mov z_a,opl | |
504 | ret | |
505 | ||
e7a0f403 L |
506 | ;.macro m_do_store_b |
507 | ; std y+oz_b,opl | |
508 | ;.endm | |
509 | ;.equ do_store_b = 0 | |
fa9059af | 510 | do_store_b: |
825ecc9d | 511 | mov z_b,opl |
fa9059af L |
512 | ret |
513 | ||
514 | do_store_c: | |
825ecc9d | 515 | mov z_c,opl |
fa9059af L |
516 | ret |
517 | ||
518 | do_store_d: | |
825ecc9d | 519 | mov z_d,opl |
fa9059af L |
520 | ret |
521 | ||
522 | do_store_e: | |
825ecc9d | 523 | mov z_e,opl |
fa9059af L |
524 | ret |
525 | ||
526 | do_store_h: | |
825ecc9d | 527 | mov z_h,opl |
fa9059af L |
528 | ret |
529 | ||
530 | do_store_l: | |
825ecc9d | 531 | mov z_l,opl |
fa9059af L |
532 | ret |
533 | ||
534 | do_store_af: | |
825ecc9d | 535 | movw z_flags,opl |
fa9059af L |
536 | ret |
537 | ||
538 | do_store_bc: | |
825ecc9d | 539 | movw z_c,opl |
fa9059af L |
540 | ret |
541 | ||
542 | do_store_de: | |
825ecc9d L |
543 | movw z_e,opl |
544 | ; std y+oz_d,oph | |
545 | ; std y+oz_e,opl | |
fa9059af L |
546 | ret |
547 | ||
548 | do_store_hl: | |
825ecc9d | 549 | movw z_l,opl |
fa9059af L |
550 | ret |
551 | ||
552 | do_store_mbc: | |
825ecc9d | 553 | movw x,z_c |
fa9059af L |
554 | mem_write_s z_a |
555 | ret | |
556 | ||
557 | do_store_mde: | |
825ecc9d L |
558 | movw x,z_e |
559 | ; ldd xh,y+oz_d | |
560 | ; ldd xl,y+oz_e | |
fa9059af L |
561 | mem_write_s z_a |
562 | ret | |
563 | ||
564 | do_store_mhl: | |
825ecc9d | 565 | movw x,z_l |
fa9059af L |
566 | mem_write_s opl |
567 | ret | |
568 | ||
569 | do_store_msp: | |
570 | movw xl,z_spl | |
571 | mem_write_s opl | |
572 | adiw xl,1 | |
573 | mem_write_s oph | |
574 | ret | |
575 | ||
576 | do_store_sp: | |
577 | movw z_spl,opl | |
578 | ret | |
579 | ||
580 | do_store_pc: | |
581 | movw z_pcl,opl | |
582 | ret | |
583 | ||
80e1fa71 | 584 | do_store_pcrel: ;add displacement to PC |
096f3a91 | 585 | #if EM_Z80 |
80e1fa71 L |
586 | clr oph |
587 | tst opl ;sign extend | |
588 | brpl stpcr1 | |
589 | com oph | |
590 | stpcr1: | |
591 | add z_pcl,opl | |
592 | adc z_pch,oph | |
593 | ret | |
096f3a91 L |
594 | #else |
595 | rjmp do_op_inv | |
596 | #endif | |
80e1fa71 | 597 | |
fa9059af L |
598 | do_store_ret: |
599 | movw x,z_spl | |
600 | mem_read_d z_pcl | |
601 | adiw x,1 | |
602 | mem_read_d z_pch | |
603 | adiw x,1 | |
604 | movw z_spl,x | |
605 | ||
606 | .if STACK_DBG | |
607 | printnewline | |
608 | printstring "Stack pop " | |
609 | movw temp,z_pcl | |
610 | rcall printhexw | |
611 | printstring ", SP is now " | |
612 | movw temp,z_spl | |
613 | rcall printhexw | |
614 | printstring ". " | |
615 | .endif | |
616 | ret | |
617 | ||
618 | do_store_call: | |
619 | movw xl,z_spl | |
620 | sbiw x,1 | |
621 | mem_write_s z_pch | |
622 | sbiw x,1 | |
623 | mem_write_s z_pcl | |
624 | movw z_spl,xl | |
625 | ||
626 | .if STACK_DBG | |
627 | printnewline | |
628 | printstring "Stack push " | |
629 | movw temp,z_pcl | |
630 | rcall printhexw | |
631 | printstring ", SP is now " | |
632 | movw temp,z_spl | |
633 | rcall printhexw | |
634 | printstring ". " | |
635 | .endif | |
636 | movw z_pcl,opl | |
637 | ret | |
638 | ||
639 | ||
640 | do_store_am: | |
641 | mem_write_ds op, z_a | |
642 | ret | |
643 | ||
fa9059af L |
644 | ; ------------ Operation phase stuff ----------------- |
645 | ||
646 | ;---------------------------------------------------------------- | |
647 | ;| | | |
648 | ;| Zilog | | |
649 | ;| | | |
650 | ;| ZZZZZZZ 88888 000 | | |
651 | ;| Z 8 8 0 0 | | |
652 | ;| Z 8 8 0 0 0 | | |
653 | ;| Z 88888 0 0 0 | | |
654 | ;| Z 8 8 0 0 0 | | |
655 | ;| Z 8 8 0 0 | | |
656 | ;| ZZZZZZZ 88888 000 | | |
657 | ;| | | |
658 | ;| Z80 MICROPROCESSOR Instruction Set Summary | | |
659 | ;| | | |
660 | ;---------------------------------------------------------------- | |
661 | ;---------------------------------------------------------------- | |
662 | ;|Mnemonic |SZHPNC|Description |Notes | | |
663 | ;|----------+------+---------------------+----------------------| | |
664 | ;|ADC A,s |***V0*|Add with Carry |A=A+s+CY | | |
665 | ;|ADC HL,ss |**?V0*|Add with Carry |HL=HL+ss+CY | | |
666 | ;|ADD A,s |***V0*|Add |A=A+s | | |
80e1fa71 L |
667 | ;|ADD HL,ss |--*-0*|Add |HL=HL+ss | |
668 | ;|ADD IX,pp |--*-0*|Add |IX=IX+pp | | |
669 | ;|ADD IY,rr |--*-0*|Add |IY=IY+rr | | |
fa9059af L |
670 | ;|AND s |**1P00|Logical AND |A=A&s | |
671 | ;|BIT b,m |?*1?0-|Test Bit |m&{2^b} | | |
672 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
673 | ;|CALL nn |------|Unconditional Call |-[SP]=PC,PC=nn | | |
674 | ;|CCF |--?-0*|Complement Carry Flag|CY=~CY | | |
675 | ;|CP s |***V1*|Compare |A-s | | |
676 | ;|CPD |****1-|Compare and Decrement|A-[HL],HL=HL-1,BC=BC-1| | |
677 | ;|CPDR |****1-|Compare, Dec., Repeat|CPD till A=[HL]or BC=0| | |
678 | ;|CPI |****1-|Compare and Increment|A-[HL],HL=HL+1,BC=BC-1| | |
679 | ;|CPIR |****1-|Compare, Inc., Repeat|CPI till A=[HL]or BC=0| | |
680 | ;|CPL |--1-1-|Complement |A=~A | | |
681 | ;|DAA |***P-*|Decimal Adjust Acc. |A=BCD format | | |
682 | ;|DEC s |***V1-|Decrement |s=s-1 | | |
683 | ;|DEC xx |------|Decrement |xx=xx-1 | | |
684 | ;|DEC ss |------|Decrement |ss=ss-1 | | |
4c92af0d | 685 | ;|DI |------|Disable Interrupts |IFF1 = IFF2 = 0 | |
fa9059af | 686 | ;|DJNZ e |------|Dec., Jump Non-Zero |B=B-1 till B=0 | |
4c92af0d | 687 | ;|EI |------|Enable Interrupts |IFF1 = IFF2 = 1 | |
fa9059af L |
688 | ;|EX [SP],HL|------|Exchange |[SP]<->HL | |
689 | ;|EX [SP],xx|------|Exchange |[SP]<->xx | | |
690 | ;|EX AF,AF' |------|Exchange |AF<->AF' | | |
691 | ;|EX DE,HL |------|Exchange |DE<->HL | | |
692 | ;|EXX |------|Exchange |qq<->qq' (except AF)| | |
693 | ;|HALT |------|Halt | | | |
694 | ;|IM n |------|Interrupt Mode | (n=0,1,2)| | |
695 | ;|IN A,[n] |------|Input |A=[n] | | |
696 | ;|IN r,[C] |***P0-|Input |r=[C] | | |
697 | ;|INC r |***V0-|Increment |r=r+1 | | |
698 | ;|INC [HL] |***V0-|Increment |[HL]=[HL]+1 | | |
699 | ;|INC xx |------|Increment |xx=xx+1 | | |
700 | ;|INC [xx+d]|***V0-|Increment |[xx+d]=[xx+d]+1 | | |
701 | ;|INC ss |------|Increment |ss=ss+1 | | |
702 | ;|IND |?*??1-|Input and Decrement |[HL]=[C],HL=HL-1,B=B-1| | |
703 | ;|INDR |?1??1-|Input, Dec., Repeat |IND till B=0 | | |
704 | ;|INI |?*??1-|Input and Increment |[HL]=[C],HL=HL+1,B=B-1| | |
705 | ;|INIR |?1??1-|Input, Inc., Repeat |INI till B=0 | | |
706 | ;|JP [HL] |------|Unconditional Jump |PC=[HL] | | |
707 | ;|JP [xx] |------|Unconditional Jump |PC=[xx] | | |
708 | ;|JP nn |------|Unconditional Jump |PC=nn | | |
709 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
710 | ;|JR e |------|Unconditional Jump |PC=PC+e | | |
711 | ;|JR cc,e |------|Conditional Jump |If cc JR(cc=C,NC,NZ,Z)| | |
712 | ;|LD dst,src|------|Load |dst=src | | |
713 | ;|LD A,i |**0*0-|Load |A=i (i=I,R)| | |
714 | ;|LDD |--0*0-|Load and Decrement |[DE]=[HL],HL=HL-1,# | | |
715 | ;|LDDR |--000-|Load, Dec., Repeat |LDD till BC=0 | | |
716 | ;|LDI |--0*0-|Load and Increment |[DE]=[HL],HL=HL+1,# | | |
717 | ;|LDIR |--000-|Load, Inc., Repeat |LDI till BC=0 | | |
718 | ;|NEG |***V1*|Negate |A=-A | | |
719 | ;|NOP |------|No Operation | | | |
720 | ;|OR s |**0P00|Logical inclusive OR |A=Avs | | |
721 | ;|OTDR |?1??1-|Output, Dec., Repeat |OUTD till B=0 | | |
722 | ;|OTIR |?1??1-|Output, Inc., Repeat |OUTI till B=0 | | |
723 | ;|OUT [C],r |------|Output |[C]=r | | |
724 | ;|OUT [n],A |------|Output |[n]=A | | |
725 | ;|OUTD |?*??1-|Output and Decrement |[C]=[HL],HL=HL-1,B=B-1| | |
726 | ;|OUTI |?*??1-|Output and Increment |[C]=[HL],HL=HL+1,B=B-1| | |
727 | ;|POP xx |------|Pop |xx=[SP]+ | | |
728 | ;|POP qq |------|Pop |qq=[SP]+ | | |
729 | ;|PUSH xx |------|Push |-[SP]=xx | | |
730 | ;|PUSH qq |------|Push |-[SP]=qq | | |
731 | ;|RES b,m |------|Reset bit |m=m&{~2^b} | | |
732 | ;|RET |------|Return |PC=[SP]+ | | |
733 | ;|RET cc |------|Conditional Return |If cc RET | | |
734 | ;|RETI |------|Return from Interrupt|PC=[SP]+ | | |
735 | ;|RETN |------|Return from NMI |PC=[SP]+ | | |
736 | ;|RL m |**0P0*|Rotate Left |m={CY,m}<- | | |
737 | ;|RLA |--0-0*|Rotate Left Acc. |A={CY,A}<- | | |
738 | ;|RLC m |**0P0*|Rotate Left Circular |m=m<- | | |
739 | ;|RLCA |--0-0*|Rotate Left Circular |A=A<- | | |
740 | ;|RLD |**0P0-|Rotate Left 4 bits |{A,[HL]}={A,[HL]}<- ##| | |
741 | ;|RR m |**0P0*|Rotate Right |m=->{CY,m} | | |
742 | ;|RRA |--0-0*|Rotate Right Acc. |A=->{CY,A} | | |
743 | ;|RRC m |**0P0*|Rotate Right Circular|m=->m | | |
744 | ;|RRCA |--0-0*|Rotate Right Circular|A=->A | | |
745 | ;|RRD |**0P0-|Rotate Right 4 bits |{A,[HL]}=->{A,[HL]} ##| | |
746 | ;|RST p |------|Restart | (p=0H,8H,10H,...,38H)| | |
747 | ;|SBC A,s |***V1*|Subtract with Carry |A=A-s-CY | | |
80e1fa71 | 748 | ;|SBC HL,ss |***V1*|Subtract with Carry |HL=HL-ss-CY | |
fa9059af L |
749 | ;|SCF |--0-01|Set Carry Flag |CY=1 | |
750 | ;|SET b,m |------|Set bit |m=mv{2^b} | | |
751 | ;|SLA m |**0P0*|Shift Left Arithmetic|m=m*2 | | |
752 | ;|SRA m |**0P0*|Shift Right Arith. |m=m/2 | | |
753 | ;|SRL m |**0P0*|Shift Right Logical |m=->{0,m,CY} | | |
754 | ;|SUB s |***V1*|Subtract |A=A-s | | |
755 | ;|XOR s |**0P00|Logical Exclusive OR |A=Axs | | |
756 | ;|----------+------+--------------------------------------------| | |
757 | ;| F |-*01? |Flag unaffected/affected/reset/set/unknown | | |
758 | ;| S |S |Sign flag (Bit 7) | | |
759 | ;| Z | Z |Zero flag (Bit 6) | | |
760 | ;| HC | H |Half Carry flag (Bit 4) | | |
761 | ;| P/V | P |Parity/Overflow flag (Bit 2, V=overflow) | | |
762 | ;| N | N |Add/Subtract flag (Bit 1) | | |
763 | ;| CY | C|Carry flag (Bit 0) | | |
764 | ;|-----------------+--------------------------------------------| | |
765 | ;| n |Immediate addressing | | |
766 | ;| nn |Immediate extended addressing | | |
767 | ;| e |Relative addressing (PC=PC+2+offset) | | |
768 | ;| [nn] |Extended addressing | | |
769 | ;| [xx+d] |Indexed addressing | | |
770 | ;| r |Register addressing | | |
771 | ;| [rr] |Register indirect addressing | | |
772 | ;| |Implied addressing | | |
773 | ;| b |Bit addressing | | |
774 | ;| p |Modified page zero addressing (see RST) | | |
775 | ;|-----------------+--------------------------------------------| | |
776 | ;|DEFB n(,...) |Define Byte(s) | | |
777 | ;|DEFB 'str'(,...) |Define Byte ASCII string(s) | | |
778 | ;|DEFS nn |Define Storage Block | | |
779 | ;|DEFW nn(,...) |Define Word(s) | | |
780 | ;|-----------------+--------------------------------------------| | |
781 | ;| A B C D E |Registers (8-bit) | | |
782 | ;| AF BC DE HL |Register pairs (16-bit) | | |
783 | ;| F |Flag register (8-bit) | | |
784 | ;| I |Interrupt page address register (8-bit) | | |
785 | ;| IX IY |Index registers (16-bit) | | |
786 | ;| PC |Program Counter register (16-bit) | | |
787 | ;| R |Memory Refresh register | | |
788 | ;| SP |Stack Pointer register (16-bit) | | |
789 | ;|-----------------+--------------------------------------------| | |
790 | ;| b |One bit (0 to 7) | | |
791 | ;| cc |Condition (C,M,NC,NZ,P,PE,PO,Z) | | |
792 | ;| d |One-byte expression (-128 to +127) | | |
793 | ;| dst |Destination s, ss, [BC], [DE], [HL], [nn] | | |
794 | ;| e |One-byte expression (-126 to +129) | | |
795 | ;| m |Any register r, [HL] or [xx+d] | | |
796 | ;| n |One-byte expression (0 to 255) | | |
797 | ;| nn |Two-byte expression (0 to 65535) | | |
798 | ;| pp |Register pair BC, DE, IX or SP | | |
799 | ;| qq |Register pair AF, BC, DE or HL | | |
800 | ;| qq' |Alternative register pair AF, BC, DE or HL | | |
801 | ;| r |Register A, B, C, D, E, H or L | | |
802 | ;| rr |Register pair BC, DE, IY or SP | | |
803 | ;| s |Any register r, value n, [HL] or [xx+d] | | |
804 | ;| src |Source s, ss, [BC], [DE], [HL], nn, [nn] | | |
805 | ;| ss |Register pair BC, DE, HL or SP | | |
806 | ;| xx |Index register IX or IY | | |
807 | ;|-----------------+--------------------------------------------| | |
808 | ;| + - * / ^ |Add/subtract/multiply/divide/exponent | | |
809 | ;| & ~ v x |Logical AND/NOT/inclusive OR/exclusive OR | | |
810 | ;| <- -> |Rotate left/right | | |
811 | ;| [ ] |Indirect addressing | | |
812 | ;| [ ]+ -[ ] |Indirect addressing auto-increment/decrement| | |
813 | ;| { } |Combination of operands | | |
814 | ;| # |Also BC=BC-1,DE=DE-1 | | |
815 | ;| ## |Only lower 4 bits of accumulator A used | | |
816 | ;---------------------------------------------------------------- | |
817 | ||
818 | ;How the flags are supposed to work: | |
819 | ;7 ZFL_S - Sign flag (=MSBit of result) | |
820 | ;6 ZFL_Z - Zero flag. Is 1 when the result is 0 | |
821 | ;4 ZFL_H - Half-carry (carry from bit 3 to 4) | |
822 | ;2 ZFL_P - Parity/2-complement Overflow | |
823 | ;1 ZFL_N - Subtract - set if last op was a subtract | |
824 | ;0 ZFL_C - Carry | |
825 | ; | |
826 | ;I sure hope I got the mapping between flags and instructions correct... | |
827 | ||
828 | .equ ZFL_S = 7 | |
829 | .equ ZFL_Z = 6 | |
830 | .equ ZFL_H = 4 | |
831 | .equ ZFL_P = 2 | |
832 | .equ ZFL_N = 1 | |
833 | .equ ZFL_C = 0 | |
834 | ||
835 | .equ AVR_T = SREG_T | |
836 | .equ AVR_H = SREG_H | |
837 | .equ AVR_S = SREG_S | |
838 | .equ AVR_V = SREG_V | |
839 | .equ AVR_N = SREG_N | |
840 | .equ AVR_Z = SREG_Z | |
841 | .equ AVR_C = SREG_C | |
842 | ||
843 | ; TODO: check Z80 flag settings | |
844 | ||
845 | ;------------------------------------------------; | |
846 | ; Load table value from flash indexed by source reg. | |
847 | ; | |
848 | ; ldpmx dstreg,tablebase,indexreg | |
849 | ; | |
096f3a91 | 850 | ; (3 words, 5 cycles) |
fa9059af L |
851 | |
852 | .macro ldpmx | |
853 | ldi zh,high(@1*2) ; table must be page aligned | |
854 | mov zl,@2 | |
855 | lpm @0,z | |
856 | .endm | |
857 | ||
858 | .macro do_z80_flags_V | |
859 | #if EM_Z80 | |
860 | bmov z_flags, ZFL_P, temp, AVR_V | |
861 | #endif | |
862 | .endm | |
863 | ||
80e1fa71 L |
864 | .macro do_z80_flags_H |
865 | #if EM_Z80 | |
866 | bmov z_flags, ZFL_H, temp, AVR_H | |
867 | #endif | |
868 | .endm | |
869 | ||
fa9059af L |
870 | .macro do_z80_flags_set_N |
871 | #if EM_Z80 | |
872 | ori z_flags, (1<<ZFL_N) ; Negation auf 1 | |
873 | #endif | |
874 | .endm | |
875 | ||
876 | .macro do_z80_flags_set_HN | |
877 | #if EM_Z80 | |
878 | ori z_flags,(1<<ZFL_N)|(1<<ZFL_H) | |
879 | #endif | |
880 | .endm | |
881 | ||
882 | .macro do_z80_flags_clear_N | |
883 | #if EM_Z80 | |
884 | andi z_flags,~(1<<ZFL_N) | |
885 | #endif | |
886 | .endm | |
887 | ||
888 | .macro do_z80_flags_clear_HN | |
889 | #if EM_Z80 | |
890 | andi z_flags,~((1<<ZFL_H)|(1<<ZFL_N)) | |
891 | #endif | |
892 | .endm | |
893 | ||
894 | ||
895 | .macro do_z80_flags_copy_HC | |
896 | #if EM_Z80 | |
096f3a91 | 897 | bmov z_flags, ZFL_H, z_flags, ZFL_C |
fa9059af L |
898 | #endif |
899 | .endm | |
900 | ||
901 | .macro do_z80_flags_op_rotate | |
902 | ; must not change avr carry flag! | |
903 | #if EM_Z80 | |
904 | andi z_flags, ~( (1<<ZFL_H) | (1<<ZFL_N) | (1<<ZFL_C) ) | |
905 | #else | |
906 | andi z_flags, ~( (1<<ZFL_C) ) | |
907 | #endif | |
908 | .endm | |
909 | ||
910 | .macro do_z80_flags_op_and | |
911 | #if EM_Z80 | |
912 | ori z_flags,(1<<ZFL_H) | |
913 | #endif | |
914 | .endm | |
915 | ||
916 | .macro do_z80_flags_op_or | |
917 | #if EM_Z80 | |
918 | ;nothing to do | |
919 | #endif | |
920 | .endm | |
921 | ||
922 | ||
923 | ;---------------------------------------------------------------- | |
924 | ||
e7a0f403 L |
925 | .equ do_op_nop = do_x_nop |
926 | ||
fa9059af L |
927 | do_op_inv: |
928 | sbiw z_pcl,1 | |
929 | lcall printregs | |
930 | printstring "Invalid opcode! " | |
931 | ||
932 | haltinv: | |
933 | rjmp haltinv | |
934 | ||
80e1fa71 L |
935 | |
936 | ;---------------------------------------------------------------- | |
937 | ;|Mnemonic |SZHPNC|Description |Notes | | |
938 | ;---------------------------------------------------------------- | |
939 | ;|HALT |------|Halt | | | |
940 | ||
941 | ||
942 | do_op_HALT: | |
943 | sbiw z_pcl,1 | |
944 | sbrc intstat,i_halt | |
945 | ret | |
946 | sbr intstat,(1<<i_halt) | |
947 | lcall printregs | |
948 | printstring "CPU halted! " | |
949 | ret | |
950 | ||
fa9059af L |
951 | ;---------------------------------------------------------------- |
952 | ;|Mnemonic |SZHPNC|Description |Notes | | |
953 | ;---------------------------------------------------------------- | |
954 | ;|OUT [n],A |------|Output |[n]=A | | |
955 | ; | |
956 | ; | |
957 | ;Interface with peripherials goes here :) | |
958 | do_op_outa: ; out (opl),a | |
959 | .if PORT_DEBUG | |
960 | printnewline | |
961 | printstring "Port write: " | |
962 | mov temp,z_a | |
80e1fa71 | 963 | lcall printhex |
fa9059af L |
964 | printstring " -> (" |
965 | mov temp,opl | |
80e1fa71 | 966 | lcall printhex |
fa9059af L |
967 | printstring ") " |
968 | .endif | |
969 | mov temp,z_a | |
970 | mov temp2,opl | |
e7a0f403 | 971 | lcall portWrite |
fa9059af L |
972 | ret |
973 | ||
fa9059af L |
974 | ;---------------------------------------------------------------- |
975 | ;|Mnemonic |SZHPNC|Description |Notes | | |
976 | ;---------------------------------------------------------------- | |
977 | ;|IN A,[n] |------|Input |A=[n] | | |
978 | ; | |
979 | ; | |
80e1fa71 | 980 | do_op_ina: ; in a,(opl) |
fa9059af | 981 | .if PORT_DEBUG |
fb050095 L |
982 | push opl |
983 | cp opl,_0 ; don't debug port 0 (con stat) | |
984 | breq dbg_op_ina_1 | |
fa9059af L |
985 | printnewline |
986 | printstring "Port read: (" | |
987 | mov temp,opl | |
80e1fa71 | 988 | lcall printhex |
fa9059af | 989 | printstring ") -> " |
fb050095 | 990 | dbg_op_ina_1: |
fa9059af L |
991 | .endif |
992 | ||
993 | mov temp2,opl | |
994 | lcall portRead | |
80e1fa71 | 995 | mov z_a,temp |
fa9059af L |
996 | |
997 | .if PORT_DEBUG | |
fb050095 L |
998 | pop temp |
999 | cp temp,_0 | |
1000 | breq dbg_op_ina_2 | |
80e1fa71 | 1001 | lcall printhex |
fa9059af | 1002 | printstring " " |
fb050095 | 1003 | dbg_op_ina_2: |
fa9059af L |
1004 | .endif |
1005 | ret | |
1006 | ||
1007 | ;---------------------------------------------------------------- | |
1008 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1009 | ;---------------------------------------------------------------- | |
1010 | ;|INC r |***V0-|Increment |r=r+1 | | |
1011 | ;|INC [HL] |***V0-|Increment |[HL]=[HL]+1 | | |
1012 | ;|INC [xx+d]|***V0-|Increment |[xx+d]=[xx+d]+1 | | |
1013 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1014 | ;|INC r |**-P0-|Increment |r=r+1 | | |
1015 | ;|INC [HL] |**-P0-|Increment |[HL]=[HL]+1 | | |
1016 | ; | |
2217c855 | 1017 | |
fa9059af | 1018 | do_op_inc: |
096f3a91 | 1019 | #if EM_Z80 |
825ecc9d L |
1020 | #if 1 |
1021 | andi z_flags,(1<<ZFL_C) ; preserve C-, Clear N-flag | |
1022 | subi opl,-1 | |
1023 | in temp,sreg | |
1024 | sbrc temp,AVR_N | |
1025 | sbr z_flags,(1<<ZFL_S) | |
1026 | sbrc temp,AVR_Z | |
1027 | sbr z_flags,(1<<ZFL_Z) | |
1028 | sbrs temp,AVR_H | |
1029 | sbr z_flags,(1<<ZFL_H) | |
1030 | sbrc temp,AVR_V | |
1031 | sbr z_flags,(1<<ZFL_P) | |
1032 | #else | |
096f3a91 | 1033 | andi z_flags,(1<<ZFL_C) ; preserve C-, Clear N-flag |
fa9059af L |
1034 | ldi temp,1 |
1035 | add opl,temp | |
096f3a91 L |
1036 | in temp,sreg |
1037 | bmov z_flags,ZFL_S, temp,AVR_N | |
1038 | bmov z_flags,ZFL_Z, temp,AVR_Z | |
1039 | bmov z_flags,ZFL_H, temp,AVR_H | |
1040 | bmov z_flags,ZFL_P, temp,AVR_V | |
825ecc9d | 1041 | #endif |
2217c855 | 1042 | #else /* 8080 */ |
096f3a91 L |
1043 | andi z_flags,(1<<ZFL_C)|(1<<ZFL_H) ; preserve C- and H-flag |
1044 | inc opl | |
2217c855 L |
1045 | ldpmx temp,sz53p_tab,opl ;S,Z,P flag |
1046 | or z_flags,temp | |
1047 | #endif | |
fa9059af L |
1048 | ret |
1049 | ||
825ecc9d L |
1050 | #if 0 |
1051 | bst z_flags,ZFL_C ; save C flag | |
1052 | subi opl,-1 | |
1053 | in temp,sreg | |
1054 | ldpmx z_flags,flagmap_tab,temp | |
1055 | bld z_flags,ZFL_C | |
1056 | ret | |
1057 | #endif | |
1058 | ||
fa9059af | 1059 | do_op_inca: |
096f3a91 L |
1060 | #if EM_Z80 |
1061 | andi z_flags,(1<<ZFL_C) ; preserve C-, Clear N-flag | |
825ecc9d | 1062 | subi z_a,-1 |
096f3a91 L |
1063 | in temp,sreg |
1064 | bmov z_flags,ZFL_S, temp,AVR_N | |
1065 | bmov z_flags,ZFL_Z, temp,AVR_Z | |
825ecc9d L |
1066 | sbrs temp,AVR_H |
1067 | sbr z_flags,(1<<ZFL_H) | |
096f3a91 | 1068 | bmov z_flags,ZFL_P, temp,AVR_V |
2217c855 | 1069 | #else /* 8080 */ |
096f3a91 L |
1070 | andi z_flags,(1<<ZFL_C)|(1<<ZFL_H) ; preserve C- and H-flag |
1071 | inc z_a | |
1072 | ldpmx temp,sz53p_tab,z_a ; S,Z,P flag | |
2217c855 L |
1073 | or z_flags,temp |
1074 | #endif | |
fa9059af L |
1075 | ret |
1076 | ||
1077 | ;---------------------------------------------------------------- | |
1078 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1079 | ;---------------------------------------------------------------- | |
1080 | ;|DEC r |***V1-|Decrement |s=s-1 | | |
825ecc9d L |
1081 | ;|DEC [HL] |***V1-|Increment |[HL]=[HL]-1 | |
1082 | ;|DEC [xx+d]|***V1-|Increment |[xx+d]=[xx+d]-1 | | |
fa9059af | 1083 | ;|----------|SZHP C|---------- 8080 ----------------------------| |
2217c855 L |
1084 | ;|DEC r |**-P -|Increment |r=r-1 | |
1085 | ;|DEC [HL] |**-P -|Increment |[HL]=[HL]-1 | | |
fa9059af | 1086 | ; |
2217c855 | 1087 | |
fa9059af | 1088 | do_op_dec: |
2217c855 L |
1089 | subi opl,1 |
1090 | #if EM_Z80 | |
096f3a91 L |
1091 | in temp,sreg |
1092 | bmov z_flags,ZFL_S, temp,AVR_N | |
1093 | bmov z_flags,ZFL_Z, temp,AVR_Z | |
1094 | bmov z_flags,ZFL_H, temp,AVR_H | |
1095 | bmov z_flags,ZFL_P, temp,AVR_V | |
2217c855 L |
1096 | ori z_flags,(1<<ZFL_N) ; Set N-flag |
1097 | #else /* 8080 */ | |
096f3a91 | 1098 | andi z_flags,(1<<ZFL_C)|(1<<ZFL_H) ; preserve C- and H-flag |
2217c855 L |
1099 | ldpmx temp,sz53p_tab,opl ; S,Z,P flag |
1100 | or z_flags,temp | |
1101 | #endif | |
fa9059af L |
1102 | ret |
1103 | ||
2217c855 | 1104 | |
fa9059af | 1105 | do_op_deca: |
2217c855 | 1106 | #if EM_Z80 |
825ecc9d | 1107 | subi z_a,1 |
096f3a91 L |
1108 | in temp,sreg |
1109 | bmov z_flags,ZFL_S, temp,AVR_N | |
1110 | bmov z_flags,ZFL_Z, temp,AVR_Z | |
1111 | bmov z_flags,ZFL_H, temp,AVR_H | |
1112 | bmov z_flags,ZFL_P, temp,AVR_V | |
2217c855 L |
1113 | ori z_flags,(1<<ZFL_N) ; Set N-flag |
1114 | #else /* 8080 */ | |
096f3a91 L |
1115 | dec z_a |
1116 | andi z_flags,(1<<ZFL_C)|(1<<ZFL_H) ; preserve C- and H-flag | |
1117 | ldpmx temp,sz53p_tab,z_a ; S,Z,P flag | |
2217c855 L |
1118 | or z_flags,temp |
1119 | #endif | |
fa9059af L |
1120 | ret |
1121 | ||
2217c855 | 1122 | |
fa9059af L |
1123 | ;---------------------------------------------------------------- |
1124 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1125 | ;---------------------------------------------------------------- | |
1126 | ;|INC xx |------|Increment |xx=xx+1 | | |
1127 | ;|INC ss |------|Increment |ss=ss+1 | | |
1128 | ; | |
1129 | ; | |
1130 | do_op_inc16: | |
1131 | subi opl,low(-1) | |
1132 | sbci oph,high(-1) | |
1133 | ret | |
1134 | ||
825ecc9d L |
1135 | do_op_incHL: |
1136 | sub z_l,_255 | |
1137 | sbc z_h,_255 | |
1138 | ret | |
1139 | ||
1140 | do_op_incDE: | |
1141 | sub z_e,_255 | |
1142 | sbc z_d,_255 | |
1143 | ret | |
1144 | ||
1145 | do_op_incBC: | |
1146 | sub z_c,_255 | |
1147 | sbc z_b,_255 | |
1148 | ret | |
1149 | ||
fa9059af L |
1150 | ;---------------------------------------------------------------- |
1151 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1152 | ;---------------------------------------------------------------- | |
1153 | ;|DEC xx |------|Decrement |xx=xx-1 | | |
1154 | ;|DEC ss |------|Decrement |ss=ss-1 | | |
1155 | ; | |
1156 | ; | |
1157 | do_op_dec16: | |
1158 | subi opl, 1 | |
1159 | sbci oph, 0 | |
1160 | ret | |
1161 | ||
825ecc9d L |
1162 | do_op_decHL: |
1163 | add z_l,_255 | |
1164 | adc z_h,_255 | |
1165 | ret | |
1166 | ||
1167 | do_op_decDE: | |
1168 | add z_e,_255 | |
1169 | adc z_d,_255 | |
1170 | ret | |
1171 | ||
1172 | do_op_decBC: | |
1173 | add z_c,_255 | |
1174 | adc z_b,_255 | |
1175 | ret | |
1176 | ||
fa9059af L |
1177 | ;---------------------------------------------------------------- |
1178 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1179 | ;---------------------------------------------------------------- | |
1180 | ;|RLCA |--0-0*|Rotate Left Circular |A=A<- | | |
1181 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1182 | ;|RLCA |---- *|Rotate Left Circular |A=A<- | | |
1183 | ; | |
1184 | ; | |
1185 | do_op_rlca: | |
1186 | ;Rotate Left Cyclical. All bits move 1 to the | |
1187 | ;left, the msb becomes c and lsb. | |
1188 | do_z80_flags_op_rotate | |
1189 | lsl z_a | |
1190 | brcc do_op_rlc_noc | |
1191 | ldi temp,1 | |
1192 | or z_a,temp | |
1193 | ori z_flags, (1<<ZFL_C) | |
1194 | do_op_rlc_noc: | |
1195 | ret | |
1196 | ||
1197 | ;---------------------------------------------------------------- | |
1198 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1199 | ;---------------------------------------------------------------- | |
1200 | ;|RRCA |--0-0*|Rotate Right Circular|A=->A | | |
1201 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1202 | ;|RRCA |---- *|Rotate Right Circular|A=->A | | |
1203 | ; | |
1204 | ; | |
1205 | do_op_rrca: | |
1206 | ;Rotate Right Cyclical. All bits move 1 to the | |
1207 | ;right, the lsb becomes c and msb. | |
1208 | do_z80_flags_op_rotate | |
1209 | lsr z_a | |
1210 | brcc do_op_rrc_noc | |
1211 | ldi temp,0x80 | |
1212 | or z_a,temp | |
1213 | ori z_flags, (1<<ZFL_C) | |
1214 | do_op_rrc_noc: | |
1215 | ret | |
1216 | ||
1217 | ;---------------------------------------------------------------- | |
1218 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1219 | ;---------------------------------------------------------------- | |
1220 | ;|RRA |--0-0*|Rotate Right Acc. |A=->{CY,A} | | |
1221 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1222 | ;|RRA |---- *|Rotate Right Acc. |A=->{CY,A} | | |
1223 | ; | |
1224 | ; | |
1225 | do_op_rra: | |
1226 | ;Rotate Right. All bits move 1 to the right, the lsb | |
1227 | ;becomes c, c becomes msb. | |
1228 | clc ; get z80 carry to avr carry | |
1229 | sbrc z_flags,ZFL_C | |
1230 | sec | |
1231 | do_z80_flags_op_rotate ; (clear ZFL_C, doesn't change AVR_C) | |
1232 | bmov z_flags,ZFL_C, z_a,0 ; Bit 0 --> CY | |
1233 | ror z_a | |
1234 | ret | |
1235 | ||
1236 | ;---------------------------------------------------------------- | |
1237 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1238 | ;---------------------------------------------------------------- | |
1239 | ;|RLA |--0-0*|Rotate Left Acc. |A={CY,A}<- | | |
1240 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1241 | ;|RLA |---- *|Rotate Left Acc. |A={CY,A}<- | | |
1242 | ; | |
1243 | ; | |
1244 | do_op_rla: | |
1245 | ;Rotate Left. All bits move 1 to the left, the msb | |
1246 | ;becomes c, c becomes lsb. | |
1247 | clc | |
1248 | sbrc z_flags,ZFL_C | |
1249 | sec | |
1250 | do_z80_flags_op_rotate ; (clear ZFL_C, doesn't change AVR_C) | |
1251 | bmov z_flags,ZFL_C, z_a,7 ; Bit 7 --> CY | |
1252 | rol z_a | |
1253 | ret | |
1254 | ||
1255 | ;---------------------------------------------------------------- | |
1256 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1257 | ;---------------------------------------------------------------- | |
1258 | ;|ADD A,s |***V0*|Add |A=A+s | | |
1259 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1260 | ;|ADD A,s |***P *|Add |A=A+s | | |
1261 | ; | |
1262 | ; | |
1263 | do_op_adda: | |
1264 | add z_a,opl | |
1265 | in temp,sreg | |
1266 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,P flag | |
1267 | bmov z_flags,ZFL_C, temp,AVR_C | |
1268 | bmov z_flags,ZFL_H, temp,AVR_H | |
1269 | do_z80_flags_V | |
1270 | ret | |
1271 | ||
1272 | ;---------------------------------------------------------------- | |
1273 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1274 | ;---------------------------------------------------------------- | |
1275 | ;|ADC A,s |***V0*|Add with Carry |A=A+s+CY | | |
1276 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1277 | ;|ADC A,s |***P *|Add with Carry |A=A+s+CY | | |
1278 | ; | |
1279 | ; | |
1280 | do_op_adca: | |
1281 | clc | |
1282 | sbrc z_flags,ZFL_C | |
1283 | sec | |
1284 | adc z_a,opl | |
1285 | in temp,sreg | |
1286 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,P | |
1287 | bmov z_flags,ZFL_C, temp,AVR_C | |
1288 | bmov z_flags,ZFL_H, temp,AVR_H | |
1289 | do_z80_flags_V | |
1290 | ret | |
1291 | ||
1292 | ;---------------------------------------------------------------- | |
1293 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1294 | ;---------------------------------------------------------------- | |
1295 | ;|SUB s |***V1*|Subtract |A=A-s | | |
1296 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1297 | ;|SUB s |***P *|Subtract |A=A-s | | |
1298 | ||
1299 | ; | |
1300 | do_op_subfa: | |
1301 | sub z_a,opl | |
1302 | in temp,sreg | |
1303 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,P | |
1304 | bmov z_flags,ZFL_C, temp,AVR_C | |
1305 | bmov z_flags,ZFL_H, temp,AVR_H | |
1306 | do_z80_flags_V | |
1307 | do_z80_flags_set_N | |
1308 | ret | |
1309 | ||
1310 | ;---------------------------------------------------------------- | |
1311 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1312 | ;---------------------------------------------------------------- | |
1313 | ;|CP s |***V1*|Compare |A-s | | |
1314 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1315 | ;|CP s |***P *|Compare |A-s | | |
1316 | ||
1317 | ; | |
1318 | do_op_cpfa: | |
1319 | mov temp2,z_a | |
1320 | sub temp2,opl | |
1321 | in temp,sreg | |
1322 | ldpmx z_flags,sz53p_tab,temp2 ;S,Z,P | |
1323 | bmov z_flags,ZFL_C, temp,AVR_C | |
1324 | bmov z_flags,ZFL_H, temp,AVR_H | |
1325 | do_z80_flags_V | |
1326 | do_z80_flags_set_N | |
1327 | ret | |
1328 | ||
1329 | ;---------------------------------------------------------------- | |
1330 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1331 | ;---------------------------------------------------------------- | |
1332 | ;|SBC A,s |***V1*|Subtract with Carry |A=A-s-CY | | |
1333 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1334 | ;|SBC A,s |***P *|Subtract with Carry |A=A-s-CY | | |
1335 | ; | |
1336 | ; | |
1337 | do_op_sbcfa: | |
1338 | clc | |
1339 | sbrc z_flags,ZFL_C | |
1340 | sec | |
1341 | sbc z_a,opl | |
1342 | in temp,sreg | |
1343 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,P | |
1344 | bmov z_flags,ZFL_C, temp,AVR_C | |
1345 | bmov z_flags,ZFL_H, temp,AVR_H | |
1346 | do_z80_flags_V | |
1347 | do_z80_flags_set_N | |
1348 | ret | |
1349 | ||
1350 | ;---------------------------------------------------------------- | |
1351 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1352 | ;---------------------------------------------------------------- | |
1353 | ;|AND s |**1P00|Logical AND |A=A&s | | |
1354 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1355 | ;|AND s |**-P 0|Logical AND |A=A&s | | |
1356 | ; | |
1357 | ; | |
1358 | do_op_anda: | |
1359 | and z_a,opl ; | |
1360 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,P,N,C | |
1361 | do_z80_flags_op_and | |
1362 | ret | |
1363 | ||
1364 | ||
1365 | ;---------------------------------------------------------------- | |
1366 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1367 | ;---------------------------------------------------------------- | |
1368 | ;|OR s |**0P00|Logical inclusive OR |A=Avs | | |
1369 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1370 | ;|OR s |**-P00|Logical inclusive OR |A=Avs | | |
1371 | ; | |
1372 | ; | |
1373 | do_op_ora: | |
1374 | or z_a,opl | |
1375 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N,C | |
1376 | do_z80_flags_op_or | |
1377 | ret | |
1378 | ||
1379 | ;---------------------------------------------------------------- | |
1380 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1381 | ;---------------------------------------------------------------- | |
1382 | ;|XOR s |**0P00|Logical Exclusive OR |A=Axs | | |
1383 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1384 | ;|XOR s |**-P 0|Logical Exclusive OR |A=Axs | | |
1385 | ; | |
1386 | ; | |
1387 | do_op_xora: | |
e7a0f403 | 1388 | eor z_a,opl |
fa9059af L |
1389 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N,C |
1390 | do_z80_flags_op_or | |
1391 | ret | |
1392 | ||
1393 | ;---------------------------------------------------------------- | |
1394 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1395 | ;---------------------------------------------------------------- | |
80e1fa71 | 1396 | ;|ADD HL,ss |--*-0*|Add |HL=HL+ss | |
fa9059af L |
1397 | ;|----------|SZHP C|---------- 8080 ----------------------------| |
1398 | ;|ADD HL,ss |---- *|Add |HL=HL+ss | | |
1399 | ; | |
1400 | ; | |
1401 | do_op_addhl: | |
825ecc9d L |
1402 | add z_l,opl |
1403 | adc z_h,oph | |
e7a0f403 | 1404 | in temp,sreg |
fa9059af | 1405 | bmov z_flags,ZFL_C, temp,AVR_C |
80e1fa71 | 1406 | do_z80_flags_H |
fa9059af L |
1407 | do_z80_flags_clear_N |
1408 | ret | |
1409 | ||
1410 | ;---------------------------------------------------------------- | |
1411 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1412 | ;---------------------------------------------------------------- | |
1413 | ;|LD dst,src|------|Load |dst=src | | |
1414 | ; | |
1415 | ; | |
1416 | do_op_sthl: ;store hl to mem loc in opl:h | |
e7a0f403 | 1417 | movw xl,opl |
825ecc9d | 1418 | mem_write_s z_l |
e7a0f403 | 1419 | adiw xl,1 |
825ecc9d | 1420 | mem_write_s z_h |
fa9059af L |
1421 | ret |
1422 | ||
1423 | ;---------------------------------------------------------------- | |
1424 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1425 | ;---------------------------------------------------------------- | |
1426 | ;|LD dst,src|------|Load |dst=src | | |
1427 | ; | |
1428 | ; | |
1429 | do_op_rmem16: | |
1430 | movw xl,opl | |
1431 | mem_read_d opl | |
1432 | adiw x,1 | |
1433 | mem_read_d oph | |
1434 | ret | |
1435 | ||
1436 | ;---------------------------------------------------------------- | |
1437 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1438 | ;---------------------------------------------------------------- | |
1439 | ;|LD dst,src|------|Load |dst=src | | |
1440 | ; | |
1441 | ; | |
1442 | do_op_rmem8: | |
1443 | mem_read_ds opl, op | |
1444 | ret | |
1445 | ||
1446 | ;---------------------------------------------------------------- | |
1447 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1448 | ;---------------------------------------------------------------- | |
1449 | ;|DAA |***P-*|Decimal Adjust Acc. | | | |
1450 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
096f3a91 | 1451 | |
fa9059af L |
1452 | |
1453 | ; Description (http://www.z80.info/z80syntx.htm#DAA): | |
1454 | ; This instruction conditionally adjusts the accumulator for BCD addition | |
1455 | ; and subtraction operations. For addition (ADD, ADC, INC) or subtraction | |
1456 | ; (SUB, SBC, DEC, NEC), the following table indicates the operation performed: | |
1457 | ; | |
1458 | ; ------------------------------------------------------------------- | |
1459 | ; | |C Flag |HEX value in|H Flag |HEX val in | Number |C flag | | |
1460 | ; | Oper |Before |upper digit |Before |lower digit| added |After | | |
1461 | ; | |DAA |(bit 7-4) |DAA |(bit 3-0) | to A |DAA | | |
1462 | ; |-------+-------+------------+-------+-----------+--------+-------| | |
1463 | ; | | 0 | 0-9 | 0 | 0-9 | 00 | 0 | | |
1464 | ; | ADD | 0 | 0-8 | 0 | A-F | 06 | 0 | | |
1465 | ; | | 0 | 0-9 | 1 | 0-3 | 06 | 0 | | |
1466 | ; | ADC | 0 | A-F | 0 | 0-9 | 60 | 1 | | |
1467 | ; | | 0 | 9-F | 0 | A-F | 66 | 1 | | |
1468 | ; | INC | 0 | A-F | 1 | 0-3 | 66 | 1 | | |
1469 | ; | | 1 | 0-2 | 0 | 0-9 | 60 | 1 | | |
1470 | ; | | 1 | 0-2 | 0 | A-F | 66 | 1 | | |
1471 | ; | | 1 | 0-3 | 1 | 0-3 | 66 | 1 | | |
1472 | ; |-------+-------+------------+-------+-----------+--------+-------| | |
1473 | ; | SUB | 0 | 0-9 | 0 | 0-9 | 00 | 0 | | |
1474 | ; | SBC | 0 | 0-8 | 1 | 6-F | FA | 0 | | |
1475 | ; | DEC | 1 | 7-F | 0 | 0-9 | A0 | 1 | | |
1476 | ; | NEG | 1 | 6-F | 1 | 6-F | 9A | 1 | | |
1477 | ; ------------------------------------------------------------------- | |
1478 | ; | |
1479 | ; The H flag is affected as follows: | |
1480 | ; | |
1481 | ; --------------------- | |
1482 | ; | N | H | low |H' | | |
1483 | ; | | |nibble | | | |
1484 | ; |---+---+-------+---| | |
1485 | ; | 0 | * | 0-9 | 0 | | |
1486 | ; | 0 | * | a-f | 1 | | |
1487 | ; | 1 | 0 | * | 0 | | |
1488 | ; | 1 | 1 | 6-f | 0 | | |
1489 | ; | 1 | 1 | 0-5 | 1 | | |
1490 | ; --------------------- | |
1491 | ; | |
1492 | ; Ohter flags: | |
1493 | ; N: Unaffected. | |
1494 | ; P/V: Set if Acc. is even parity after operation, reset otherwise. | |
1495 | ; Z: Set if Acc. is Zero after operation, reset otherwise. | |
1496 | ; S: Set if most significant bit of Acc. is 1 after operation, reset otherwise. | |
1497 | ||
fa9059af | 1498 | |
096f3a91 L |
1499 | |
1500 | #if 0 | |
fa9059af L |
1501 | |
1502 | #if EM_Z80 | |
1503 | sbrc z_flags,ZFL_N ;if add-op | |
1504 | rjmp op_da_sub ;then | |
1505 | #endif | |
1506 | ||
096f3a91 | 1507 | do_op_DAA: |
fa9059af | 1508 | op_da_add: |
096f3a91 | 1509 | ldi temp2,0 ; new C, H and N flag |
fa9059af L |
1510 | sbrc z_flags,ZFL_H ; | |
1511 | rjmp op_da_a01 ; if (H flag ... | |
1512 | mov temp,opl ; | | |
1513 | andi temp,0x0f ; | | |
1514 | cpi temp,0x0a ; or (lower nibble >= 0x0A)) | |
1515 | brlo op_da_a10 ; | | |
1516 | op_da_a01: ; then | |
1517 | ldi oph,0x06 ; add 6 to lower nibble | |
1518 | add opl,oph ; | |
1519 | brhc op_da_02 ; if | |
1520 | ori temp2,(1<<ZFL_H) ; set new H flag | |
1521 | op_da_02: ; | |
1522 | brcc op_da_a10 ; if | |
1523 | ori temp2,(1<<ZFL_C) ; set new H flag | |
1524 | op_da_a10: ; endif | |
1525 | sbrc z_flags,ZFL_C ; | | |
1526 | rjmp op_da_a12 ; if (C flag ... | |
1527 | cpi opl,0xA0 ; |... or upper nibble >= 0xA0) | |
1528 | brlo op_da_a13 ; | |
1529 | op_da_a12: ; | |
1530 | ldi oph,0x60 ; add 6 to lower nibble | |
1531 | add opl,oph ; | |
1532 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1533 | op_da_a13: ; | |
1534 | ldpmx z_flags, sz53p_tab, opl ; get S,Z,P flag | |
1535 | or z_flags,temp2 ; merge new C and H flag | |
1536 | ret | |
1537 | ||
1538 | #if EM_Z80 | |
1539 | ||
fb050095 | 1540 | op_da_sub: ;Else (sub-op) |
096f3a91 L |
1541 | ldi temp2,(1<<ZFL_N) ; new C, H and N flag |
1542 | sbrc z_flags,ZFL_H ; | | |
1543 | rjmp op_da_s01 ; if (H flag ... | |
1544 | mov temp,opl ; | | |
1545 | andi temp,0x0f ; | | |
1546 | cpi temp,0x0a ; or (lower nibble >= 0x0A)) | |
1547 | brlo op_da_s10 ; | | |
1548 | op_da_s01: ; then | |
1549 | ldi oph,0x06 ; add 6 to lower nibble | |
1550 | sub opl,oph ; | |
1551 | brhc PC+2 ; if | |
1552 | ori temp2,(1<<ZFL_H) ; set new H flag | |
1553 | brcc op_da_s10 ; if | |
1554 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1555 | op_da_s10: ; endif | |
1556 | sbrc z_flags,ZFL_C ; | | |
1557 | rjmp op_da_s12 ; if (C flag ... | |
1558 | cpi opl,0x90 ; |... or upper nibble >= 0xA0) | |
1559 | brlo op_da_s13 ; | |
1560 | op_da_s12: ; | |
1561 | ldi oph,0x60 ; add 6 to lower nibble | |
1562 | sub opl,oph ; | |
1563 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1564 | op_da_s13: ; | |
1565 | ldpmx z_flags, sz53p_tab, opl ; get S,Z,P flag | |
1566 | or z_flags,temp2 ; merge new C and H flag | |
1567 | ret | |
1568 | ||
fa9059af L |
1569 | #endif |
1570 | ||
1571 | #else | |
1572 | ||
096f3a91 | 1573 | do_op_DAA: |
fa9059af L |
1574 | ldi oph,0 ;oph: what to add |
1575 | ||
096f3a91 | 1576 | #if EM_Z80 |
fa9059af L |
1577 | sbrc z_flags,ZFL_N ;if add-op |
1578 | rjmp op_da_sub ;then | |
096f3a91 L |
1579 | #endif |
1580 | ||
fa9059af | 1581 | op_da_add: |
096f3a91 | 1582 | ldi temp2,0 ; new C, H and N flag |
fa9059af L |
1583 | mov temp,opl ; | |
1584 | andi temp,0x0f ; | | |
1585 | cpi temp,0x0a ; if (lower nibble >= 0x0A) | |
1586 | brlo op_da_a10 ; | | |
1587 | ori oph,0x06 ; add 6 | |
1588 | ori temp2,(1<<ZFL_H) ; set new H flag | |
1589 | ||
1590 | sbrc z_flags,ZFL_C ; | | |
1591 | rjmp op_da_a02 ; if (C flag ... | |
1592 | cpi opl,0x90 ; |... or upper nibble >= 0x90) | |
1593 | brlo op_da_a03 ; | | |
1594 | op_da_a02: | |
1595 | ori oph,0x60 ; add 0x60 | |
1596 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1597 | op_da_a03: ; endif | |
1598 | rjmp op_da_ae | |
1599 | op_da_a10: ; else (lower nibble is 0x09 or lower) | |
1600 | sbrc z_flags,ZFL_C ; | | |
1601 | rjmp op_da_a12 ; if (C flag ... | |
1602 | cpi opl,0xA0 ; |... or upper nibble >= 0xA0) | |
1603 | brlo op_da_a13 ; | |
1604 | op_da_a12: | |
1605 | ori oph,0x60 ; add 0x60 | |
1606 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1607 | op_da_a13: | |
1608 | sbrs z_flags,ZFL_H ; if (H flag) | |
1609 | rjmp op_da_ae ; | | |
1610 | ori oph,0x06 ; add 0x06 | |
1611 | mov temp,opl ; | | |
1612 | andi temp,0x0f ; | | |
096f3a91 | 1613 | cpi temp,0x06 ; if (lower nibble < 0x6) |
fa9059af | 1614 | brsh op_da_ae ; | |
096f3a91 | 1615 | ; ori temp2,(1<<ZFL_H) ; set new H flag |
fa9059af L |
1616 | ; endif |
1617 | ; endif | |
1618 | op_da_ae: | |
1619 | add opl,oph | |
1620 | ldpmx z_flags, sz53p_tab, opl ; get S,Z,P flag | |
1621 | or z_flags,temp2 ; merge new C and H flag | |
1622 | ret | |
1623 | ||
096f3a91 L |
1624 | #if EM_Z80 |
1625 | ||
fb050095 | 1626 | op_da_sub: ;Else (sub-op) |
096f3a91 L |
1627 | ldi temp2,(1<<ZFL_N) ; new C, H and N flag |
1628 | mov temp,opl ; | | |
1629 | andi temp,0x0f ; | | |
1630 | cpi temp,0x0a ; if (lower nibble >= 0x0A) | |
1631 | brlo op_da_s10 ; | | |
1632 | ori oph,0x06 ; sub 6 | |
1633 | ||
1634 | sbrc z_flags,ZFL_C ; | | |
1635 | rjmp op_da_s02 ; if (C flag ... | |
1636 | cpi opl,0x90 ; |... or upper nibble >= 0x90) | |
1637 | brlo op_da_s03 ; | | |
1638 | op_da_s02: | |
1639 | ori oph,0x60 ; sub 0x60 | |
1640 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1641 | op_da_s03: ; endif | |
1642 | rjmp op_da_se | |
1643 | op_da_s10: ; else (lower nibble is 0x09 or lower) | |
1644 | sbrc z_flags,ZFL_C ; | | |
1645 | rjmp op_da_s12 ; if (C flag ... | |
1646 | cpi opl,0xA0 ; |... or upper nibble >= 0xA0) | |
1647 | brlo op_da_s13 ; | |
1648 | op_da_s12: | |
1649 | ori oph,0x60 ; sub 0x60 | |
1650 | ori temp2,(1<<ZFL_C) ; set new C flag | |
1651 | op_da_s13: | |
1652 | sbrs z_flags,ZFL_H ; if (H flag) | |
1653 | rjmp op_da_se ; | | |
1654 | ori oph,0x06 ; sub 0x06 | |
1655 | mov temp,opl ; | | |
1656 | andi temp,0x0f ; | | |
1657 | cpi temp,0x06 ; if (lower nibble < 0x06) | |
1658 | brcc op_da_se ; | | |
1659 | ori temp2,(1<<ZFL_H) ; set new H flag | |
1660 | ; endif | |
1661 | ; endif | |
1662 | op_da_se: | |
1663 | sub opl,oph | |
1664 | ldpmx z_flags, sz53p_tab, opl ; get S,Z,P flag | |
1665 | or z_flags,temp2 ; merge new C and H flag | |
fb050095 | 1666 | ret ;Endif |
096f3a91 L |
1667 | |
1668 | #endif /* EM_Z80 */ | |
1669 | #endif /* alternatives */ | |
fa9059af L |
1670 | |
1671 | ||
1672 | ;---------------------------------------------------------------- | |
1673 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1674 | ;---------------------------------------------------------------- | |
1675 | ;|SCF |--0-01|Set Carry Flag |CY=1 | | |
1676 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1677 | ; | |
1678 | ; | |
1679 | do_op_scf: | |
1680 | do_z80_flags_clear_HN | |
1681 | ori z_flags,(1<<ZFL_C) | |
1682 | ret | |
1683 | ||
1684 | ;---------------------------------------------------------------- | |
1685 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1686 | ;---------------------------------------------------------------- | |
1687 | ;|CCF |--?-0*|Complement Carry Flag|CY=~CY, HC=previous CY| | |
1688 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1689 | ;|CCF |---- 1|Set Carry Flag |CY=1 | | |
1690 | ; | |
1691 | do_op_ccf: | |
1692 | do_z80_flags_clear_N | |
1693 | do_z80_flags_copy_HC | |
1694 | ldi temp,(1<<ZFL_C) | |
1695 | eor z_flags,temp | |
1696 | ret | |
1697 | ||
1698 | ;---------------------------------------------------------------- | |
1699 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1700 | ;---------------------------------------------------------------- | |
1701 | ;|CPL |--1-1-|Complement |A=~A | | |
1702 | ;|----------|SZHP C|---------- 8080 ----------------------------| | |
1703 | ;|CPL |---- -|Complement |A=~A | | |
1704 | ; | |
1705 | ; | |
1706 | do_op_cpl: | |
1707 | com z_a | |
1708 | do_z80_flags_set_HN | |
1709 | ret | |
1710 | ||
1711 | ||
1712 | ;---------------------------------------------------------------- | |
1713 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1714 | ;---------------------------------------------------------------- | |
1715 | ;|PUSH xx |------|Push |-[SP]=xx | | |
1716 | ;|PUSH qq |------|Push |-[SP]=qq | | |
1717 | ; | |
1718 | ; | |
1719 | do_op_push16: | |
1720 | movw xl,z_spl | |
1721 | sbiw x,1 | |
1722 | mem_write_s oph | |
1723 | sbiw x,1 | |
1724 | mem_write_s opl | |
1725 | movw z_spl,xl | |
1726 | ||
1727 | .if STACK_DBG | |
1728 | printnewline | |
1729 | printstring "Stack push " | |
1730 | movw temp,opl | |
1731 | rcall printhexw | |
1732 | printstring ", SP is now " | |
1733 | movw temp,z_spl | |
1734 | rcall printhexw | |
1735 | printstring ". " | |
1736 | .endif | |
1737 | ||
1738 | ret | |
1739 | ||
1740 | ;---------------------------------------------------------------- | |
1741 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1742 | ;---------------------------------------------------------------- | |
1743 | ;|POP xx |------|Pop |xx=[SP]+ | | |
1744 | ;|POP qq |------|Pop |qq=[SP]+ | | |
1745 | ; | |
1746 | ; | |
1747 | do_op_pop16: | |
1748 | movw x,z_spl | |
1749 | mem_read_d opl | |
1750 | adiw x,1 | |
1751 | mem_read_d oph | |
1752 | adiw x,1 | |
1753 | movw z_spl,x | |
1754 | ||
1755 | .if STACK_DBG | |
1756 | printnewline | |
1757 | printstring "Stack pop " | |
1758 | movw temp,opl | |
1759 | rcall printhexw | |
1760 | printstring ", SP is now " | |
1761 | movw temp,z_spl | |
1762 | rcall printhexw | |
1763 | printstring ". " | |
1764 | .endif | |
1765 | ret | |
1766 | ||
1767 | ;---------------------------------------------------------------- | |
1768 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1769 | ;---------------------------------------------------------------- | |
1770 | ;|EX [SP],HL|------|Exchange |[SP]<->HL | | |
1771 | ;|EX DE,HL |------|Exchange |DE<->HL | | |
1772 | ;-----------------------------Z80-------------------------------- | |
1773 | ; | |
1774 | do_op_exhl: | |
825ecc9d L |
1775 | movw temp,z_l |
1776 | movw z_l,opl | |
1777 | movw opl,temp | |
fa9059af L |
1778 | ret |
1779 | ||
1780 | ;---------------------------------------------------------------- | |
1781 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1782 | ;---------------------------------------------------------------- | |
4c92af0d L |
1783 | ;|DI |------|Disable Interrupts |IFF1 = IFF2 = 0 | |
1784 | ;|EI |------|Enable Interrupts |IFF1 = IFF2 = 1 | | |
fa9059af | 1785 | ; |
4c92af0d L |
1786 | |
1787 | do_op_DI: | |
e7a0f403 L |
1788 | #if EM_Z80 |
1789 | ldd temp,y+oz_istat | |
4c92af0d | 1790 | andi temp,~((1<<IFF2) | (1<<IFF1)) |
e7a0f403 L |
1791 | std y+oz_istat,temp |
1792 | #endif | |
fa9059af L |
1793 | ret |
1794 | ||
4c92af0d | 1795 | do_op_EI: |
e7a0f403 L |
1796 | #if EM_Z80 |
1797 | ldd temp,y+oz_istat | |
4c92af0d | 1798 | ori temp,(1<<IFF2) | (1<<IFF1) |
e7a0f403 L |
1799 | std y+oz_istat,temp |
1800 | #endif | |
fa9059af L |
1801 | ret |
1802 | ||
1803 | ;---------------------------------------------------------------- | |
1804 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1805 | ;---------------------------------------------------------------- | |
1806 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1807 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1808 | ;|RET cc |------|Conditional Return |If cc RET | | |
1809 | ; | |
1810 | ; | |
1811 | do_op_ifnz: | |
1812 | sbrs z_flags, ZFL_Z | |
1813 | ret | |
1814 | pop temp ; nix tun | |
4c92af0d | 1815 | pop temp ; direkt zurueck zu main |
fa9059af L |
1816 | ret |
1817 | ||
1818 | ;---------------------------------------------------------------- | |
1819 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1820 | ;---------------------------------------------------------------- | |
1821 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1822 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1823 | ;|RET cc |------|Conditional Return |If cc RET | | |
1824 | ; | |
1825 | ; | |
1826 | do_op_ifz: | |
1827 | sbrc z_flags, ZFL_Z | |
1828 | ret | |
1829 | pop temp ; nix tun | |
4c92af0d | 1830 | pop temp ; direkt zurueck zu main |
fa9059af L |
1831 | ret |
1832 | ||
1833 | ;---------------------------------------------------------------- | |
1834 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1835 | ;---------------------------------------------------------------- | |
1836 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1837 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1838 | ;|RET cc |------|Conditional Return |If cc RET | | |
1839 | ; | |
1840 | ; | |
1841 | do_op_ifnc: | |
1842 | sbrs z_flags, ZFL_C | |
1843 | ret | |
1844 | pop temp ; nix tun | |
1845 | pop temp ; direkt zuruech zu main | |
1846 | ret | |
1847 | ||
1848 | ;---------------------------------------------------------------- | |
1849 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1850 | ;---------------------------------------------------------------- | |
1851 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1852 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1853 | ;|RET cc |------|Conditional Return |If cc RET | | |
1854 | ; | |
1855 | ; | |
1856 | do_op_ifc: | |
1857 | sbrc z_flags, ZFL_C | |
1858 | ret | |
1859 | pop temp ; nix tun | |
1860 | pop temp ; direkt zuruech zu main | |
1861 | ret | |
1862 | ||
1863 | ;---------------------------------------------------------------- | |
1864 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1865 | ;---------------------------------------------------------------- | |
1866 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1867 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1868 | ;|RET cc |------|Conditional Return |If cc RET | | |
1869 | ; | |
1870 | ; | |
1871 | do_op_ifpo: | |
1872 | sbrs z_flags, ZFL_P | |
1873 | ret | |
1874 | pop temp ; nix tun | |
1875 | pop temp ; direkt zuruech zu main | |
1876 | ret | |
1877 | ||
1878 | ;---------------------------------------------------------------- | |
1879 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1880 | ;---------------------------------------------------------------- | |
1881 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1882 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1883 | ;|RET cc |------|Conditional Return |If cc RET | | |
1884 | ; | |
1885 | ; | |
1886 | do_op_ifpe: | |
1887 | sbrc z_flags, ZFL_P | |
1888 | ret | |
1889 | pop temp ; nix tun | |
1890 | pop temp ; direkt zuruech zu main | |
1891 | ret | |
1892 | ||
1893 | ;---------------------------------------------------------------- | |
1894 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1895 | ;---------------------------------------------------------------- | |
1896 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1897 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1898 | ;|RET cc |------|Conditional Return |If cc RET | | |
1899 | ; | |
1900 | ; | |
1901 | do_op_ifp: ;sign positive, aka s=0 | |
1902 | sbrs z_flags, ZFL_S | |
1903 | ret | |
1904 | pop temp ; nix tun | |
1905 | pop temp ; direkt zuruech zu main | |
1906 | ret | |
1907 | ||
1908 | ;---------------------------------------------------------------- | |
1909 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1910 | ;---------------------------------------------------------------- | |
1911 | ;|CALL cc,nn|------|Conditional Call |If cc CALL | | |
1912 | ;|JP cc,nn |------|Conditional Jump |If cc JP | | |
1913 | ;|RET cc |------|Conditional Return |If cc RET | | |
1914 | ; | |
1915 | ; | |
1916 | do_op_ifm: ;sign negative, aka s=1 | |
1917 | sbrc z_flags, ZFL_S | |
1918 | ret | |
1919 | pop temp ; nix tun | |
1920 | pop temp ; direkt zuruech zu main | |
1921 | ret | |
1922 | ||
80e1fa71 | 1923 | ;---------------------------------------------------------------- |
fa9059af | 1924 | |
80e1fa71 L |
1925 | #if EM_Z80 |
1926 | ||
1927 | ;---------------------------------------------------------------- | |
1928 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1929 | ;---------------------------------------------------------------- | |
1930 | ;|DJNZ e |------|Dec., Jump Non-Zero |B=B-1 till B=0 | | |
1931 | ; | |
096f3a91 L |
1932 | ;The b register is decremented, and if not zero, the signed value e is added to pc. |
1933 | ;The jump is measured from the start of the instruction opcode. | |
1934 | ;e = Relative addressing (PC=PC+2+offset) | |
1935 | ||
1936 | #if 1 | |
1937 | ||
1938 | ; (Joe G.) | |
1939 | do_op_DJNZ: ; decremt B, jump B=0 | |
825ecc9d | 1940 | dec z_b ; B decrementieren |
096f3a91 L |
1941 | breq do_op_DJNZ_Z ; bei B=0 |
1942 | subi opl, 0x80 ; z_pc + e im Zweierkomplement | |
1943 | subi z_pcl,0x80 | |
1944 | sbc z_pch,_0 | |
1945 | add z_pcl,opl | |
1946 | adc z_pch,_0 | |
1947 | do_op_DJNZ_Z: | |
1948 | ret | |
1949 | ||
1950 | #else | |
80e1fa71 L |
1951 | |
1952 | do_op_djnz: | |
825ecc9d | 1953 | dec z_b |
80e1fa71 L |
1954 | brne opdjnze |
1955 | pop temp ; nix tun | |
096f3a91 | 1956 | pop temp ; direkt zurueck zu main |
80e1fa71 L |
1957 | opdjnze: |
1958 | ret | |
1959 | ||
096f3a91 | 1960 | #endif |
80e1fa71 L |
1961 | |
1962 | ;---------------------------------------------------------------- | |
1963 | ;|Mnemonic |SZHPNC|Description |Notes | | |
1964 | ;---------------------------------------------------------------- | |
1965 | ;|EX AF,AF' |------|Exchange |AF<->AF' | | |
1966 | ||
1967 | do_op_EXAF: | |
e7a0f403 L |
1968 | ldd temp,y+oz_f2 |
1969 | ldd temp2,y+oz_a2 | |
1970 | std y+oz_f2,z_flags | |
1971 | std y+oz_a2,z_a | |
80e1fa71 L |
1972 | mov z_flags,temp |
1973 | mov z_a,temp2 | |
1974 | ret | |
1975 | ||
1976 | ||
1977 | ;---------------------------------------------------------------- | |
1978 | ;|Mnemonic |SZHPNC|Description |Notes | | |
fa9059af | 1979 | ;---------------------------------------------------------------- |
80e1fa71 L |
1980 | ;|EXX |------|Exchange |qq<->qq' (except AF)| |
1981 | ||
1982 | ||
825ecc9d L |
1983 | #if 1 |
1984 | ||
1985 | do_op_EXX: | |
1986 | ldd temp ,y+oz_c2 | |
1987 | ldd temp2,y+oz_b2 | |
1988 | std y+oz_c2,z_c | |
1989 | std y+oz_b2,z_b | |
1990 | movw z_c,temp | |
1991 | ||
1992 | ldd temp ,y+oz_e2 | |
1993 | ldd temp2,y+oz_d2 | |
1994 | std y+oz_e2,z_e | |
1995 | std y+oz_d2,z_d | |
1996 | movw z_e,temp | |
1997 | ||
1998 | ldd temp ,y+oz_l2 | |
1999 | ldd temp2,y+oz_h2 | |
2000 | std y+oz_l2,z_l | |
2001 | std y+oz_h2,z_h | |
2002 | movw z_l,temp | |
2003 | ret | |
2004 | #else | |
2005 | ||
80e1fa71 L |
2006 | do_op_EXX: |
2007 | ldiw z,z_b | |
2008 | ldi temp3,6 | |
2009 | opexx_loop: | |
2010 | ld temp,z | |
2011 | ldd temp2,z+r2ofs | |
2012 | std z+r2ofs,temp | |
2013 | st z+,temp2 | |
2014 | dec temp3 | |
2015 | brne opexx_loop | |
2016 | ret | |
2017 | ||
825ecc9d L |
2018 | #endif |
2019 | ||
80e1fa71 L |
2020 | #else |
2021 | do_op_djnz: | |
2022 | do_op_EXAF: | |
2023 | do_op_EXX: | |
096f3a91 | 2024 | ljmp do_op_inv |
80e1fa71 L |
2025 | ret |
2026 | #endif | |
fa9059af L |
2027 | |
2028 | #if EM_Z80 | |
2029 | ||
2030 | do_op_prefixED: | |
2031 | mem_read_ds zl,z_pc ;zl = memReadByte(z_pc) | |
2032 | adiw z_pcl,1 ;++z_pc | |
2033 | ldi zh,high(EDjmp) ; | |
623dd899 | 2034 | ;;; ldi zh,high(0) ; |
fa9059af L |
2035 | ijmp |
2036 | ||
2037 | ||
2038 | do_op_prefixDD: | |
80e1fa71 | 2039 | cbi flags,prefixfd |
fa9059af L |
2040 | mem_read_ds zl,z_pc ;zl = memReadByte(z_pc) |
2041 | adiw z_pcl,1 ;++z_pc | |
2042 | ldi zh,high(DDFDjmp) ; | |
2043 | ijmp | |
2044 | ||
2045 | ||
2046 | do_op_prefixFD: | |
80e1fa71 | 2047 | sbi flags,prefixfd |
fa9059af L |
2048 | mem_read_ds zl,z_pc ;zl = memReadByte(z_pc) |
2049 | adiw z_pcl,1 ;++z_pc | |
2050 | ldi zh,high(DDFDjmp) ; | |
2051 | ijmp | |
2052 | ||
80e1fa71 L |
2053 | do_op_prefixCB: |
2054 | mem_read_ds zl,z_pc ;zl = memReadByte(z_pc) | |
2055 | adiw z_pcl,1 ;++z_pc | |
2056 | ldi zh,high(CBjmp) ; | |
2057 | ijmp | |
2058 | ||
2059 | ||
2060 | do_op_prefixDDFDCB: | |
e7a0f403 L |
2061 | sbic flags,prefixfd |
2062 | rjmp opprxcb_fd | |
2063 | ldd xh,y+oz_xh | |
2064 | ldd xl,y+oz_xl | |
2065 | rjmp opprxcb_1 | |
2066 | opprxcb_fd: | |
2067 | ldd xh,y+oz_yh | |
2068 | ldd xl,y+oz_yl | |
2069 | opprxcb_1: | |
2070 | mem_read_s z_pc ;get displacement | |
2071 | adiw z_pcl,1 ;++z_pc | |
2072 | clr temp2 ;sign extend | |
2073 | tst temp | |
2074 | brpl PC+2 | |
2075 | com temp2 | |
2076 | add xl,temp ;add displacement | |
2077 | adc xh,temp2 | |
2078 | mem_read_d opl | |
2079 | ||
80e1fa71 L |
2080 | mem_read_ds zl,z_pc ;zl = opcode |
2081 | adiw z_pcl,1 ;++z_pc | |
e7a0f403 L |
2082 | ldi zh,high(DDFDCBjmp) ; |
2083 | icall | |
2084 | mem_write_s opl | |
2085 | ret | |
80e1fa71 L |
2086 | |
2087 | ||
fa9059af L |
2088 | #else ; TODO: geht das so? |
2089 | ||
2090 | do_op_prefixED: | |
2091 | do_op_prefixDD: | |
2092 | do_op_prefixFD: | |
80e1fa71 | 2093 | do_op_prefixCB: |
096f3a91 | 2094 | ljmp do_op_inv |
fa9059af L |
2095 | ret |
2096 | #endif | |
2097 | ||
2098 | ||
623dd899 | 2099 | |
fa9059af L |
2100 | ; ----------------------- Opcode decoding ------------------------- |
2101 | ||
2102 | ; Lookup table for Z80 opcodes. Translates the first byte of the instruction word into three | |
2103 | ; operations: fetch, do something, store. | |
2104 | ; The table is made of 256 words. | |
2105 | ||
623dd899 | 2106 | opctable opcjmp, PC ;+3*256 |
fa9059af L |
2107 | |
2108 | instr fetch_nop, op_nop, store_nop ;00 ;NOP | |
2109 | instr fetch_DIR16, op_nop, store_BC ;01 nn nn ;LD BC,nn | |
2110 | instr fetch_nop, op_nop, store_MBC ;02 ;LD (BC),A | |
825ecc9d L |
2111 | ;instr fetch_BC, op_INC16, store_BC ;03 ;INC BC |
2112 | instr fetch_nop, op_INCBC, store_nop ;03 ;INC BC | |
fa9059af | 2113 | instr fetch_B, op_INC, store_B ;04 ;INC B |
623dd899 | 2114 | instr fetch_B, op_DEC, store_B ;05 ;DEC B |
fa9059af L |
2115 | instr fetch_DIR8, op_nop, store_B ;06 ;LD B,n |
2116 | instr fetch_nop, op_RLCA, store_nop ;07 ;RLCA | |
623dd899 | 2117 | instr fetch_nop, op_EXAF, store_nop ;08 ;EX AF,AF' |
80e1fa71 | 2118 | instr fetch_BC, op_ADDHL, store_nop ;09 ;ADD HL,BC |
fa9059af | 2119 | instr fetch_MBC, op_nop, store_nop ;0A ;LD A,(BC) |
825ecc9d L |
2120 | ;instr fetch_BC, op_DEC16, store_BC ;0B ;DEC BC |
2121 | instr fetch_nop, op_DECBC, store_nop ;0B ;DEC BC | |
fa9059af L |
2122 | instr fetch_C, op_INC, store_C ;0C ;INC C |
2123 | instr fetch_C, op_DEC, store_C ;0D ;DEC C | |
2124 | instr fetch_DIR8, op_nop, store_C ;0E nn ;LD C,n | |
2125 | instr fetch_nop, op_RRCA, store_nop ;0F ;RRCA | |
096f3a91 | 2126 | instr fetch_DIR8, op_DJNZ, store_nop ;10 oo ;DJNZ o |
fa9059af L |
2127 | instr fetch_DIR16, op_nop, store_DE ;11 nn nn ;LD DE,nn |
2128 | instr fetch_nop, op_nop, store_MDE ;12 ;LD (DE),A | |
825ecc9d L |
2129 | ;instr fetch_DE, op_INC16, store_DE ;13 ;INC DE |
2130 | instr fetch_nop, op_INCDE, store_nop ;13 ;INC DE | |
fa9059af | 2131 | instr fetch_D, op_INC, store_D ;14 ;INC D |
623dd899 | 2132 | instr fetch_D, op_DEC, store_D ;15 ;DEC D |
fa9059af L |
2133 | instr fetch_DIR8, op_nop, store_D ;16 nn ;LD D,n |
2134 | instr fetch_nop, op_RLA, store_nop ;17 ;RLA | |
80e1fa71 L |
2135 | instr fetch_DIR8, op_nop, store_pcrel ;18 oo ;JR o |
2136 | instr fetch_DE, op_ADDHL, store_nop ;19 ;ADD HL,DE | |
fa9059af | 2137 | instr fetch_MDE, op_nop, store_nop ;1A ;LD A,(DE) |
825ecc9d L |
2138 | ;instr fetch_DE, op_DEC16, store_DE ;1B ;DEC DE |
2139 | instr fetch_nop, op_DECDE, store_nop ;1B ;DEC DE | |
fa9059af | 2140 | instr fetch_E, op_INC, store_E ;1C ;INC E |
623dd899 | 2141 | instr fetch_E, op_DEC, store_E ;1D ;DEC E |
fa9059af L |
2142 | instr fetch_DIR8, op_nop, store_E ;1E nn ;LD E,n |
2143 | instr fetch_nop, op_RRA, store_nop ;1F ;RRA | |
80e1fa71 | 2144 | instr fetch_DIR8, op_IFNZ, store_pcrel ;20 oo ;JR NZ,o |
fa9059af L |
2145 | instr fetch_DIR16, op_nop, store_HL ;21 nn nn ;LD HL,nn |
2146 | instr fetch_DIR16, op_STHL, store_nop ;22 nn nn ;LD (nn),HL | |
825ecc9d L |
2147 | ;instr fetch_HL, op_INC16, store_HL ;23 ;INC HL |
2148 | instr fetch_nop, op_INCHL, store_nop ;23 ;INC HL | |
623dd899 L |
2149 | instr fetch_H, op_INC, store_H ;24 ;INC H |
2150 | instr fetch_H, op_DEC, store_H ;25 ;DEC H | |
2151 | instr fetch_DIR8, op_nop, store_H ;26 nn ;LD H,n | |
2152 | instr fetch_A, op_DAA, store_A ;27 ;DAA | |
80e1fa71 L |
2153 | instr fetch_DIR8, op_IFZ, store_pcrel ;28 oo ;JR Z,o |
2154 | instr fetch_HL, op_ADDHL, store_nop ;29 ;ADD HL,HL | |
fa9059af | 2155 | instr fetch_DIR16, op_RMEM16, store_HL ;2A nn nn ;LD HL,(nn) |
825ecc9d L |
2156 | ;instr fetch_HL, op_DEC16, store_HL ;2B ;DEC HL |
2157 | instr fetch_nop, op_DECHL, store_nop ;2B ;DEC HL | |
623dd899 L |
2158 | instr fetch_L, op_INC, store_L ;2C ;INC L |
2159 | instr fetch_L, op_DEC, store_L ;2D ;DEC L | |
2160 | instr fetch_DIR8, op_nop, store_L ;2E nn ;LD L,n | |
2161 | instr fetch_nop, op_CPL, store_nop ;2F ;CPL | |
80e1fa71 | 2162 | instr fetch_DIR8, op_IFNC, store_pcrel ;30 oo ;JR NC,o |
fa9059af L |
2163 | instr fetch_DIR16, op_nop, store_SP ;31 nn nn ;LD SP,nn |
2164 | instr fetch_DIR16, op_nop, store_AM ;32 nn nn ;LD (nn),A | |
2165 | instr fetch_SP, op_INC16, store_SP ;33 ;INC SP | |
2166 | instr fetch_MHL, op_INC, store_MHL ;34 ;INC (HL) | |
623dd899 | 2167 | instr fetch_MHL, op_DEC, store_MHL ;35 ;DEC (HL) |
fa9059af L |
2168 | instr fetch_DIR8, op_nop, store_MHL ;36 nn ;LD (HL),n |
2169 | instr fetch_nop, op_SCF, store_nop ;37 ;SCF | |
80e1fa71 L |
2170 | instr fetch_DIR8, op_IFC, store_pcrel ;38 oo ;JR C,o |
2171 | instr fetch_SP, op_ADDHL, store_nop ;39 ;ADD HL,SP | |
623dd899 L |
2172 | instr fetch_DIR16, op_RMEM8, store_A ;3A nn nn ;LD A,(nn) |
2173 | instr fetch_SP, op_DEC16, store_SP ;3B ;DEC SP | |
fa9059af | 2174 | instr fetch_nop, op_INCA, store_nop ;3C ;INC A |
623dd899 L |
2175 | instr fetch_nop, op_DECA, store_nop ;3D ;DEC A |
2176 | instr fetch_DIR8, op_nop, store_A ;3E nn ;LD A,n | |
2177 | instr fetch_nop, op_CCF, store_nop ;3F ;CCF (Complement Carry Flag, gvd) | |
fa9059af L |
2178 | instr fetch_nop, op_nop, store_nop ;40 ;LD B,B |
2179 | instr fetch_C, op_nop, store_B ;41 ;LD B,C | |
2180 | instr fetch_D, op_nop, store_B ;42 ;LD B,D | |
2181 | instr fetch_E, op_nop, store_B ;43 ;LD B,E | |
2182 | instr fetch_H, op_nop, store_B ;44 ;LD B,H | |
2183 | instr fetch_L, op_nop, store_B ;45 ;LD B,L | |
2184 | instr fetch_MHL, op_nop, store_B ;46 ;LD B,(HL) | |
2185 | instr fetch_A, op_nop, store_B ;47 ;LD B,A | |
2186 | instr fetch_B, op_nop, store_C ;48 ;LD C,B | |
2187 | instr fetch_nop, op_nop, store_nop ;49 ;LD C,C | |
2188 | instr fetch_D, op_nop, store_C ;4A ;LD C,D | |
2189 | instr fetch_E, op_nop, store_C ;4B ;LD C,E | |
2190 | instr fetch_H, op_nop, store_C ;4C ;LD C,H | |
2191 | instr fetch_L, op_nop, store_C ;4D ;LD C,L | |
2192 | instr fetch_MHL, op_nop, store_C ;4E ;LD C,(HL) | |
2193 | instr fetch_A, op_nop, store_C ;4F ;LD C,A | |
2194 | instr fetch_B, op_nop, store_D ;50 ;LD D,B | |
2195 | instr fetch_C, op_nop, store_D ;51 ;LD D,C | |
2196 | instr fetch_nop, op_nop, store_nop ;52 ;LD D,D | |
2197 | instr fetch_E, op_nop, store_D ;53 ;LD D,E | |
2198 | instr fetch_H, op_nop, store_D ;54 ;LD D,H | |
2199 | instr fetch_L, op_nop, store_D ;55 ;LD D,L | |
2200 | instr fetch_MHL, op_nop, store_D ;56 ;LD D,(HL) | |
2201 | instr fetch_A, op_nop, store_D ;57 ;LD D,A | |
2202 | instr fetch_B, op_nop, store_E ;58 ;LD E,B | |
2203 | instr fetch_C, op_nop, store_E ;59 ;LD E,C | |
2204 | instr fetch_D, op_nop, store_E ;5A ;LD E,D | |
2205 | instr fetch_nop, op_nop, store_nop ;5B ;LD E,E | |
2206 | instr fetch_H, op_nop, store_E ;5C ;LD E,H | |
2207 | instr fetch_L, op_nop, store_E ;5D ;LD E,L | |
2208 | instr fetch_MHL, op_nop, store_E ;5E ;LD E,(HL) | |
2209 | instr fetch_A, op_nop, store_E ;5F ;LD E,A | |
2210 | instr fetch_B, op_nop, store_H ;60 ;LD H,B | |
2211 | instr fetch_C, op_nop, store_H ;61 ;LD H,C | |
2212 | instr fetch_D, op_nop, store_H ;62 ;LD H,D | |
2213 | instr fetch_E, op_nop, store_H ;63 ;LD H,E | |
2214 | instr fetch_nop, op_nop, store_nop ;64 ;LD H,H | |
2215 | instr fetch_L, op_nop, store_H ;65 ;LD H,L | |
2216 | instr fetch_MHL, op_nop, store_H ;66 ;LD H,(HL) | |
2217 | instr fetch_A, op_nop, store_H ;67 ;LD H,A | |
2218 | instr fetch_B, op_nop, store_L ;68 ;LD L,B | |
2219 | instr fetch_C, op_nop, store_L ;69 ;LD L,C | |
2220 | instr fetch_D, op_nop, store_L ;6A ;LD L,D | |
2221 | instr fetch_E, op_nop, store_L ;6B ;LD L,E | |
2222 | instr fetch_H, op_nop, store_L ;6C ;LD L,H | |
2223 | instr fetch_nop, op_nop, store_nop ;6D ;LD L,L | |
2224 | instr fetch_MHL, op_nop, store_L ;6E ;LD L,(HL) | |
2225 | instr fetch_A, op_nop, store_L ;6F ;LD L,A | |
2226 | instr fetch_B, op_nop, store_MHL ;70 ;LD (HL),B | |
2227 | instr fetch_C, op_nop, store_MHL ;71 ;LD (HL),C | |
2228 | instr fetch_D, op_nop, store_MHL ;72 ;LD (HL),D | |
2229 | instr fetch_E, op_nop, store_MHL ;73 ;LD (HL),E | |
2230 | instr fetch_H, op_nop, store_MHL ;74 ;LD (HL),H | |
2231 | instr fetch_L, op_nop, store_MHL ;75 ;LD (HL),L | |
80e1fa71 | 2232 | instr fetch_nop, op_HALT, store_nop ;76 ;HALT |
fa9059af L |
2233 | instr fetch_A, op_nop, store_MHL ;77 ;LD (HL),A |
2234 | instr fetch_B, op_nop, store_A ;78 ;LD A,B | |
2235 | instr fetch_C, op_nop, store_A ;79 ;LD A,C | |
2236 | instr fetch_D, op_nop, store_A ;7A ;LD A,D | |
2237 | instr fetch_E, op_nop, store_A ;7B ;LD A,E | |
2238 | instr fetch_H, op_nop, store_A ;7C ;LD A,H | |
2239 | instr fetch_L, op_nop, store_A ;7D ;LD A,L | |
2240 | instr fetch_MHL, op_nop, store_A ;7E ;LD A,(HL) | |
2241 | instr fetch_nop, op_nop, store_nop ;7F ;LD A,A | |
2242 | instr fetch_B, op_ADDA, store_nop ;80 ;ADD A,B | |
2243 | instr fetch_C, op_ADDA, store_nop ;81 ;ADD A,C | |
2244 | instr fetch_D, op_ADDA, store_nop ;82 ;ADD A,D | |
2245 | instr fetch_E, op_ADDA, store_nop ;83 ;ADD A,E | |
2246 | instr fetch_H, op_ADDA, store_nop ;84 ;ADD A,H | |
2247 | instr fetch_L, op_ADDA, store_nop ;85 ;ADD A,L | |
2248 | instr fetch_MHL, op_ADDA, store_nop ;86 ;ADD A,(HL) | |
2249 | instr fetch_A, op_ADDA, store_nop ;87 ;ADD A,A | |
2250 | instr fetch_B, op_ADCA, store_nop ;88 ;ADC A,B | |
2251 | instr fetch_C, op_ADCA, store_nop ;89 ;ADC A,C | |
2252 | instr fetch_D, op_ADCA, store_nop ;8A ;ADC A,D | |
2253 | instr fetch_E, op_ADCA, store_nop ;8B ;ADC A,E | |
2254 | instr fetch_H, op_ADCA, store_nop ;8C ;ADC A,H | |
2255 | instr fetch_L, op_ADCA, store_nop ;8D ;ADC A,L | |
2256 | instr fetch_MHL, op_ADCA, store_nop ;8E ;ADC A,(HL) | |
2257 | instr fetch_A, op_ADCA, store_nop ;8F ;ADC A,A | |
2258 | instr fetch_B, op_SUBFA, store_nop ;90 ;SUB A,B | |
2259 | instr fetch_C, op_SUBFA, store_nop ;91 ;SUB A,C | |
2260 | instr fetch_D, op_SUBFA, store_nop ;92 ;SUB A,D | |
2261 | instr fetch_E, op_SUBFA, store_nop ;93 ;SUB A,E | |
2262 | instr fetch_H, op_SUBFA, store_nop ;94 ;SUB A,H | |
2263 | instr fetch_L, op_SUBFA, store_nop ;95 ;SUB A,L | |
2264 | instr fetch_MHL, op_SUBFA, store_nop ;96 ;SUB A,(HL) | |
2265 | instr fetch_A, op_SUBFA, store_nop ;97 ;SUB A,A | |
2266 | instr fetch_B, op_SBCFA, store_nop ;98 ;SBC A,B | |
2267 | instr fetch_C, op_SBCFA, store_nop ;99 ;SBC A,C | |
2268 | instr fetch_D, op_SBCFA, store_nop ;9A ;SBC A,D | |
2269 | instr fetch_E, op_SBCFA, store_nop ;9B ;SBC A,E | |
2270 | instr fetch_H, op_SBCFA, store_nop ;9C ;SBC A,H | |
2271 | instr fetch_L, op_SBCFA, store_nop ;9D ;SBC A,L | |
2272 | instr fetch_MHL, op_SBCFA, store_nop ;9E ;SBC A,(HL) | |
2273 | instr fetch_A, op_SBCFA, store_nop ;9F ;SBC A,A | |
2274 | instr fetch_B, op_ANDA, store_nop ;A0 ;AND A,B | |
2275 | instr fetch_C, op_ANDA, store_nop ;A1 ;AND A,C | |
2276 | instr fetch_D, op_ANDA, store_nop ;A2 ;AND A,D | |
2277 | instr fetch_E, op_ANDA, store_nop ;A3 ;AND A,E | |
2278 | instr fetch_H, op_ANDA, store_nop ;A4 ;AND A,H | |
2279 | instr fetch_L, op_ANDA, store_nop ;A5 ;AND A,L | |
2280 | instr fetch_MHL, op_ANDA, store_nop ;A6 ;AND A,(HL) | |
2281 | instr fetch_A, op_ANDA, store_nop ;A7 ;AND A,A | |
2282 | instr fetch_B, op_XORA, store_nop ;A8 ;XOR A,B | |
2283 | instr fetch_C, op_XORA, store_nop ;A9 ;XOR A,C | |
2284 | instr fetch_D, op_XORA, store_nop ;AA ;XOR A,D | |
2285 | instr fetch_E, op_XORA, store_nop ;AB ;XOR A,E | |
2286 | instr fetch_H, op_XORA, store_nop ;AC ;XOR A,H | |
2287 | instr fetch_L, op_XORA, store_nop ;AD ;XOR A,L | |
2288 | instr fetch_MHL, op_XORA, store_nop ;AE ;XOR A,(HL) | |
2289 | instr fetch_A, op_XORA, store_nop ;AF ;XOR A,A | |
2290 | instr fetch_B, op_ORA, store_nop ;B0 ;OR A,B | |
2291 | instr fetch_C, op_ORA, store_nop ;B1 ;OR A,C | |
2292 | instr fetch_D, op_ORA, store_nop ;B2 ;OR A,D | |
2293 | instr fetch_E, op_ORA, store_nop ;B3 ;OR A,E | |
2294 | instr fetch_H, op_ORA, store_nop ;B4 ;OR A,H | |
2295 | instr fetch_L, op_ORA, store_nop ;B5 ;OR A,L | |
2296 | instr fetch_MHL, op_ORA, store_nop ;B6 ;OR A,(HL) | |
2297 | instr fetch_A, op_ORA, store_nop ;B7 ;OR A,A | |
623dd899 L |
2298 | instr fetch_B, op_CPFA, store_nop ;B8 ;CP A,B |
2299 | instr fetch_C, op_CPFA, store_nop ;B9 ;CP A,C | |
2300 | instr fetch_D, op_CPFA, store_nop ;BA ;CP A,D | |
2301 | instr fetch_E, op_CPFA, store_nop ;BB ;CP A,E | |
2302 | instr fetch_H, op_CPFA, store_nop ;BC ;CP A,H | |
2303 | instr fetch_L, op_CPFA, store_nop ;BD ;CP A,L | |
2304 | instr fetch_MHL, op_CPFA, store_nop ;BE ;CP A,(HL) | |
2305 | instr fetch_A, op_CPFA, store_nop ;BF ;CP A,A | |
fa9059af L |
2306 | instr fetch_nop, op_IFNZ, store_RET ;C0 ;RET NZ |
2307 | instr fetch_nop, op_POP16, store_BC ;C1 ;POP BC | |
2308 | instr fetch_DIR16, op_IFNZ, store_PC ;C2 nn nn ;JP NZ,nn | |
2309 | instr fetch_DIR16, op_nop, store_PC ;C3 nn nn ;JP nn | |
2310 | instr fetch_DIR16, op_IFNZ, store_CALL ;C4 nn nn ;CALL NZ,nn | |
2311 | instr fetch_BC, op_PUSH16, store_nop ;C5 ;PUSH BC | |
2312 | instr fetch_DIR8, op_ADDA, store_nop ;C6 nn ;ADD A,n | |
2313 | instr fetch_RST, op_nop, store_CALL ;C7 ;RST 0 | |
2314 | instr fetch_nop, op_IFZ, store_RET ;C8 ;RET Z | |
2315 | instr fetch_nop, op_nop, store_RET ;C9 ;RET | |
2316 | instr fetch_DIR16, op_IFZ, store_PC ;CA nn nn ;JP Z,nn | |
80e1fa71 | 2317 | instr fetch_nop, op_prefixCB, store_nop ;CB ;(CB opcode prefix) |
fa9059af L |
2318 | instr fetch_DIR16, op_IFZ, store_CALL ;CC nn nn ;CALL Z,nn |
2319 | instr fetch_DIR16, op_nop, store_CALL ;CD nn nn ;CALL nn | |
2320 | instr fetch_DIR8, op_ADCA, store_nop ;CE nn ;ADC A,n | |
2321 | instr fetch_RST, op_nop, store_CALL ;CF ;RST 8H | |
2322 | instr fetch_nop, op_IFNC, store_RET ;D0 ;RET NC | |
2323 | instr fetch_nop, op_POP16, store_DE ;D1 ;POP DE | |
2324 | instr fetch_DIR16, op_IFNC, store_PC ;D2 nn nn ;JP NC,nn | |
2325 | instr fetch_DIR8, op_OUTA, store_nop ;D3 nn ;OUT (n),A | |
2326 | instr fetch_DIR16, op_IFNC, store_CALL ;D4 nn nn ;CALL NC,nn | |
2327 | instr fetch_DE, op_PUSH16, store_nop ;D5 ;PUSH DE | |
2328 | instr fetch_DIR8, op_SUBFA, store_nop ;D6 nn ;SUB n | |
2329 | instr fetch_RST, op_nop, store_CALL ;D7 ;RST 10H | |
2330 | instr fetch_nop, op_IFC, store_RET ;D8 ;RET C | |
623dd899 | 2331 | instr fetch_nop, op_EXX, store_nop ;D9 ;EXX |
fa9059af | 2332 | instr fetch_DIR16, op_IFC, store_PC ;DA nn nn ;JP C,nn |
80e1fa71 | 2333 | instr fetch_DIR8, op_INA, store_nop ;DB nn ;IN A,(n) |
fa9059af | 2334 | instr fetch_DIR16, op_IFC, store_CALL ;DC nn nn ;CALL C,nn |
e7a0f403 | 2335 | instr fetch_nop, op_prefixDD, store_nop ;DD ;(DD opcode prefix) |
fa9059af L |
2336 | instr fetch_DIR8, op_SBCFA, store_nop ;DE nn ;SBC A,n |
2337 | instr fetch_RST, op_nop, store_CALL ;DF ;RST 18H | |
2338 | instr fetch_nop, op_IFPO, store_RET ;E0 ;RET PO | |
2339 | instr fetch_nop, op_POP16, store_HL ;E1 ;POP HL | |
2340 | instr fetch_DIR16, op_IFPO, store_PC ;E2 nn nn ;JP PO,nn | |
623dd899 | 2341 | instr fetch_MSP, op_EXHL, store_MSP ;E3 ;EX (SP),HL |
fa9059af L |
2342 | instr fetch_DIR16, op_IFPO, store_CALL ;E4 nn nn ;CALL PO,nn |
2343 | instr fetch_HL, op_PUSH16, store_nop ;E5 ;PUSH HL | |
2344 | instr fetch_DIR8, op_ANDA, store_nop ;E6 nn ;AND n | |
2345 | instr fetch_RST, op_nop, store_CALL ;E7 ;RST 20H | |
2346 | instr fetch_nop, op_IFPE, store_RET ;E8 ;RET PE | |
2347 | instr fetch_HL, op_nop, store_PC ;E9 ;JP HL | |
2348 | instr fetch_DIR16, op_IFPE, store_PC ;EA nn nn ;JP PE,nn | |
623dd899 | 2349 | instr fetch_DE, op_EXHL, store_DE ;EB ;EX DE,HL |
fa9059af L |
2350 | instr fetch_DIR16, op_IFPE, store_CALL ;EC nn nn ;CALL PE,nn |
2351 | instr fetch_nop, op_prefixED, store_nop ;ED ;(ED opcode prefix) | |
2352 | instr fetch_DIR8, op_XORA, store_nop ;EE nn ;XOR n | |
2353 | instr fetch_RST, op_nop, store_CALL ;EF ;RST 28H | |
2354 | instr fetch_nop, op_IFP, store_RET ;F0 ;RET P | |
2355 | instr fetch_nop, op_POP16, store_AF ;F1 ;POP AF | |
2356 | instr fetch_DIR16, op_IFP, store_PC ;F2 nn nn ;JP P,nn | |
623dd899 | 2357 | instr fetch_nop, op_DI, store_nop ;F3 ;DI |
fa9059af L |
2358 | instr fetch_DIR16, op_IFP, store_CALL ;F4 nn nn ;CALL P,nn |
2359 | instr fetch_AF, op_PUSH16, store_nop ;F5 ;PUSH AF | |
2360 | instr fetch_DIR8, op_ORA, store_nop ;F6 nn ;OR n | |
2361 | instr fetch_RST, op_nop, store_CALL ;F7 ;RST 30H | |
2362 | instr fetch_nop, op_IFM, store_RET ;F8 ;RET M | |
2363 | instr fetch_HL, op_nop, store_SP ;F9 ;LD SP,HL | |
2364 | instr fetch_DIR16, op_IFM, store_PC ;FA nn nn ;JP M,nn | |
623dd899 | 2365 | instr fetch_nop, op_EI, store_nop ;FB ;EI |
fa9059af L |
2366 | instr fetch_DIR16, op_IFM, store_CALL ;FC nn nn ;CALL M,nn |
2367 | instr fetch_nop, op_prefixFD, store_nop ;FD ;(FD opcode prefix) | |
623dd899 | 2368 | instr fetch_DIR8, op_CPFA, store_nop ;FE nn ;CP n |
fa9059af L |
2369 | instr fetch_RST, op_nop, store_CALL ;FF ;RST 38H |
2370 | ||
2371 | ||
2372 | #if EM_Z80 | |
2373 | ||
e7a0f403 L |
2374 | |
2375 | ||
623dd899 L |
2376 | checkspace PC, 2 |
2377 | ||
2378 | do_op_noni: | |
2379 | sbiw z_pcl,1 ;--z_pc | |
fa9059af L |
2380 | ret |
2381 | ||
623dd899 L |
2382 | checkspace PC, 16 |
2383 | ||
096f3a91 L |
2384 | do_fetch_dir8_2: |
2385 | movw xl,z_pcl | |
2386 | adiw xl,1 | |
2387 | mem_read_d opl | |
2388 | ret | |
2389 | ||
623dd899 | 2390 | checkspace PC, 5 |
80e1fa71 | 2391 | |
623dd899 L |
2392 | do_fetch_xh: |
2393 | sbis flags,prefixfd | |
2394 | ldd opl,y+oz_xh | |
2395 | sbic flags,prefixfd | |
2396 | ldd opl,y+oz_yh | |
2397 | ret | |
80e1fa71 | 2398 | |
623dd899 | 2399 | checkspace PC, 5 |
80e1fa71 | 2400 | |
623dd899 L |
2401 | do_fetch_xl: |
2402 | sbis flags,prefixfd | |
2403 | ldd opl,y+oz_xl | |
2404 | sbic flags,prefixfd | |
2405 | ldd opl,y+oz_yl | |
80e1fa71 L |
2406 | ret |
2407 | ||
80e1fa71 | 2408 | |
623dd899 | 2409 | checkspace PC, 41 |
80e1fa71 | 2410 | |
623dd899 L |
2411 | do_fetch_mxx: |
2412 | sbic flags,prefixfd | |
2413 | rjmp fetchmxx_fd | |
2414 | ldd xh,y+oz_xh | |
2415 | ldd xl,y+oz_xl | |
2416 | rjmp fetchmxx1 | |
2417 | fetchmxx_fd: | |
2418 | ldd xh,y+oz_yh | |
2419 | ldd xl,y+oz_yl | |
2420 | fetchmxx1: | |
2421 | mem_read_ds opl, z_pc ;get displacement | |
2422 | adiw z_pcl,1 | |
2423 | clr oph ;sign extend | |
2424 | tst opl | |
2425 | brpl fetchmxx2 | |
2426 | com oph | |
2427 | fetchmxx2: | |
2428 | add xl,opl ;add displacement | |
2429 | adc xh,oph | |
2430 | mem_read_d opl ;get operand | |
2431 | ret ;(Ix+d) still in xl,xh | |
80e1fa71 | 2432 | |
623dd899 L |
2433 | |
2434 | checkspace PC, 8 | |
2435 | ||
2436 | do_fetch_xx: | |
2437 | sbic flags,prefixfd | |
2438 | rjmp fetchxx_fd | |
2439 | ldd opl,y+oz_xl | |
2440 | ldd oph,y+oz_xh | |
2441 | ret | |
2442 | fetchxx_fd: | |
2443 | ldd opl,y+oz_yl | |
2444 | ldd oph,y+oz_yh | |
fa9059af L |
2445 | ret |
2446 | ||
623dd899 L |
2447 | checkspace PC, 5 |
2448 | ||
2449 | do_store_xh: | |
2450 | sbis flags,prefixfd | |
2451 | std y+oz_xh,opl | |
2452 | sbic flags,prefixfd | |
2453 | std y+oz_yh,opl | |
fa9059af L |
2454 | ret |
2455 | ||
623dd899 L |
2456 | checkspace PC, 5 |
2457 | ||
2458 | do_store_xl: | |
2459 | sbis flags,prefixfd | |
2460 | std y+oz_xl,opl | |
2461 | sbic flags,prefixfd | |
2462 | std y+oz_yl,opl | |
fa9059af L |
2463 | ret |
2464 | ||
623dd899 | 2465 | checkspace PC, 37 |
80e1fa71 | 2466 | |
80e1fa71 L |
2467 | do_store_mxx: |
2468 | sbic flags,prefixfd | |
2469 | rjmp storemxx_fd | |
e7a0f403 L |
2470 | ldd xh,y+oz_xh |
2471 | ldd xl,y+oz_xl | |
80e1fa71 L |
2472 | rjmp storemxx1 |
2473 | storemxx_fd: | |
e7a0f403 L |
2474 | ldd xh,y+oz_yh |
2475 | ldd xl,y+oz_yl | |
80e1fa71 L |
2476 | storemxx1: |
2477 | mem_read_s z_pc ;get displacement | |
2478 | adiw z_pcl,1 | |
2479 | clr temp2 ;sign extend | |
2480 | tst temp | |
2481 | brpl storemxx2 | |
2482 | com temp2 | |
2483 | storemxx2: | |
2484 | add xl,temp ;add displacement | |
2485 | adc xh,temp2 | |
e7a0f403 | 2486 | mem_write_s opl ;store operand |
80e1fa71 L |
2487 | ret |
2488 | ||
623dd899 L |
2489 | checkspace PC, 10 |
2490 | ||
096f3a91 L |
2491 | do_store_mxx_0: |
2492 | mem_write_s opl ;store operand | |
2493 | ret | |
2494 | ||
623dd899 L |
2495 | checkspace PC, 38 |
2496 | ||
8fec4e62 L |
2497 | do_store_mxx_2: |
2498 | sbic flags,prefixfd | |
2499 | rjmp storemxx2_fd | |
2500 | ldd xh,y+oz_xh | |
2501 | ldd xl,y+oz_xl | |
2502 | rjmp storemxx21 | |
2503 | storemxx2_fd: | |
2504 | ldd xh,y+oz_yh | |
2505 | ldd xl,y+oz_yl | |
2506 | storemxx21: | |
2507 | mem_read_s z_pc ;get displacement | |
2508 | adiw z_pcl,1 | |
2509 | adiw z_pcl,1 | |
2510 | clr temp2 ;sign extend | |
2511 | tst temp | |
2512 | brpl storemxx22 | |
2513 | com temp2 | |
2514 | storemxx22: | |
2515 | add xl,temp ;add displacement | |
2516 | adc xh,temp2 | |
2517 | mem_write_s opl ;store operand | |
2518 | ret | |
2519 | ||
623dd899 L |
2520 | checkspace PC, 8 |
2521 | ||
80e1fa71 L |
2522 | do_store_xx: |
2523 | sbic flags,prefixfd | |
2524 | rjmp storexx_fd | |
e7a0f403 L |
2525 | std y+oz_xl,opl |
2526 | std y+oz_xh,oph | |
80e1fa71 L |
2527 | ret |
2528 | storexx_fd: | |
e7a0f403 L |
2529 | std y+oz_yl,opl |
2530 | std y+oz_yh,oph | |
80e1fa71 L |
2531 | ret |
2532 | ||
fa9059af L |
2533 | ;---------------------------------------------------------------- |
2534 | ;|Mnemonic |SZHPNC|Description |Notes | | |
2535 | ;---------------------------------------------------------------- | |
80e1fa71 L |
2536 | ;|LD dst,src|------|Load |dst=src | |
2537 | ; | |
623dd899 L |
2538 | |
2539 | checkspace PC, 30 | |
2540 | ||
80e1fa71 L |
2541 | do_op_stxx: ;store xx to mem loc in opl:h |
2542 | ||
623dd899 | 2543 | movw xl,opl |
80e1fa71 | 2544 | sbis flags,prefixfd |
e7a0f403 | 2545 | ldd temp,y+oz_xl |
80e1fa71 | 2546 | sbic flags,prefixfd |
e7a0f403 | 2547 | ldd temp,y+oz_yl |
80e1fa71 L |
2548 | mem_write |
2549 | adiw xl,1 | |
2550 | sbis flags,prefixfd | |
e7a0f403 | 2551 | ldd temp,y+oz_xh |
80e1fa71 | 2552 | sbic flags,prefixfd |
e7a0f403 | 2553 | ldd temp,y+oz_yh |
80e1fa71 L |
2554 | mem_write |
2555 | ret | |
2556 | ||
2557 | ||
2558 | ;---------------------------------------------------------------- | |
2559 | ;|Mnemonic |SZHPNC|Description |Notes | | |
2560 | ;---------------------------------------------------------------- | |
2561 | ;|EX [SP],IX|------|Exchange |[SP]<->IX | | |
2562 | ;|EX [SP],IY|------|Exchange |[SP]<->IY | | |
2563 | ; | |
623dd899 L |
2564 | checkspace PC, 13 |
2565 | ||
80e1fa71 L |
2566 | do_op_EXxx: |
2567 | sbic flags,prefixfd | |
2568 | rjmp opexxx_fd | |
e7a0f403 L |
2569 | ldd temp,y+oz_xl |
2570 | ldd temp2,y+oz_xh | |
2571 | std y+oz_xl,opl | |
2572 | std y+oz_xh,oph | |
80e1fa71 L |
2573 | rjmp opexxxe |
2574 | opexxx_fd: | |
e7a0f403 L |
2575 | ldd temp,y+oz_yl |
2576 | ldd temp2,y+oz_yh | |
2577 | std y+oz_yl,opl | |
2578 | std y+oz_yh,oph | |
80e1fa71 L |
2579 | opexxxe: |
2580 | movw opl,temp | |
2581 | ret | |
2582 | ||
2583 | ;---------------------------------------------------------------- | |
2584 | ;|Mnemonic |SZHPNC|Description |Notes | | |
2585 | ;---------------------------------------------------------------- | |
2586 | ;|ADD IX,pp |--*-0*|Add |IX=IX+pp | | |
2587 | ;|ADD IY,rr |--*-0*|Add |IY=IY+rr | | |
fa9059af | 2588 | ; |
623dd899 L |
2589 | |
2590 | checkspace PC, 25 | |
2591 | ||
fa9059af | 2592 | do_op_addxx: |
80e1fa71 L |
2593 | sbic flags,prefixfd |
2594 | rjmp opadx_fd | |
e7a0f403 L |
2595 | ldd temp,y+oz_xl |
2596 | ldd temp2,y+oz_xh | |
2597 | add opl,temp | |
2598 | adc oph,temp2 | |
2599 | std y+oz_xl,opl | |
2600 | std y+oz_xh,oph | |
80e1fa71 L |
2601 | rjmp opadx_e |
2602 | opadx_fd: | |
e7a0f403 L |
2603 | ldd temp,y+oz_yl |
2604 | ldd temp2,y+oz_yh | |
2605 | add opl,temp | |
2606 | adc oph,temp2 | |
2607 | std y+oz_yl,opl | |
2608 | std y+oz_yh,oph | |
80e1fa71 | 2609 | opadx_e: |
e7a0f403 | 2610 | in temp,sreg |
80e1fa71 L |
2611 | bmov z_flags,ZFL_C, temp,AVR_C |
2612 | do_z80_flags_H | |
fa9059af L |
2613 | do_z80_flags_clear_N |
2614 | ret | |
2615 | ||
80e1fa71 | 2616 | |
623dd899 | 2617 | opctable DDFDjmp, PC ;+256 |
e7a0f403 | 2618 | |
623dd899 L |
2619 | instr fetch_nop, op_noni, store_nop ;00 ; |
2620 | instr fetch_nop, op_noni, store_nop ;01 ; | |
2621 | instr fetch_nop, op_noni, store_nop ;02 ; | |
2622 | instr fetch_nop, op_noni, store_nop ;03 ; | |
2623 | instr fetch_nop, op_noni, store_nop ;04 ; | |
2624 | instr fetch_nop, op_noni, store_nop ;05 ; | |
2625 | instr fetch_nop, op_noni, store_nop ;06 ; | |
2626 | instr fetch_nop, op_noni, store_nop ;07 ; | |
2627 | instr fetch_nop, op_noni, store_nop ;08 ; | |
2628 | instr fetch_BC, op_ADDxx, store_nop ;09 ;ADD xx,BC | |
2629 | instr fetch_nop, op_noni, store_nop ;0A ; | |
2630 | instr fetch_nop, op_noni, store_nop ;0B ; | |
2631 | instr fetch_nop, op_noni, store_nop ;0C ; | |
2632 | instr fetch_nop, op_noni, store_nop ;0D ; | |
2633 | instr fetch_nop, op_noni, store_nop ;0E ; | |
2634 | instr fetch_nop, op_noni, store_nop ;0F ; | |
2635 | instr fetch_nop, op_noni, store_nop ;10 ; | |
2636 | instr fetch_nop, op_noni, store_nop ;11 ; | |
2637 | instr fetch_nop, op_noni, store_nop ;12 ; | |
2638 | instr fetch_nop, op_noni, store_nop ;13 ; | |
2639 | instr fetch_nop, op_noni, store_nop ;14 ; | |
2640 | instr fetch_nop, op_noni, store_nop ;15 ; | |
2641 | instr fetch_nop, op_noni, store_nop ;16 ; | |
2642 | instr fetch_nop, op_noni, store_nop ;17 ; | |
2643 | instr fetch_nop, op_noni, store_nop ;18 ; | |
2644 | instr fetch_DE, op_ADDxx, store_nop ;19 ;ADD xx,DE | |
2645 | instr fetch_nop, op_noni, store_nop ;1A ; | |
2646 | instr fetch_nop, op_noni, store_nop ;1B ; | |
2647 | instr fetch_nop, op_noni, store_nop ;1C ; | |
2648 | instr fetch_nop, op_noni, store_nop ;1D ; | |
2649 | instr fetch_nop, op_noni, store_nop ;1E ; | |
2650 | instr fetch_nop, op_noni, store_nop ;1F ; | |
2651 | instr fetch_nop, op_noni, store_nop ;20 ; | |
2652 | instr fetch_DIR16, op_nop, store_xx ;21 ;LD xx,nn | |
2653 | instr fetch_DIR16, op_STxx, store_nop ;22 ;LD (nn),xx | |
2654 | instr fetch_xx, op_INC16, store_xx ;23 ;INC xx | |
2655 | instr fetch_xH, op_INC, store_xH ;24 ;INC xh | |
2656 | instr fetch_xH, op_DEC, store_xH ;25 ;DEC xh | |
2657 | instr fetch_DIR8, op_nop, store_xH ;26 ;LD xh,n | |
2658 | instr fetch_nop, op_noni, store_nop ;27 ; | |
2659 | instr fetch_nop, op_noni, store_nop ;28 ; | |
2660 | instr fetch_xx, op_ADDxx, store_nop ;29 ;ADD xx,xx | |
2661 | instr fetch_DIR16, op_RMEM16, store_xx ;2A ;LD xx,(nn) | |
2662 | instr fetch_xx, op_DEC16, store_xx ;2B ;DEC xx | |
2663 | instr fetch_xL, op_INC, store_xL ;2C ;INC xl | |
2664 | instr fetch_xL, op_DEC, store_xL ;2D ;DEC xl | |
2665 | instr fetch_DIR8, op_nop, store_xL ;2E ;LD xl,n | |
2666 | instr fetch_nop, op_noni, store_nop ;2F ; | |
2667 | instr fetch_nop, op_noni, store_nop ;30 ; | |
2668 | instr fetch_nop, op_noni, store_nop ;31 ; | |
2669 | instr fetch_nop, op_noni, store_nop ;32 ; | |
2670 | instr fetch_nop, op_noni, store_nop ;33 ; | |
2671 | instr fetch_MXX, op_INC, store_MXX_0 ;34 ;INC (xx+d) | |
2672 | instr fetch_MXX, op_DEC, store_MXX_0 ;35 ;DEC (xx+d) | |
2673 | instr fetch_DIR8_2, op_nop, store_MXX_2 ;36 ;LD (xx+d),n | |
2674 | instr fetch_nop, op_noni, store_nop ;37 ; | |
2675 | instr fetch_nop, op_noni, store_nop ;38 ; | |
2676 | instr fetch_SP, op_ADDxx, store_nop ;39 ;ADD xx,SP | |
2677 | instr fetch_nop, op_noni, store_nop ;3A ; | |
2678 | instr fetch_nop, op_noni, store_nop ;3B ; | |
2679 | instr fetch_nop, op_noni, store_nop ;3C ; | |
2680 | instr fetch_nop, op_noni, store_nop ;3D ; | |
2681 | instr fetch_nop, op_noni, store_nop ;3E ; | |
2682 | instr fetch_nop, op_noni, store_nop ;3F ; | |
2683 | instr fetch_nop, op_noni, store_nop ;40 ; | |
2684 | instr fetch_nop, op_noni, store_nop ;41 ; | |
2685 | instr fetch_nop, op_noni, store_nop ;42 ; | |
2686 | instr fetch_nop, op_noni, store_nop ;43 ; | |
2687 | instr fetch_xH, op_nop, store_B ;44 ;LD B,xh | |
2688 | instr fetch_xL, op_nop, store_B ;45 ;LD B,xl | |
2689 | instr fetch_MXX, op_nop, store_B ;46 ;LD B,(xx+d) | |
2690 | instr fetch_nop, op_noni, store_nop ;47 ; | |
2691 | instr fetch_nop, op_noni, store_nop ;48 ; | |
2692 | instr fetch_nop, op_noni, store_nop ;49 ; | |
2693 | instr fetch_nop, op_noni, store_nop ;4A ; | |
2694 | instr fetch_nop, op_noni, store_nop ;4B ; | |
2695 | instr fetch_xH, op_nop, store_C ;4C ;LD C,xh | |
2696 | instr fetch_xL, op_nop, store_C ;4D ;LD C,xl | |
2697 | instr fetch_MXX, op_nop, store_C ;4E ;LD C,(xx+d) | |
2698 | instr fetch_nop, op_noni, store_nop ;4F ; | |
2699 | instr fetch_nop, op_noni, store_nop ;50 ; | |
2700 | instr fetch_nop, op_noni, store_nop ;51 ; | |
2701 | instr fetch_nop, op_noni, store_nop ;52 ; | |
2702 | instr fetch_nop, op_noni, store_nop ;53 ; | |
2703 | instr fetch_xH, op_nop, store_D ;54 ;LD D,xh | |
2704 | instr fetch_xL, op_nop, store_D ;55 ;LD D,xl | |
2705 | instr fetch_MXX, op_nop, store_D ;56 ;LD D,(xx+d) | |
2706 | instr fetch_nop, op_noni, store_nop ;57 ; | |
2707 | instr fetch_nop, op_noni, store_nop ;58 ; | |
2708 | instr fetch_nop, op_noni, store_nop ;59 ; | |
2709 | instr fetch_nop, op_noni, store_nop ;5A ; | |
2710 | instr fetch_nop, op_noni, store_nop ;5B ; | |
2711 | instr fetch_xH, op_nop, store_E ;5C ;LD E,xh | |
2712 | instr fetch_xL, op_nop, store_E ;5D ;LD E,xl | |
2713 | instr fetch_MXX, op_nop, store_E ;5E ;LD E,(xx+d) | |
2714 | instr fetch_nop, op_noni, store_nop ;5F ; | |
2715 | instr fetch_B, op_nop, store_xH ;60 ;LD xh,B | |
2716 | instr fetch_C, op_nop, store_xH ;61 ;LD xh,C | |
2717 | instr fetch_D, op_nop, store_xH ;62 ;LD xh,D | |
2718 | instr fetch_E, op_nop, store_xH ;63 ;LD xh,E | |
2719 | instr fetch_nop, op_noni, store_nop ;64 ;LD xh,xh | |
2720 | instr fetch_xL, op_nop, store_xH ;65 ;LD xh,xl | |
2721 | instr fetch_MXX, op_nop, store_H ;66 ;LD H,(xx+d) | |
2722 | instr fetch_A, op_nop, store_xH ;67 ;LD xh,A | |
2723 | instr fetch_B, op_nop, store_xL ;68 ;LD xl,B | |
2724 | instr fetch_C, op_nop, store_xL ;69 ;LD xl,C | |
2725 | instr fetch_D, op_nop, store_xL ;6A ;LD xl,D | |
2726 | instr fetch_E, op_nop, store_xL ;6B ;LD xl,E | |
2727 | instr fetch_xH, op_nop, store_xL ;6C ;LD xl,xh | |
2728 | instr fetch_nop, op_noni, store_nop ;6D ;LD xl,xl | |
2729 | instr fetch_MXX, op_nop, store_L ;6E ;LD L,(xx+d) | |
2730 | instr fetch_A, op_nop, store_xL ;6F ;LD xl,A | |
2731 | instr fetch_B, op_nop, store_MXX ;70 ;LD (xx+d),B | |
2732 | instr fetch_C, op_nop, store_MXX ;71 ;LD (xx+d),C | |
2733 | instr fetch_D, op_nop, store_MXX ;72 ;LD (xx+d),D | |
2734 | instr fetch_E, op_nop, store_MXX ;73 ;LD (xx+d),E | |
2735 | instr fetch_H, op_nop, store_MXX ;74 ;LD (xx+d),H | |
2736 | instr fetch_L, op_nop, store_MXX ;75 ;LD (xx+d),L | |
2737 | instr fetch_nop, op_noni, store_nop ;76 ; | |
2738 | instr fetch_A, op_nop, store_MXX ;77 ;LD (xx+d),A | |
2739 | instr fetch_nop, op_noni, store_nop ;78 ; | |
2740 | instr fetch_nop, op_noni, store_nop ;79 ; | |
2741 | instr fetch_nop, op_noni, store_nop ;7A ; | |
2742 | instr fetch_nop, op_noni, store_nop ;7B ; | |
2743 | instr fetch_xH, op_nop, store_A ;7C ;LD A,xh | |
2744 | instr fetch_xL, op_nop, store_A ;7D ;LD A,xl | |
2745 | instr fetch_MXX, op_nop, store_A ;7E ;LD A,(xx+d) | |
2746 | instr fetch_nop, op_noni, store_nop ;7F ; | |
2747 | instr fetch_nop, op_noni, store_nop ;80 ; | |
2748 | instr fetch_nop, op_noni, store_nop ;81 ; | |
2749 | instr fetch_nop, op_noni, store_nop ;82 ; | |
2750 | instr fetch_nop, op_noni, store_nop ;83 ; | |
2751 | instr fetch_xH, op_ADDA, store_nop ;84 ;ADD A,xh | |
2752 | instr fetch_xL, op_ADDA, store_nop ;85 ;ADD A,xl | |
2753 | instr fetch_MXX, op_ADDA, store_nop ;86 ;ADD A,(xx) | |
2754 | instr fetch_nop, op_noni, store_nop ;87 ; | |
2755 | instr fetch_nop, op_noni, store_nop ;88 ; | |
2756 | instr fetch_nop, op_noni, store_nop ;89 ; | |
2757 | instr fetch_nop, op_noni, store_nop ;8A ; | |
2758 | instr fetch_nop, op_noni, store_nop ;8B ; | |
2759 | instr fetch_xH, op_ADCA, store_nop ;8C ;ADC A,xh | |
2760 | instr fetch_xL, op_ADCA, store_nop ;8D ;ADC A,xl | |
2761 | instr fetch_MXX, op_ADCA, store_nop ;8E ;ADC A,(xx) | |
2762 | instr fetch_nop, op_noni, store_nop ;8F ; | |
2763 | instr fetch_nop, op_noni, store_nop ;90 ; | |
2764 | instr fetch_nop, op_noni, store_nop ;91 ; | |
2765 | instr fetch_nop, op_noni, store_nop ;92 ; | |
2766 | instr fetch_nop, op_noni, store_nop ;93 ; | |
2767 | instr fetch_xH, op_SUBFA, store_nop ;94 ;SUB A,xh | |
2768 | instr fetch_xL, op_SUBFA, store_nop ;95 ;SUB A,xl | |
2769 | instr fetch_MXX, op_SUBFA, store_nop ;96 ;SUB A,(xx) | |
2770 | instr fetch_nop, op_noni, store_nop ;97 ; | |
2771 | instr fetch_nop, op_noni, store_nop ;98 ; | |
2772 | instr fetch_nop, op_noni, store_nop ;99 ; | |
2773 | instr fetch_nop, op_noni, store_nop ;9A ; | |
2774 | instr fetch_nop, op_noni, store_nop ;9B ; | |
2775 | instr fetch_xH, op_SBCFA, store_nop ;9C ;SBC A,xh | |
2776 | instr fetch_xL, op_SBCFA, store_nop ;9D ;SBC A,xl | |
2777 | instr fetch_MXX, op_SBCFA, store_nop ;9E ;SBC A,(xx) | |
2778 | instr fetch_nop, op_noni, store_nop ;9F ; | |
2779 | instr fetch_nop, op_noni, store_nop ;A0 ; | |
2780 | instr fetch_nop, op_noni, store_nop ;A1 ; | |
2781 | instr fetch_nop, op_noni, store_nop ;A2 ; | |
2782 | instr fetch_nop, op_noni, store_nop ;A3 ; | |
2783 | instr fetch_xH, op_ANDA, store_nop ;A4 ;AND A,xh | |
2784 | instr fetch_xL, op_ANDA, store_nop ;A5 ;AND A,xl | |
2785 | instr fetch_MXX, op_ANDA, store_nop ;A6 ;AND A,(xx) | |
2786 | instr fetch_nop, op_noni, store_nop ;A7 ; | |
2787 | instr fetch_nop, op_noni, store_nop ;A8 ; | |
2788 | instr fetch_nop, op_noni, store_nop ;A9 ; | |
2789 | instr fetch_nop, op_noni, store_nop ;AA ; | |
2790 | instr fetch_nop, op_noni, store_nop ;AB ; | |
2791 | instr fetch_xH, op_XORA, store_nop ;AC ;XOR A,xh | |
2792 | instr fetch_xL, op_XORA, store_nop ;AD ;XOR A,xl | |
2793 | instr fetch_MXX, op_XORA, store_nop ;AE ;XOR A,(xx) | |
2794 | instr fetch_nop, op_noni, store_nop ;AF ; | |
2795 | instr fetch_nop, op_noni, store_nop ;B0 ; | |
2796 | instr fetch_nop, op_noni, store_nop ;B1 ; | |
2797 | instr fetch_nop, op_noni, store_nop ;B2 ; | |
2798 | instr fetch_nop, op_noni, store_nop ;B3 ; | |
2799 | instr fetch_xH, op_ORA, store_nop ;B4 ;OR A,xh | |
2800 | instr fetch_xL, op_ORA, store_nop ;B5 ;OR A,xl | |
2801 | instr fetch_MXX, op_ORA, store_nop ;B6 ;OR A,(xx) | |
2802 | instr fetch_nop, op_noni, store_nop ;B7 ; | |
2803 | instr fetch_nop, op_noni, store_nop ;B8 ; | |
2804 | instr fetch_nop, op_noni, store_nop ;B9 ; | |
2805 | instr fetch_nop, op_noni, store_nop ;BA ; | |
2806 | instr fetch_nop, op_noni, store_nop ;BB ; | |
2807 | instr fetch_xH, op_CPFA, store_nop ;BC ;CP A,xh | |
2808 | instr fetch_xL, op_CPFA, store_nop ;BD ;CP A,xl | |
2809 | instr fetch_MXX, op_CPFA, store_nop ;BE ;CP A,(xx) | |
2810 | instr fetch_nop, op_noni, store_nop ;BF ; | |
2811 | instr fetch_nop, op_noni, store_nop ;C0 ; | |
2812 | instr fetch_nop, op_noni, store_nop ;C1 ; | |
2813 | instr fetch_nop, op_noni, store_nop ;C2 ; | |
2814 | instr fetch_nop, op_noni, store_nop ;C3 ; | |
2815 | instr fetch_nop, op_noni, store_nop ;C4 ; | |
2816 | instr fetch_nop, op_noni, store_nop ;C5 ; | |
2817 | instr fetch_nop, op_noni, store_nop ;C6 ; | |
2818 | instr fetch_nop, op_noni, store_nop ;C7 ; | |
2819 | instr fetch_nop, op_noni, store_nop ;C8 ; | |
2820 | instr fetch_nop, op_noni, store_nop ;C9 ; | |
2821 | instr fetch_nop, op_noni, store_nop ;CA ; | |
2822 | instr fetch_nop, op_prefixDDFDCB,store_nop ;CB ; | |
2823 | instr fetch_nop, op_noni, store_nop ;CC ; | |
2824 | instr fetch_nop, op_noni, store_nop ;CD ; | |
2825 | instr fetch_nop, op_noni, store_nop ;CE ; | |
2826 | instr fetch_nop, op_noni, store_nop ;CF ; | |
2827 | instr fetch_nop, op_noni, store_nop ;D0 ; | |
2828 | instr fetch_nop, op_noni, store_nop ;D1 ; | |
2829 | instr fetch_nop, op_noni, store_nop ;D2 ; | |
2830 | instr fetch_nop, op_noni, store_nop ;D3 ; | |
2831 | instr fetch_nop, op_noni, store_nop ;D4 ; | |
2832 | instr fetch_nop, op_noni, store_nop ;D5 ; | |
2833 | instr fetch_nop, op_noni, store_nop ;D6 ; | |
2834 | instr fetch_nop, op_noni, store_nop ;D7 ; | |
2835 | instr fetch_nop, op_noni, store_nop ;D8 ; | |
2836 | instr fetch_nop, op_noni, store_nop ;D9 ; | |
2837 | instr fetch_nop, op_noni, store_nop ;DA ; | |
2838 | instr fetch_nop, op_noni, store_nop ;DB ; | |
2839 | instr fetch_nop, op_noni, store_nop ;DC ; | |
2840 | instr fetch_nop, op_noni, store_nop ;DD ; | |
2841 | instr fetch_nop, op_noni, store_nop ;DE ; | |
2842 | instr fetch_nop, op_noni, store_nop ;DF ; | |
2843 | instr fetch_nop, op_noni, store_nop ;E0 ; | |
2844 | instr fetch_nop, op_POP16, store_xx ;E1 ;POP xx | |
2845 | instr fetch_nop, op_noni, store_nop ;E2 ; | |
2846 | instr fetch_MSP, op_EXxx, store_MSP ;E3 ;EX (SP),xx | |
2847 | instr fetch_nop, op_noni, store_nop ;E4 ; | |
2848 | instr fetch_xx, op_PUSH16, store_nop ;E5 ;PUSH xx | |
2849 | instr fetch_nop, op_noni, store_nop ;E6 ; | |
2850 | instr fetch_nop, op_noni, store_nop ;E7 ; | |
2851 | instr fetch_nop, op_noni, store_nop ;E8 ; | |
2852 | instr fetch_xx, op_nop, store_PC ;E9 ;JP xx | |
2853 | instr fetch_nop, op_noni, store_nop ;EA ; | |
2854 | instr fetch_nop, op_noni, store_nop ;EB ; | |
2855 | instr fetch_nop, op_noni, store_nop ;EC ; | |
2856 | instr fetch_nop, op_noni, store_nop ;ED ; | |
2857 | instr fetch_nop, op_noni, store_nop ;EE ; | |
2858 | instr fetch_nop, op_noni, store_nop ;EF ; | |
2859 | instr fetch_nop, op_noni, store_nop ;F0 ; | |
2860 | instr fetch_nop, op_noni, store_nop ;F1 ; | |
2861 | instr fetch_nop, op_noni, store_nop ;F2 ; | |
2862 | instr fetch_nop, op_noni, store_nop ;F3 ; | |
2863 | instr fetch_nop, op_noni, store_nop ;F4 ; | |
2864 | instr fetch_nop, op_noni, store_nop ;F5 ; | |
2865 | instr fetch_nop, op_noni, store_nop ;F6 ; | |
2866 | instr fetch_nop, op_noni, store_nop ;F7 ; | |
2867 | instr fetch_nop, op_noni, store_nop ;F8 ; | |
2868 | instr fetch_xx, op_nop, store_SP ;F9 ;LD SP,xx | |
2869 | instr fetch_nop, op_noni, store_nop ;FA ; | |
2870 | instr fetch_nop, op_noni, store_nop ;FB ; | |
2871 | instr fetch_nop, op_noni, store_nop ;FC ; | |
2872 | instr fetch_nop, op_noni, store_nop ;FD ; | |
2873 | instr fetch_nop, op_noni, store_nop ;FE ; | |
2874 | instr fetch_nop, op_noni, store_nop ;FF ; | |
2217c855 | 2875 | |
2217c855 | 2876 | |
e7a0f403 L |
2877 | |
2878 | ;---------------------------------------------------------------- | |
2879 | ;|Mnemonic |SZHPNC|Description |Notes | | |
2880 | ;---------------------------------------------------------------- | |
623dd899 L |
2881 | ;|RLC m |**0P0*|Rotate Left Circular |m=m<- | |
2882 | ;|RRC m |**0P0*|Rotate Right Circular|m=->m | | |
2883 | ;|RL m |**0P0*|Rotate Left |m={CY,m}<- | | |
2884 | ;|RR m |**0P0*|Rotate Right |m=->{CY,m} | | |
2885 | ;|SLA m |**0P0*|Shift Left Arithmetic|m=m*2 | | |
2886 | ;|SRA m |**0P0*|Shift Right Arith. |m=m/2 | | |
2887 | ;|SLL m |**0P0*|Shift Right Logical | | |
2888 | ;|SRL m |**0P0*|Shift Right Logical |m=->{0,m,CY} | | |
e7a0f403 | 2889 | |
2217c855 | 2890 | |
623dd899 | 2891 | checkspace PC, 9 |
2217c855 | 2892 | |
623dd899 L |
2893 | do_op_rlc: |
2894 | ;Rotate Left Cyclical. All bits move 1 to the | |
2895 | ;left, the msb becomes c and lsb. | |
2896 | clr temp | |
2897 | lsl opl | |
2898 | adc temp,_0 | |
2899 | or opl,temp | |
2900 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2901 | or z_flags,temp | |
2217c855 L |
2902 | ret |
2903 | ||
623dd899 L |
2904 | checkspace PC, 9 |
2905 | ||
2906 | do_op_rrc: | |
2907 | ;Rotate Right Cyclical. All bits move 1 to the | |
2908 | ;right, the lsb becomes c and msb. | |
2909 | lsr opl | |
2910 | brcc PC+2 | |
2911 | ori opl,0x80 | |
2912 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2913 | bmov z_flags,ZFL_C, opl,7 | |
e7a0f403 L |
2914 | ret |
2915 | ||
2217c855 | 2916 | |
623dd899 | 2917 | checkspace PC, 11 |
e7a0f403 | 2918 | |
623dd899 L |
2919 | do_op_rl: |
2920 | ;Rotate Left. All bits move 1 to the left, the msb | |
2921 | ;becomes c, c becomes lsb. | |
2922 | clc | |
2923 | sbrc z_flags,ZFL_C | |
2924 | sec | |
2925 | rol opl | |
2926 | in temp,sreg | |
2927 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2928 | bmov z_flags,ZFL_C, temp,AVR_C | |
e7a0f403 L |
2929 | ret |
2930 | ||
e7a0f403 | 2931 | |
5c8bb361 | 2932 | checkspace PC, 10 |
99034156 | 2933 | |
623dd899 L |
2934 | do_op_rr: |
2935 | ;Rotate Right. All bits move 1 to the right, the lsb | |
2936 | ;becomes c, c becomes msb. | |
2937 | ||
2938 | ror opl | |
2939 | in temp,sreg ;CY | |
2940 | bmov opl,7, z_flags,ZFL_C ;old CY --> Bit 7 | |
2941 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2942 | bmov z_flags,ZFL_C, temp,AVR_C ; | |
99034156 L |
2943 | ret |
2944 | ||
5c8bb361 | 2945 | checkspace PC, 9 |
623dd899 L |
2946 | |
2947 | do_op_sla: | |
2948 | lsl opl | |
2949 | in temp,sreg | |
2950 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2951 | bmov z_flags,ZFL_C, temp,AVR_C ; | |
99034156 L |
2952 | ret |
2953 | ||
5c8bb361 | 2954 | checkspace PC, 11 |
623dd899 L |
2955 | |
2956 | do_op_sra: | |
2957 | lsr opl | |
2958 | in temp,sreg | |
2959 | bmov opl,7, opl,6 ;old CY --> Bit 7 | |
2960 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2961 | bmov z_flags,ZFL_C, temp,AVR_C ; | |
99034156 L |
2962 | ret |
2963 | ||
623dd899 L |
2964 | checkspace PC, 9 |
2965 | ||
2966 | do_op_sll: | |
2967 | sec | |
2968 | rol opl | |
2969 | in temp,sreg | |
2970 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2971 | bmov z_flags,ZFL_C, temp,AVR_C ; | |
99034156 L |
2972 | ret |
2973 | ||
623dd899 L |
2974 | checkspace PC, 8 |
2975 | ||
2976 | do_op_srl: | |
2977 | lsr opl | |
2978 | in temp,sreg | |
2979 | ldpmx z_flags,sz53p_tab,opl ;S,Z,H,P,N | |
2980 | bmov z_flags,ZFL_C, temp,AVR_C ; | |
99034156 L |
2981 | ret |
2982 | ||
2983 | ;---------------------------------------------------------------- | |
2984 | ;|Mnemonic |SZHPNC|Description |Notes | | |
2985 | ;---------------------------------------------------------------- | |
623dd899 L |
2986 | ;|BIT b,m |?*1?0-|Test Bit |m&{2^b} | |
2987 | ;|RES b,m |------|Reset bit |m=m&{~2^b} | | |
2988 | ;|SET b,m |------|Set bit |m=mv{2^b} | | |
99034156 | 2989 | |
99034156 | 2990 | |
5c8bb361 | 2991 | checkspace PC, 2 |
623dd899 L |
2992 | do_op_BIT7: |
2993 | ldi temp,0x80 | |
2994 | rjmp opbit | |
5c8bb361 | 2995 | checkspace PC, 2 |
623dd899 L |
2996 | do_op_BIT6: |
2997 | ldi temp,0x40 | |
2998 | rjmp opbit | |
5c8bb361 | 2999 | checkspace PC, 2 |
623dd899 L |
3000 | do_op_BIT5: |
3001 | ldi temp,0x20 | |
3002 | rjmp opbit | |
5c8bb361 | 3003 | checkspace PC, 2 |
623dd899 L |
3004 | do_op_BIT4: |
3005 | ldi temp,0x10 | |
3006 | rjmp opbit | |
5c8bb361 | 3007 | checkspace PC, 2 |
623dd899 L |
3008 | do_op_BIT3: |
3009 | ldi temp,0x08 | |
3010 | rjmp opbit | |
5c8bb361 | 3011 | checkspace PC, 2 |
623dd899 L |
3012 | do_op_BIT2: |
3013 | ldi temp,0x04 | |
3014 | rjmp opbit | |
5c8bb361 | 3015 | checkspace PC, 2 |
623dd899 L |
3016 | do_op_BIT1: |
3017 | ldi temp,0x02 | |
3018 | rjmp opbit | |
825ecc9d L |
3019 | |
3020 | checkspace PC, 7 | |
623dd899 L |
3021 | do_op_BIT0: |
3022 | ldi temp,0x01 | |
3023 | opbit: | |
825ecc9d | 3024 | andi z_flags,~((1<<ZFL_N)|(1<<ZFL_Z)) |
623dd899 | 3025 | ori z_flags,(1<<ZFL_H) |
825ecc9d L |
3026 | and temp,opl |
3027 | brne opbite | |
3028 | ori z_flags,(1<<ZFL_Z) | |
3029 | opbite: | |
99034156 L |
3030 | ret |
3031 | ||
99034156 | 3032 | |
623dd899 L |
3033 | .macro m_do_op_RES7 |
3034 | andi opl,~0x80 | |
3035 | .endm | |
3036 | .equ do_op_RES7 = 0 | |
3037 | ; andi opl,~0x80 | |
3038 | ; ret | |
99034156 | 3039 | |
623dd899 L |
3040 | .macro m_do_op_RES6 |
3041 | andi opl,~0x40 | |
3042 | .endm | |
3043 | .equ do_op_RES6 = 0 | |
3044 | ; andi opl,~0x40 | |
3045 | ; ret | |
3046 | ||
3047 | .macro m_do_op_RES5 | |
3048 | andi opl,~0x20 | |
3049 | .endm | |
3050 | .equ do_op_RES5 = 0 | |
3051 | ; andi opl,~0x20 | |
3052 | ; ret | |
3053 | ||
3054 | .macro m_do_op_RES4 | |
3055 | andi opl,~0x10 | |
3056 | .endm | |
3057 | .equ do_op_RES4 = 0 | |
3058 | ; andi opl,~0x10 | |
3059 | ; ret | |
3060 | ||
3061 | .macro m_do_op_RES3 | |
3062 | andi opl,~0x08 | |
3063 | .endm | |
3064 | .equ do_op_RES3 = 0 | |
3065 | ; andi opl,~0x08 | |
3066 | ; ret | |
3067 | ||
3068 | .macro m_do_op_RES2 | |
3069 | andi opl,~0x04 | |
3070 | .endm | |
3071 | .equ do_op_RES2 = 0 | |
3072 | ; andi opl,~0x04 | |
3073 | ; ret | |
3074 | ||
3075 | .macro m_do_op_RES1 | |
3076 | andi opl,~0x02 | |
3077 | .endm | |
3078 | .equ do_op_RES1 = 0 | |
3079 | ; andi opl,~0x02 | |
3080 | ; ret | |
3081 | ||
3082 | .macro m_do_op_RES0 | |
3083 | andi opl,~0x01 | |
3084 | .endm | |
3085 | .equ do_op_RES0 = 0 | |
3086 | ; andi opl,~0x01 | |
3087 | ; ret | |
3088 | ||
3089 | .macro m_do_op_SET7 | |
3090 | ori opl,0x80 | |
3091 | .endm | |
3092 | .equ do_op_SET7 = 0 | |
3093 | ; ori opl,0x80 | |
3094 | ; ret | |
3095 | ||
3096 | .macro m_do_op_SET6 | |
3097 | ori opl,0x40 | |
3098 | .endm | |
3099 | .equ do_op_SET6 = 0 | |
3100 | ; ori opl,0x40 | |
3101 | ; ret | |
3102 | ||
3103 | .macro m_do_op_SET5 | |
3104 | ori opl,0x20 | |
3105 | .endm | |
3106 | .equ do_op_SET5 = 0 | |
3107 | ; ori opl,0x20 | |
3108 | ; ret | |
3109 | ||
3110 | .macro m_do_op_SET4 | |
3111 | ori opl,0x10 | |
3112 | .endm | |
3113 | .equ do_op_SET4 = 0 | |
3114 | ; ori opl,0x10 | |
3115 | ; ret | |
3116 | ||
3117 | .macro m_do_op_SET3 | |
3118 | ori opl,0x08 | |
3119 | .endm | |
3120 | .equ do_op_SET3 = 0 | |
3121 | ; ori opl,0x08 | |
3122 | ; ret | |
3123 | ||
3124 | .macro m_do_op_SET2 | |
3125 | ori opl,0x04 | |
3126 | .endm | |
3127 | .equ do_op_SET2 = 0 | |
3128 | ; ori opl,0x04 | |
3129 | ; ret | |
3130 | ||
3131 | .macro m_do_op_SET1 | |
3132 | ori opl,0x02 | |
3133 | .endm | |
3134 | .equ do_op_SET1 = 0 | |
3135 | ; ori opl,0x02 | |
3136 | ; ret | |
3137 | ||
3138 | .macro m_do_op_SET0 | |
3139 | ori opl,0x01 | |
3140 | .endm | |
3141 | .equ do_op_SET0 = 0 | |
3142 | ; ori opl,0x01 | |
3143 | ; ret | |
3144 | ||
3145 | ||
3146 | ;.macro m_do_store_b | |
3147 | ; std y+oz_b,opl | |
3148 | ;.endm | |
3149 | ;.equ do_store_b = 0 | |
5c8bb361 | 3150 | checkspace PC, 2 |
623dd899 | 3151 | do_store2_b: |
825ecc9d | 3152 | mov z_b,opl |
99034156 L |
3153 | ret |
3154 | ||
5c8bb361 | 3155 | checkspace PC, 2 |
623dd899 | 3156 | do_store2_c: |
825ecc9d | 3157 | mov z_c,opl |
623dd899 | 3158 | ret |
e7a0f403 | 3159 | |
5c8bb361 | 3160 | checkspace PC, 2 |
623dd899 | 3161 | do_store2_d: |
825ecc9d | 3162 | mov z_d,opl |
623dd899 | 3163 | ret |
fa9059af | 3164 | |
5c8bb361 | 3165 | checkspace PC, 2 |
623dd899 | 3166 | do_store2_e: |
825ecc9d | 3167 | mov z_e,opl |
623dd899 | 3168 | ret |
fa9059af | 3169 | |
5c8bb361 | 3170 | checkspace PC, 2 |
623dd899 | 3171 | do_store2_h: |
825ecc9d | 3172 | mov z_h,opl |
623dd899 | 3173 | ret |
fa9059af | 3174 | |
5c8bb361 | 3175 | checkspace PC, 2 |
623dd899 | 3176 | do_store2_l: |
825ecc9d | 3177 | mov z_l,opl |
623dd899 | 3178 | ret |
fa9059af | 3179 | |
5c8bb361 | 3180 | checkspace PC, 2 |
623dd899 L |
3181 | do_store2_a: |
3182 | mov z_a,opl | |
fb050095 L |
3183 | ret |
3184 | ||
5c8bb361 | 3185 | checkspace PC, 4 |
623dd899 | 3186 | do_fetch2_mhl: |
825ecc9d | 3187 | movw x,z_l |
623dd899 | 3188 | mem_read_d opl |
fb050095 L |
3189 | ret |
3190 | ||
623dd899 | 3191 | opctable CBjmp, PC ;+256 |
fa9059af | 3192 | |
fb050095 L |
3193 | instr fetch_B, op_RLC, store2_B ;00 ;RLC B |
3194 | instr fetch_C, op_RLC, store2_C ;01 ;RLC C | |
3195 | instr fetch_D, op_RLC, store2_D ;02 ;RLC D | |
3196 | instr fetch_E, op_RLC, store2_E ;03 ;RLC E | |
3197 | instr fetch_H, op_RLC, store2_H ;04 ;RLC H | |
3198 | instr fetch_L, op_RLC, store2_L ;05 ;RLC L | |
3199 | instr fetch2_mhl, op_RLC, store_MHL ;06 ;RLC (HL) | |
3200 | instr fetch_A, op_RLC, store2_A ;07 ;RLC A | |
3201 | instr fetch_B, op_RRC, store2_B ;08 ;RRC B | |
3202 | instr fetch_C, op_RRC, store2_C ;09 ;RRC C | |
3203 | instr fetch_D, op_RRC, store2_D ;0A ;RRC D | |
3204 | instr fetch_E, op_RRC, store2_E ;0B ;RRC E | |
3205 | instr fetch_H, op_RRC, store2_H ;0C ;RRC H | |
3206 | instr fetch_L, op_RRC, store2_L ;0D ;RRC L | |
3207 | instr fetch2_mhl, op_RRC, store_MHL ;0E ;RRC (HL) | |
3208 | instr fetch_A, op_RRC, store2_A ;0F ;RRC A | |
3209 | instr fetch_B, op_RL, store2_B ;10 ;RL B | |
3210 | instr fetch_C, op_RL, store2_C ;11 ;RL C | |
3211 | instr fetch_D, op_RL, store2_D ;12 ;RL D | |
3212 | instr fetch_E, op_RL, store2_E ;13 ;RL E | |
3213 | instr fetch_H, op_RL, store2_H ;14 ;RL H | |
3214 | instr fetch_L, op_RL, store2_L ;15 ;RL L | |
3215 | instr fetch2_mhl, op_RL, store_MHL ;16 ;RL (HL) | |
3216 | instr fetch_A, op_RL, store2_A ;17 ;RL A | |
3217 | instr fetch_B, op_RR, store2_B ;18 ;RR B | |
3218 | instr fetch_C, op_RR, store2_C ;19 ;RR C | |
3219 | instr fetch_D, op_RR, store2_D ;1A ;RR D | |
3220 | instr fetch_E, op_RR, store2_E ;1B ;RR E | |
3221 | instr fetch_H, op_RR, store2_H ;1C ;RR H | |
3222 | instr fetch_L, op_RR, store2_L ;1D ;RR L | |
3223 | instr fetch2_mhl, op_RR, store_MHL ;1E ;RR (HL) | |
3224 | instr fetch_A, op_RR, store2_A ;1F ;RR A | |
3225 | instr fetch_B, op_SLA, store2_B ;20 ;SLA B | |
3226 | instr fetch_C, op_SLA, store2_C ;21 ;SLA C | |
3227 | instr fetch_D, op_SLA, store2_D ;22 ;SLA D | |
3228 | instr fetch_E, op_SLA, store2_E ;23 ;SLA E | |
3229 | instr fetch_H, op_SLA, store2_H ;24 ;SLA H | |
3230 | instr fetch_L, op_SLA, store2_L ;25 ;SLA L | |
3231 | instr fetch2_mhl, op_SLA, store_MHL ;26 ;SLA (HL) | |
3232 | instr fetch_A, op_SLA, store2_A ;27 ;SLA A | |
3233 | instr fetch_B, op_SRA, store2_B ;28 ;SRA B | |
3234 | instr fetch_C, op_SRA, store2_C ;29 ;SRA C | |
3235 | instr fetch_D, op_SRA, store2_D ;2A ;SRA D | |
3236 | instr fetch_E, op_SRA, store2_E ;2B ;SRA E | |
3237 | instr fetch_H, op_SRA, store2_H ;2C ;SRA H | |
3238 | instr fetch_L, op_SRA, store2_L ;2D ;SRA L | |
3239 | instr fetch2_mhl, op_SRA, store_MHL ;2E ;SRA (HL) | |
3240 | instr fetch_A, op_SRA, store2_A ;2F ;SRA A | |
3241 | instr fetch_B, op_SLL, store2_B ;30 ;SLL B | |
3242 | instr fetch_C, op_SLL, store2_C ;31 ;SLL C | |
3243 | instr fetch_D, op_SLL, store2_D ;32 ;SLL D | |
3244 | instr fetch_E, op_SLL, store2_E ;33 ;SLL E | |
3245 | instr fetch_H, op_SLL, store2_H ;34 ;SLL H | |
3246 | instr fetch_L, op_SLL, store2_L ;35 ;SLL L | |
3247 | instr fetch2_mhl, op_SLL, store_MHL ;36 ;SLL (HL) | |
3248 | instr fetch_A, op_SLL, store2_A ;37 ;SLL A | |
3249 | instr fetch_B, op_SRL, store2_B ;38 ;SRL B | |
3250 | instr fetch_C, op_SRL, store2_C ;39 ;SRL C | |
3251 | instr fetch_D, op_SRL, store2_D ;3A ;SRL D | |
3252 | instr fetch_E, op_SRL, store2_E ;3B ;SRL E | |
3253 | instr fetch_H, op_SRL, store2_H ;3C ;SRL H | |
3254 | instr fetch_L, op_SRL, store2_L ;3D ;SRL L | |
3255 | instr fetch2_mhl, op_SRL, store_MHL ;3E ;SRL (HL) | |
3256 | instr fetch_A, op_SRL, store2_A ;3F ;SRL A | |
4c92af0d L |
3257 | instr fetch_B, op_BIT0, store_nop ;40 ;BIT 0,B |
3258 | instr fetch_C, op_BIT0, store_nop ;41 ;BIT 0,C | |
3259 | instr fetch_D, op_BIT0, store_nop ;42 ;BIT 0,D | |
3260 | instr fetch_E, op_BIT0, store_nop ;43 ;BIT 0,E | |
3261 | instr fetch_H, op_BIT0, store_nop ;44 ;BIT 0,H | |
3262 | instr fetch_L, op_BIT0, store_nop ;45 ;BIT 0,L | |
fb050095 | 3263 | instr fetch2_mhl, op_BIT0, store_nop ;46 ;BIT 0,(HL) |
4c92af0d L |
3264 | instr fetch_A, op_BIT0, store_nop ;47 ;BIT 0,A |
3265 | instr fetch_B, op_BIT1, store_nop ;48 ;BIT 1,B | |
3266 | instr fetch_C, op_BIT1, store_nop ;49 ;BIT 1,C | |
3267 | instr fetch_D, op_BIT1, store_nop ;4A ;BIT 1,D | |
3268 | instr fetch_E, op_BIT1, store_nop ;4B ;BIT 1,E | |
3269 | instr fetch_H, op_BIT1, store_nop ;4C ;BIT 1,H | |
3270 | instr fetch_L, op_BIT1, store_nop ;4D ;BIT 1,L | |
fb050095 | 3271 | instr fetch2_mhl, op_BIT1, store_nop ;4E ;BIT 1,(HL) |
4c92af0d L |
3272 | instr fetch_A, op_BIT1, store_nop ;4F ;BIT 1,A |
3273 | instr fetch_B, op_BIT2, store_nop ;50 ;BIT 2,B | |
3274 | instr fetch_C, op_BIT2, store_nop ;51 ;BIT 2,C | |
3275 | instr fetch_D, op_BIT2, store_nop ;52 ;BIT 2,D | |
3276 | instr fetch_E, op_BIT2, store_nop ;53 ;BIT 2,E | |
3277 | instr fetch_H, op_BIT2, store_nop ;54 ;BIT 2,H | |
3278 | instr fetch_L, op_BIT2, store_nop ;55 ;BIT 2,L | |
fb050095 | 3279 | instr fetch2_mhl, op_BIT2, store_nop ;56 ;BIT 2,(HL) |
4c92af0d L |
3280 | instr fetch_A, op_BIT2, store_nop ;57 ;BIT 2,A |
3281 | instr fetch_B, op_BIT3, store_nop ;58 ;BIT 3,B | |
3282 | instr fetch_C, op_BIT3, store_nop ;59 ;BIT 3,C | |
3283 | instr fetch_D, op_BIT3, store_nop ;5A ;BIT 3,D | |
3284 | instr fetch_E, op_BIT3, store_nop ;5B ;BIT 3,E | |
3285 | instr fetch_H, op_BIT3, store_nop ;5C ;BIT 3,H | |
3286 | instr fetch_L, op_BIT3, store_nop ;5D ;BIT 3,L | |
fb050095 | 3287 | instr fetch2_mhl, op_BIT3, store_nop ;5E ;BIT 3,(HL) |
4c92af0d L |
3288 | instr fetch_A, op_BIT3, store_nop ;5F ;BIT 3,A |
3289 | instr fetch_B, op_BIT4, store_nop ;60 ;BIT 4,B | |
3290 | instr fetch_C, op_BIT4, store_nop ;61 ;BIT 4,C | |
3291 | instr fetch_D, op_BIT4, store_nop ;62 ;BIT 4,D | |
3292 | instr fetch_E, op_BIT4, store_nop ;63 ;BIT 4,E | |
3293 | instr fetch_H, op_BIT4, store_nop ;64 ;BIT 4,H | |
3294 | instr fetch_L, op_BIT4, store_nop ;65 ;BIT 4,L | |
fb050095 | 3295 | instr fetch2_mhl, op_BIT4, store_nop ;66 ;BIT 4,(HL) |
4c92af0d L |
3296 | instr fetch_A, op_BIT4, store_nop ;67 ;BIT 4,A |
3297 | instr fetch_B, op_BIT5, store_nop ;68 ;BIT 5,B | |
3298 | instr fetch_C, op_BIT5, store_nop ;69 ;BIT 5,C | |
3299 | instr fetch_D, op_BIT5, store_nop ;6A ;BIT 5,D | |
3300 | instr fetch_E, op_BIT5, store_nop ;6B ;BIT 5,E | |
3301 | instr fetch_H, op_BIT5, store_nop ;6C ;BIT 5,H | |
3302 | instr fetch_L, op_BIT5, store_nop ;6D ;BIT 5,L | |
fb050095 | 3303 | instr fetch2_mhl, op_BIT5, store_nop ;6E ;BIT 5,(HL) |
4c92af0d L |
3304 | instr fetch_A, op_BIT5, store_nop ;6F ;BIT 5,A |
3305 | instr fetch_B, op_BIT6, store_nop ;70 ;BIT 6,B | |
3306 | instr fetch_C, op_BIT6, store_nop ;71 ;BIT 6,C | |
3307 | instr fetch_D, op_BIT6, store_nop ;72 ;BIT 6,D | |
3308 | instr fetch_E, op_BIT6, store_nop ;73 ;BIT 6,E | |
3309 | instr fetch_H, op_BIT6, store_nop ;74 ;BIT 6,H | |
3310 | instr fetch_L, op_BIT6, store_nop ;75 ;BIT 6,L | |
fb050095 | 3311 | instr fetch2_mhl, op_BIT6, store_nop ;76 ;BIT 6,(HL) |
4c92af0d L |
3312 | instr fetch_A, op_BIT6, store_nop ;77 ;BIT 6,A |
3313 | instr fetch_B, op_BIT7, store_nop ;78 ;BIT 7,B | |
3314 | instr fetch_C, op_BIT7, store_nop ;79 ;BIT 7,C | |
3315 | instr fetch_D, op_BIT7, store_nop ;7A ;BIT 7,D | |
3316 | instr fetch_E, op_BIT7, store_nop ;7B ;BIT 7,E | |
3317 | instr fetch_H, op_BIT7, store_nop ;7C ;BIT 7,H | |
3318 | instr fetch_L, op_BIT7, store_nop ;7D ;BIT 7,L | |
fb050095 | 3319 | instr fetch2_mhl, op_BIT7, store_nop ;7E ;BIT 7,(HL) |
4c92af0d | 3320 | instr fetch_A, op_BIT7, store_nop ;7F ;BIT 7,A |
fb050095 L |
3321 | instr fetch_B, op_RES0, store2_B ;80 ;RES 0,B |
3322 | instr fetch_C, op_RES0, store2_C ;81 ;RES 0,C | |
3323 | instr fetch_D, op_RES0, store2_D ;82 ;RES 0,D | |
3324 | instr fetch_E, op_RES0, store2_E ;83 ;RES 0,E | |
3325 | instr fetch_H, op_RES0, store2_H ;84 ;RES 0,H | |
3326 | instr fetch_L, op_RES0, store2_L ;85 ;RES 0,L | |
3327 | instr fetch2_mhl, op_RES0, store_MHL ;86 ;RES 0,(HL) | |
3328 | instr fetch_A, op_RES0, store2_A ;87 ;RES 0,A | |
3329 | instr fetch_B, op_RES1, store2_B ;88 ;RES 1,B | |
3330 | instr fetch_C, op_RES1, store2_C ;89 ;RES 1,C | |
3331 | instr fetch_D, op_RES1, store2_D ;8A ;RES 1,D | |
3332 | instr fetch_E, op_RES1, store2_E ;8B ;RES 1,E | |
3333 | instr fetch_H, op_RES1, store2_H ;8C ;RES 1,H | |
3334 | instr fetch_L, op_RES1, store2_L ;8D ;RES 1,L | |
3335 | instr fetch2_mhl, op_RES1, store_MHL ;8E ;RES 1,(HL) | |
3336 | instr fetch_A, op_RES1, store2_A ;8F ;RES 1,A | |
3337 | instr fetch_B, op_RES2, store2_B ;90 ;RES 2,B | |
3338 | instr fetch_C, op_RES2, store2_C ;91 ;RES 2,C | |
3339 | instr fetch_D, op_RES2, store2_D ;92 ;RES 2,D | |
3340 | instr fetch_E, op_RES2, store2_E ;93 ;RES 2,E | |
3341 | instr fetch_H, op_RES2, store2_H ;94 ;RES 2,H | |
3342 | instr fetch_L, op_RES2, store2_L ;95 ;RES 2,L | |
3343 | instr fetch2_mhl, op_RES2, store_MHL ;96 ;RES 2,(HL) | |
3344 | instr fetch_A, op_RES2, store2_A ;97 ;RES 2,A | |
3345 | instr fetch_B, op_RES3, store2_B ;98 ;RES 3,B | |
3346 | instr fetch_C, op_RES3, store2_C ;99 ;RES 3,C | |
3347 | instr fetch_D, op_RES3, store2_D ;9A ;RES 3,D | |
3348 | instr fetch_E, op_RES3, store2_E ;9B ;RES 3,E | |
3349 | instr fetch_H, op_RES3, store2_H ;9C ;RES 3,H | |
3350 | instr fetch_L, op_RES3, store2_L ;9D ;RES 3,L | |
3351 | instr fetch2_mhl, op_RES3, store_MHL ;9E ;RES 3,(HL) | |
3352 | instr fetch_A, op_RES3, store2_A ;9F ;RES 3,A | |
3353 | instr fetch_B, op_RES4, store2_B ;A0 ;RES 4,B | |
3354 | instr fetch_C, op_RES4, store2_C ;A1 ;RES 4,C | |
3355 | instr fetch_D, op_RES4, store2_D ;A2 ;RES 4,D | |
3356 | instr fetch_E, op_RES4, store2_E ;A3 ;RES 4,E | |
3357 | instr fetch_H, op_RES4, store2_H ;A4 ;RES 4,H | |
3358 | instr fetch_L, op_RES4, store2_L ;A5 ;RES 4,L | |
3359 | instr fetch2_mhl, op_RES4, store_MHL ;A6 ;RES 4,(HL) | |
3360 | instr fetch_A, op_RES4, store2_A ;A7 ;RES 4,A | |
3361 | instr fetch_B, op_RES5, store2_B ;A8 ;RES 5,B | |
3362 | instr fetch_C, op_RES5, store2_C ;A9 ;RES 5,C | |
3363 | instr fetch_D, op_RES5, store2_D ;AA ;RES 5,D | |
3364 | instr fetch_E, op_RES5, store2_E ;AB ;RES 5,E | |
3365 | instr fetch_H, op_RES5, store2_H ;AC ;RES 5,H | |
3366 | instr fetch_L, op_RES5, store2_L ;AD ;RES 5,L | |
3367 | instr fetch2_mhl, op_RES5, store_MHL ;AE ;RES 5,(HL) | |
3368 | instr fetch_A, op_RES5, store2_A ;AF ;RES 5,A | |
3369 | instr fetch_B, op_RES6, store2_B ;B0 ;RES 6,B | |
3370 | instr fetch_C, op_RES6, store2_C ;B1 ;RES 6,C | |
3371 | instr fetch_D, op_RES6, store2_D ;B2 ;RES 6,D | |
3372 | instr fetch_E, op_RES6, store2_E ;B3 ;RES 6,E | |
3373 | instr fetch_H, op_RES6, store2_H ;B4 ;RES 6,H | |
3374 | instr fetch_L, op_RES6, store2_L ;B5 ;RES 6,L | |
3375 | instr fetch2_mhl, op_RES6, store_MHL ;B6 ;RES 6,(HL) | |
3376 | instr fetch_A, op_RES6, store2_A ;B7 ;RES 6,A | |
3377 | instr fetch_B, op_RES7, store2_B ;B8 ;RES 7,B | |
3378 | instr fetch_C, op_RES7, store2_C ;B9 ;RES 7,C | |
3379 | instr fetch_D, op_RES7, store2_D ;BA ;RES 7,D | |
3380 | instr fetch_E, op_RES7, store2_E ;BB ;RES 7,E | |
3381 | instr fetch_H, op_RES7, store2_H ;BC ;RES 7,H | |
3382 | instr fetch_L, op_RES7, store2_L ;BD ;RES 7,L | |
3383 | instr fetch2_mhl, op_RES7, store_MHL ;BE ;RES 7,(HL) | |
3384 | instr fetch_A, op_RES7, store2_A ;BF ;RES 7,A | |
3385 | instr fetch_B, op_SET0, store2_B ;C0 ;SET 0,B | |
3386 | instr fetch_C, op_SET0, store2_C ;C1 ;SET 0,C | |
3387 | instr fetch_D, op_SET0, store2_D ;C2 ;SET 0,D | |
3388 | instr fetch_E, op_SET0, store2_E ;C3 ;SET 0,E | |
3389 | instr fetch_H, op_SET0, store2_H ;C4 ;SET 0,H | |
3390 | instr fetch_L, op_SET0, store2_L ;C5 ;SET 0,L | |
3391 | instr fetch2_mhl, op_SET0, store_MHL ;C6 ;SET 0,(HL) | |
3392 | instr fetch_A, op_SET0, store2_A ;C7 ;SET 0,A | |
3393 | instr fetch_B, op_SET1, store2_B ;C8 ;SET 1,B | |
3394 | instr fetch_C, op_SET1, store2_C ;C9 ;SET 1,C | |
3395 | instr fetch_D, op_SET1, store2_D ;CA ;SET 1,D | |
3396 | instr fetch_E, op_SET1, store2_E ;CB ;SET 1,E | |
3397 | instr fetch_H, op_SET1, store2_H ;CC ;SET 1,H | |
3398 | instr fetch_L, op_SET1, store2_L ;CD ;SET 1,L | |
3399 | instr fetch2_mhl, op_SET1, store_MHL ;CE ;SET 1,(HL) | |
3400 | instr fetch_A, op_SET1, store2_A ;CF ;SET 1,A | |
3401 | instr fetch_B, op_SET2, store2_B ;D0 ;SET 2,B | |
3402 | instr fetch_C, op_SET2, store2_C ;D1 ;SET 2,C | |
3403 | instr fetch_D, op_SET2, store2_D ;D2 ;SET 2,D | |
3404 | instr fetch_E, op_SET2, store2_E ;D3 ;SET 2,E | |
3405 | instr fetch_H, op_SET2, store2_H ;D4 ;SET 2,H | |
3406 | instr fetch_L, op_SET2, store2_L ;D5 ;SET 2,L | |
3407 | instr fetch2_mhl, op_SET2, store_MHL ;D6 ;SET 2,(HL) | |
3408 | instr fetch_A, op_SET2, store2_A ;D7 ;SET 2,A | |
3409 | instr fetch_B, op_SET3, store2_B ;D8 ;SET 3,B | |
3410 | instr fetch_C, op_SET3, store2_C ;D9 ;SET 3,C | |
3411 | instr fetch_D, op_SET3, store2_D ;DA ;SET 3,D | |
3412 | instr fetch_E, op_SET3, store2_E ;DB ;SET 3,E | |
3413 | instr fetch_H, op_SET3, store2_H ;DC ;SET 3,H | |
3414 | instr fetch_L, op_SET3, store2_L ;DD ;SET 3,L | |
3415 | instr fetch2_mhl, op_SET3, store_MHL ;DE ;SET 3,(HL) | |
3416 | instr fetch_A, op_SET3, store2_A ;DF ;SET 3,A | |
3417 | instr fetch_B, op_SET4, store2_B ;E0 ;SET 4,B | |
3418 | instr fetch_C, op_SET4, store2_C ;E1 ;SET 4,C | |
3419 | instr fetch_D, op_SET4, store2_D ;E2 ;SET 4,D | |
3420 | instr fetch_E, op_SET4, store2_E ;E3 ;SET 4,E | |
3421 | instr fetch_H, op_SET4, store2_H ;E4 ;SET 4,H | |
3422 | instr fetch_L, op_SET4, store2_L ;E5 ;SET 4,L | |
3423 | instr fetch2_mhl, op_SET4, store_MHL ;E6 ;SET 4,(HL) | |
3424 | instr fetch_A, op_SET4, store2_A ;E7 ;SET 4,A | |
3425 | instr fetch_B, op_SET5, store2_B ;E8 ;SET 5,B | |
3426 | instr fetch_C, op_SET5, store2_C ;E9 ;SET 5,C | |
3427 | instr fetch_D, op_SET5, store2_D ;EA ;SET 5,D | |
3428 | instr fetch_E, op_SET5, store2_E ;EB ;SET 5,E | |
3429 | instr fetch_H, op_SET5, store2_H ;EC ;SET 5,H | |
3430 | instr fetch_L, op_SET5, store2_L ;ED ;SET 5,L | |
3431 | instr fetch2_mhl, op_SET5, store_MHL ;EE ;SET 5,(HL) | |
3432 | instr fetch_A, op_SET5, store2_A ;EF ;SET 5,A | |
3433 | instr fetch_B, op_SET6, store2_B ;F0 ;SET 6,B | |
3434 | instr fetch_C, op_SET6, store2_C ;F1 ;SET 6,C | |
3435 | instr fetch_D, op_SET6, store2_D ;F2 ;SET 6,D | |
3436 | instr fetch_E, op_SET6, store2_E ;F3 ;SET 6,E | |
3437 | instr fetch_H, op_SET6, store2_H ;F4 ;SET 6,H | |
3438 | instr fetch_L, op_SET6, store2_L ;F5 ;SET 6,L | |
3439 | instr fetch2_mhl, op_SET6, store_MHL ;F6 ;SET 6,(HL) | |
3440 | instr fetch_A, op_SET6, store2_A ;F7 ;SET 6,A | |
3441 | instr fetch_B, op_SET7, store2_B ;F8 ;SET 7,B | |
3442 | instr fetch_C, op_SET7, store2_C ;F9 ;SET 7,C | |
3443 | instr fetch_D, op_SET7, store2_D ;FA ;SET 7,D | |
3444 | instr fetch_E, op_SET7, store2_E ;FB ;SET 7,E | |
3445 | instr fetch_H, op_SET7, store2_H ;FC ;SET 7,H | |
3446 | instr fetch_L, op_SET7, store2_L ;FD ;SET 7,L | |
3447 | instr fetch2_mhl, op_SET7, store_MHL ;FE ;SET 7,(HL) | |
3448 | instr fetch_A, op_SET7, store2_A ;FF ;SET 7,A | |
fa9059af L |
3449 | |
3450 | ||
623dd899 | 3451 | opctable DDFDCBjmp, PC ;+256 |
fa9059af | 3452 | |
fb050095 L |
3453 | instr fetch_nop, op_RLC, store2_B ;00 ;RLC (Ix+d),B |
3454 | instr fetch_nop, op_RLC, store2_C ;01 ;RLC (Ix+d),C | |
3455 | instr fetch_nop, op_RLC, store2_D ;02 ;RLC (Ix+d),D | |
3456 | instr fetch_nop, op_RLC, store2_E ;03 ;RLC (Ix+d),E | |
3457 | instr fetch_nop, op_RLC, store2_H ;04 ;RLC (Ix+d),H | |
3458 | instr fetch_nop, op_RLC, store2_L ;05 ;RLC (Ix+d),L | |
096f3a91 | 3459 | instr fetch_nop, op_RLC, store_nop ;06 ;RLC (Ix+d) |
fb050095 L |
3460 | instr fetch_nop, op_RLC, store2_A ;07 ;RLC (Ix+d),A |
3461 | instr fetch_nop, op_RRC, store2_B ;08 ;RRC (Ix+d),B | |
3462 | instr fetch_nop, op_RRC, store2_C ;09 ;RRC (Ix+d),C | |
3463 | instr fetch_nop, op_RRC, store2_D ;0A ;RRC (Ix+d),D | |
3464 | instr fetch_nop, op_RRC, store2_E ;0B ;RRC (Ix+d),E | |
3465 | instr fetch_nop, op_RRC, store2_H ;0C ;RRC (Ix+d),H | |
3466 | instr fetch_nop, op_RRC, store2_L ;0D ;RRC (Ix+d),L | |
096f3a91 | 3467 | instr fetch_nop, op_RRC, store_nop ;0E ;RRC (Ix+d) |
fb050095 L |
3468 | instr fetch_nop, op_RRC, store2_A ;0F ;RRC (Ix+d),A |
3469 | instr fetch_nop, op_RL, store2_B ;10 ;RL (Ix+d),B | |
3470 | instr fetch_nop, op_RL, store2_C ;11 ;RL (Ix+d),C | |
3471 | instr fetch_nop, op_RL, store2_D ;12 ;RL (Ix+d),D | |
3472 | instr fetch_nop, op_RL, store2_E ;13 ;RL (Ix+d),E | |
3473 | instr fetch_nop, op_RL, store2_H ;14 ;RL (Ix+d),H | |
3474 | instr fetch_nop, op_RL, store2_L ;15 ;RL (Ix+d),L | |
096f3a91 | 3475 | instr fetch_nop, op_RL, store_nop ;16 ;RL (Ix+d) |
fb050095 L |
3476 | instr fetch_nop, op_RL, store2_A ;17 ;RL (Ix+d),A |
3477 | instr fetch_nop, op_RR, store2_B ;18 ;RR (Ix+d),B | |
3478 | instr fetch_nop, op_RR, store2_C ;19 ;RR (Ix+d),C | |
3479 | instr fetch_nop, op_RR, store2_D ;1A ;RR (Ix+d),D | |
3480 | instr fetch_nop, op_RR, store2_E ;1B ;RR (Ix+d),E | |
3481 | instr fetch_nop, op_RR, store2_H ;1C ;RR (Ix+d),H | |
3482 | instr fetch_nop, op_RR, store2_L ;1D ;RR (Ix+d),L | |
096f3a91 | 3483 | instr fetch_nop, op_RR, store_nop ;1E ;RR (Ix+d) |
fb050095 L |
3484 | instr fetch_nop, op_RR, store2_A ;1F ;RR (Ix+d),A |
3485 | instr fetch_nop, op_SLA, store2_B ;20 ;SLA (Ix+d),B | |
3486 | instr fetch_nop, op_SLA, store2_C ;21 ;SLA (Ix+d),C | |
3487 | instr fetch_nop, op_SLA, store2_D ;22 ;SLA (Ix+d),D | |
3488 | instr fetch_nop, op_SLA, store2_E ;23 ;SLA (Ix+d),E | |
3489 | instr fetch_nop, op_SLA, store2_H ;24 ;SLA (Ix+d),H | |
3490 | instr fetch_nop, op_SLA, store2_L ;25 ;SLA (Ix+d),L | |
096f3a91 | 3491 | instr fetch_nop, op_SLA, store_nop ;26 ;SLA (Ix+d) |
fb050095 L |
3492 | instr fetch_nop, op_SLA, store2_A ;27 ;SLA (Ix+d),A |
3493 | instr fetch_nop, op_SRA, store2_B ;28 ;SRA (Ix+d),B | |
3494 | instr fetch_nop, op_SRA, store2_C ;29 ;SRA (Ix+d),C | |
3495 | instr fetch_nop, op_SRA, store2_D ;2A ;SRA (Ix+d),D | |
3496 | instr fetch_nop, op_SRA, store2_E ;2B ;SRA (Ix+d),E | |
3497 | instr fetch_nop, op_SRA, store2_H ;2C ;SRA (Ix+d),H | |
3498 | instr fetch_nop, op_SRA, store2_L ;2D ;SRA (Ix+d),L | |
096f3a91 | 3499 | instr fetch_nop, op_SRA, store_nop ;2E ;SRA (Ix+d) |
fb050095 L |
3500 | instr fetch_nop, op_SRA, store2_A ;2F ;SRA (Ix+d),A |
3501 | instr fetch_nop, op_SLL, store2_B ;30 ;SLL (Ix+d),B | |
3502 | instr fetch_nop, op_SLL, store2_C ;31 ;SLL (Ix+d),C | |
3503 | instr fetch_nop, op_SLL, store2_D ;32 ;SLL (Ix+d),D | |
3504 | instr fetch_nop, op_SLL, store2_E ;33 ;SLL (Ix+d),E | |
3505 | instr fetch_nop, op_SLL, store2_H ;34 ;SLL (Ix+d),H | |
3506 | instr fetch_nop, op_SLL, store2_L ;35 ;SLL (Ix+d),L | |
096f3a91 | 3507 | instr fetch_nop, op_SLL, store_nop ;36 ;SLL (Ix+d) |
fb050095 L |
3508 | instr fetch_nop, op_SLL, store2_A ;37 ;SLL (Ix+d),A |
3509 | instr fetch_nop, op_SRL, store2_B ;38 ;SRL (Ix+d),B | |
3510 | instr fetch_nop, op_SRL, store2_C ;39 ;SRL (Ix+d),C | |
3511 | instr fetch_nop, op_SRL, store2_D ;3A ;SRL (Ix+d),D | |
3512 | instr fetch_nop, op_SRL, store2_E ;3B ;SRL (Ix+d),E | |
3513 | instr fetch_nop, op_SRL, store2_H ;3C ;SRL (Ix+d),H | |
3514 | instr fetch_nop, op_SRL, store2_L ;3D ;SRL (Ix+d),L | |
096f3a91 | 3515 | instr fetch_nop, op_SRL, store_nop ;3E ;SRL (Ix+d) |
fb050095 | 3516 | instr fetch_nop, op_SRL, store2_A ;3F ;SRL (Ix+d),A |
e7a0f403 L |
3517 | instr fetch_nop, op_BIT0, store_nop ;40 ;BIT 0,(Ix+d),B |
3518 | instr fetch_nop, op_BIT0, store_nop ;41 ;BIT 0,(Ix+d),C | |
3519 | instr fetch_nop, op_BIT0, store_nop ;42 ;BIT 0,(Ix+d),D | |
3520 | instr fetch_nop, op_BIT0, store_nop ;43 ;BIT 0,(Ix+d),E | |
3521 | instr fetch_nop, op_BIT0, store_nop ;44 ;BIT 0,(Ix+d),H | |
3522 | instr fetch_nop, op_BIT0, store_nop ;45 ;BIT 0,(Ix+d),L | |
3523 | instr fetch_nop, op_BIT0, store_nop ;46 ;BIT 0,(Ix+d) | |
3524 | instr fetch_nop, op_BIT0, store_nop ;47 ;BIT 0,(Ix+d),A | |
3525 | instr fetch_nop, op_BIT1, store_nop ;48 ;BIT 1,(Ix+d),B | |
3526 | instr fetch_nop, op_BIT1, store_nop ;49 ;BIT 1,(Ix+d),C | |
3527 | instr fetch_nop, op_BIT1, store_nop ;4A ;BIT 1,(Ix+d),D | |
3528 | instr fetch_nop, op_BIT1, store_nop ;4B ;BIT 1,(Ix+d),E | |
3529 | instr fetch_nop, op_BIT1, store_nop ;4C ;BIT 1,(Ix+d),H | |
3530 | instr fetch_nop, op_BIT1, store_nop ;4D ;BIT 1,(Ix+d),L | |
3531 | instr fetch_nop, op_BIT1, store_nop ;4E ;BIT 1,(Ix+d) | |
3532 | instr fetch_nop, op_BIT1, store_nop ;4F ;BIT 1,(Ix+d),A | |
3533 | instr fetch_nop, op_BIT2, store_nop ;50 ;BIT 2,(Ix+d),B | |
3534 | instr fetch_nop, op_BIT2, store_nop ;51 ;BIT 2,(Ix+d),C | |
3535 | instr fetch_nop, op_BIT2, store_nop ;52 ;BIT 2,(Ix+d),D | |
3536 | instr fetch_nop, op_BIT2, store_nop ;53 ;BIT 2,(Ix+d),E | |
3537 | instr fetch_nop, op_BIT2, store_nop ;54 ;BIT 2,(Ix+d),H | |
3538 | instr fetch_nop, op_BIT2, store_nop ;55 ;BIT 2,(Ix+d),L | |
3539 | instr fetch_nop, op_BIT2, store_nop ;56 ;BIT 2,(Ix+d) | |
3540 | instr fetch_nop, op_BIT2, store_nop ;57 ;BIT 2,(Ix+d),A | |
3541 | instr fetch_nop, op_BIT3, store_nop ;58 ;BIT 3,(Ix+d),B | |
3542 | instr fetch_nop, op_BIT3, store_nop ;59 ;BIT 3,(Ix+d),C | |
3543 | instr fetch_nop, op_BIT3, store_nop ;5A ;BIT 3,(Ix+d),D | |
3544 | instr fetch_nop, op_BIT3, store_nop ;5B ;BIT 3,(Ix+d),E | |
3545 | instr fetch_nop, op_BIT3, store_nop ;5C ;BIT 3,(Ix+d),H | |
3546 | instr fetch_nop, op_BIT3, store_nop ;5D ;BIT 3,(Ix+d),L | |
3547 | instr fetch_nop, op_BIT3, store_nop ;5E ;BIT 3,(Ix+d) | |
3548 | instr fetch_nop, op_BIT3, store_nop ;5F ;BIT 3,(Ix+d),A | |
3549 | instr fetch_nop, op_BIT4, store_nop ;60 ;BIT 4,(Ix+d),B | |
3550 | instr fetch_nop, op_BIT4, store_nop ;61 ;BIT 4,(Ix+d),C | |
3551 | instr fetch_nop, op_BIT4, store_nop ;62 ;BIT 4,(Ix+d),D | |
3552 | instr fetch_nop, op_BIT4, store_nop ;63 ;BIT 4,(Ix+d),E | |
3553 | instr fetch_nop, op_BIT4, store_nop ;64 ;BIT 4,(Ix+d),H | |
3554 | instr fetch_nop, op_BIT4, store_nop ;65 ;BIT 4,(Ix+d),L | |
3555 | instr fetch_nop, op_BIT4, store_nop ;66 ;BIT 4,(Ix+d) | |
3556 | instr fetch_nop, op_BIT4, store_nop ;67 ;BIT 4,(Ix+d),A | |
3557 | instr fetch_nop, op_BIT5, store_nop ;68 ;BIT 5,(Ix+d),B | |
3558 | instr fetch_nop, op_BIT5, store_nop ;69 ;BIT 5,(Ix+d),C | |
3559 | instr fetch_nop, op_BIT5, store_nop ;6A ;BIT 5,(Ix+d),D | |
3560 | instr fetch_nop, op_BIT5, store_nop ;6B ;BIT 5,(Ix+d),E | |
3561 | instr fetch_nop, op_BIT5, store_nop ;6C ;BIT 5,(Ix+d),H | |
3562 | instr fetch_nop, op_BIT5, store_nop ;6D ;BIT 5,(Ix+d),L | |
3563 | instr fetch_nop, op_BIT5, store_nop ;6E ;BIT 5,(Ix+d) | |
3564 | instr fetch_nop, op_BIT5, store_nop ;6F ;BIT 5,(Ix+d),A | |
3565 | instr fetch_nop, op_BIT6, store_nop ;70 ;BIT 6,(Ix+d),B | |
3566 | instr fetch_nop, op_BIT6, store_nop ;71 ;BIT 6,(Ix+d),C | |
3567 | instr fetch_nop, op_BIT6, store_nop ;72 ;BIT 6,(Ix+d),D | |
3568 | instr fetch_nop, op_BIT6, store_nop ;73 ;BIT 6,(Ix+d),E | |
3569 | instr fetch_nop, op_BIT6, store_nop ;74 ;BIT 6,(Ix+d),H | |
3570 | instr fetch_nop, op_BIT6, store_nop ;75 ;BIT 6,(Ix+d),L | |
3571 | instr fetch_nop, op_BIT6, store_nop ;76 ;BIT 6,(Ix+d) | |
3572 | instr fetch_nop, op_BIT6, store_nop ;77 ;BIT 6,(Ix+d),A | |
3573 | instr fetch_nop, op_BIT7, store_nop ;78 ;BIT 7,(Ix+d),B | |
3574 | instr fetch_nop, op_BIT7, store_nop ;79 ;BIT 7,(Ix+d),C | |
3575 | instr fetch_nop, op_BIT7, store_nop ;7A ;BIT 7,(Ix+d),D | |
3576 | instr fetch_nop, op_BIT7, store_nop ;7B ;BIT 7,(Ix+d),E | |
3577 | instr fetch_nop, op_BIT7, store_nop ;7C ;BIT 7,(Ix+d),H | |
3578 | instr fetch_nop, op_BIT7, store_nop ;7D ;BIT 7,(Ix+d),L | |
3579 | instr fetch_nop, op_BIT7, store_nop ;7E ;BIT 7,(Ix+d) | |
3580 | instr fetch_nop, op_BIT7, store_nop ;7F ;BIT 7,(Ix+d),A | |
fb050095 L |
3581 | instr fetch_nop, op_RES0, store2_B ;80 ;RES 0,(Ix+d),B |
3582 | instr fetch_nop, op_RES0, store2_C ;81 ;RES 0,(Ix+d),C | |
3583 | instr fetch_nop, op_RES0, store2_D ;82 ;RES 0,(Ix+d),D | |
3584 | instr fetch_nop, op_RES0, store2_E ;83 ;RES 0,(Ix+d),E | |
3585 | instr fetch_nop, op_RES0, store2_H ;84 ;RES 0,(Ix+d),H | |
3586 | instr fetch_nop, op_RES0, store2_L ;85 ;RES 0,(Ix+d),L | |
e7a0f403 | 3587 | instr fetch_nop, op_RES0, store_nop ;86 ;RES 0,(Ix+d) |
fb050095 L |
3588 | instr fetch_nop, op_RES0, store2_A ;87 ;RES 0,(Ix+d),A |
3589 | instr fetch_nop, op_RES1, store2_B ;88 ;RES 1,(Ix+d),B | |
3590 | instr fetch_nop, op_RES1, store2_C ;89 ;RES 1,(Ix+d),C | |
3591 | instr fetch_nop, op_RES1, store2_D ;8A ;RES 1,(Ix+d),D | |
3592 | instr fetch_nop, op_RES1, store2_E ;8B ;RES 1,(Ix+d),E | |
3593 | instr fetch_nop, op_RES1, store2_H ;8C ;RES 1,(Ix+d),H | |
3594 | instr fetch_nop, op_RES1, store2_L ;8D ;RES 1,(Ix+d),L | |
e7a0f403 | 3595 | instr fetch_nop, op_RES1, store_nop ;8E ;RES 1,(Ix+d) |
fb050095 L |
3596 | instr fetch_nop, op_RES1, store2_A ;8F ;RES 1,(Ix+d),A |
3597 | instr fetch_nop, op_RES2, store2_B ;90 ;RES 2,(Ix+d),B | |
3598 | instr fetch_nop, op_RES2, store2_C ;91 ;RES 2,(Ix+d),C | |
3599 | instr fetch_nop, op_RES2, store2_D ;92 ;RES 2,(Ix+d),D | |
3600 | instr fetch_nop, op_RES2, store2_E ;93 ;RES 2,(Ix+d),E | |
3601 | instr fetch_nop, op_RES2, store2_H ;94 ;RES 2,(Ix+d),H | |
3602 | instr fetch_nop, op_RES2, store2_L ;95 ;RES 2,(Ix+d),L | |
e7a0f403 | 3603 | instr fetch_nop, op_RES2, store_nop ;96 ;RES 2,(Ix+d) |
fb050095 L |
3604 | instr fetch_nop, op_RES2, store2_A ;97 ;RES 2,(Ix+d),A |
3605 | instr fetch_nop, op_RES3, store2_B ;98 ;RES 3,(Ix+d),B | |
3606 | instr fetch_nop, op_RES3, store2_C ;99 ;RES 3,(Ix+d),C | |
3607 | instr fetch_nop, op_RES3, store2_D ;9A ;RES 3,(Ix+d),D | |
3608 | instr fetch_nop, op_RES3, store2_E ;9B ;RES 3,(Ix+d),E | |
3609 | instr fetch_nop, op_RES3, store2_H ;9C ;RES 3,(Ix+d),H | |
3610 | instr fetch_nop, op_RES3, store2_L ;9D ;RES 3,(Ix+d),L | |
e7a0f403 | 3611 | instr fetch_nop, op_RES3, store_nop ;9E ;RES 3,(Ix+d) |
fb050095 L |
3612 | instr fetch_nop, op_RES3, store2_A ;9F ;RES 3,(Ix+d),A |
3613 | instr fetch_nop, op_RES4, store2_B ;A0 ;RES 4,(Ix+d),B | |
3614 | instr fetch_nop, op_RES4, store2_C ;A1 ;RES 4,(Ix+d),C | |
3615 | instr fetch_nop, op_RES4, store2_D ;A2 ;RES 4,(Ix+d),D | |
3616 | instr fetch_nop, op_RES4, store2_E ;A3 ;RES 4,(Ix+d),E | |
3617 | instr fetch_nop, op_RES4, store2_H ;A4 ;RES 4,(Ix+d),H | |
3618 | instr fetch_nop, op_RES4, store2_L ;A5 ;RES 4,(Ix+d),L | |
e7a0f403 | 3619 | instr fetch_nop, op_RES4, store_nop ;A6 ;RES 4,(Ix+d) |
fb050095 L |
3620 | instr fetch_nop, op_RES4, store2_A ;A7 ;RES 4,(Ix+d),A |
3621 | instr fetch_nop, op_RES5, store2_B ;A8 ;RES 5,(Ix+d),B | |
3622 | instr fetch_nop, op_RES5, store2_C ;A9 ;RES 5,(Ix+d),C | |
3623 | instr fetch_nop, op_RES5, store2_D ;AA ;RES 5,(Ix+d),D | |
3624 | instr fetch_nop, op_RES5, store2_E ;AB ;RES 5,(Ix+d),E | |
3625 | instr fetch_nop, op_RES5, store2_H ;AC ;RES 5,(Ix+d),H | |
3626 | instr fetch_nop, op_RES5, store2_L ;AD ;RES 5,(Ix+d),L | |
e7a0f403 | 3627 | instr fetch_nop, op_RES5, store_nop ;AE ;RES 5,(Ix+d) |
fb050095 L |
3628 | instr fetch_nop, op_RES5, store2_A ;AF ;RES 5,(Ix+d),A |
3629 | instr fetch_nop, op_RES6, store2_B ;B0 ;RES 6,(Ix+d),B | |
3630 | instr fetch_nop, op_RES6, store2_C ;B1 ;RES 6,(Ix+d),C | |
3631 | instr fetch_nop, op_RES6, store2_D ;B2 ;RES 6,(Ix+d),D | |
3632 | instr fetch_nop, op_RES6, store2_E ;B3 ;RES 6,(Ix+d),E | |
3633 | instr fetch_nop, op_RES6, store2_H ;B4 ;RES 6,(Ix+d),H | |
3634 | instr fetch_nop, op_RES6, store2_L ;B5 ;RES 6,(Ix+d),L | |
e7a0f403 | 3635 | instr fetch_nop, op_RES6, store_nop ;B6 ;RES 6,(Ix+d) |
fb050095 L |
3636 | instr fetch_nop, op_RES6, store2_A ;B7 ;RES 6,(Ix+d),A |
3637 | instr fetch_nop, op_RES7, store2_B ;B8 ;RES 7,(Ix+d),B | |
3638 | instr fetch_nop, op_RES7, store2_C ;B9 ;RES 7,(Ix+d),C | |
3639 | instr fetch_nop, op_RES7, store2_D ;BA ;RES 7,(Ix+d),D | |
3640 | instr fetch_nop, op_RES7, store2_E ;BB ;RES 7,(Ix+d),E | |
3641 | instr fetch_nop, op_RES7, store2_H ;BC ;RES 7,(Ix+d),H | |
3642 | instr fetch_nop, op_RES7, store2_L ;BD ;RES 7,(Ix+d),L | |
e7a0f403 | 3643 | instr fetch_nop, op_RES7, store_nop ;BE ;RES 7,(Ix+d) |
fb050095 L |
3644 | instr fetch_nop, op_RES7, store2_A ;BF ;RES 7,(Ix+d),A |
3645 | instr fetch_nop, op_SET0, store2_B ;C0 ;SET 0,(Ix+d),B | |
3646 | instr fetch_nop, op_SET0, store2_C ;C1 ;SET 0,(Ix+d),C | |
3647 | instr fetch_nop, op_SET0, store2_D ;C2 ;SET 0,(Ix+d),D | |
3648 | instr fetch_nop, op_SET0, store2_E ;C3 ;SET 0,(Ix+d),E | |
3649 | instr fetch_nop, op_SET0, store2_H ;C4 ;SET 0,(Ix+d),H | |
3650 | instr fetch_nop, op_SET0, store2_L ;C5 ;SET 0,(Ix+d),L | |
e7a0f403 | 3651 | instr fetch_nop, op_SET0, store_nop ;C6 ;SET 0,(Ix+d) |
fb050095 L |
3652 | instr fetch_nop, op_SET0, store2_A ;C7 ;SET 0,(Ix+d),A |
3653 | instr fetch_nop, op_SET1, store2_B ;C8 ;SET 1,(Ix+d),B | |
3654 | instr fetch_nop, op_SET1, store2_C ;C9 ;SET 1,(Ix+d),C | |
3655 | instr fetch_nop, op_SET1, store2_D ;CA ;SET 1,(Ix+d),D | |
3656 | instr fetch_nop, op_SET1, store2_E ;CB ;SET 1,(Ix+d),E | |
3657 | instr fetch_nop, op_SET1, store2_H ;CC ;SET 1,(Ix+d),H | |
3658 | instr fetch_nop, op_SET1, store2_L ;CD ;SET 1,(Ix+d),L | |
e7a0f403 | 3659 | instr fetch_nop, op_SET1, store_nop ;CE ;SET 1,(Ix+d) |
fb050095 L |
3660 | instr fetch_nop, op_SET1, store2_A ;CF ;SET 1,(Ix+d),A |
3661 | instr fetch_nop, op_SET2, store2_B ;D0 ;SET 2,(Ix+d),B | |
3662 | instr fetch_nop, op_SET2, store2_C ;D1 ;SET 2,(Ix+d),C | |
3663 | instr fetch_nop, op_SET2, store2_D ;D2 ;SET 2,(Ix+d),D | |
3664 | instr fetch_nop, op_SET2, store2_E ;D3 ;SET 2,(Ix+d),E | |
3665 | instr fetch_nop, op_SET2, store2_H ;D4 ;SET 2,(Ix+d),H | |
3666 | instr fetch_nop, op_SET2, store2_L ;D5 ;SET 2,(Ix+d),L | |
e7a0f403 | 3667 | instr fetch_nop, op_SET2, store_nop ;D6 ;SET 2,(Ix+d) |
fb050095 L |
3668 | instr fetch_nop, op_SET2, store2_A ;D7 ;SET 2,(Ix+d),A |
3669 | instr fetch_nop, op_SET3, store2_B ;D8 ;SET 3,(Ix+d),B | |
3670 | instr fetch_nop, op_SET3, store2_C ;D9 ;SET 3,(Ix+d),C | |
3671 | instr fetch_nop, op_SET3, store2_D ;DA ;SET 3,(Ix+d),D | |
3672 | instr fetch_nop, op_SET3, store2_E ;DB ;SET 3,(Ix+d),E | |
3673 | instr fetch_nop, op_SET3, store2_H ;DC ;SET 3,(Ix+d),H | |
3674 | instr fetch_nop, op_SET3, store2_L ;DD ;SET 3,(Ix+d),L | |
e7a0f403 | 3675 | instr fetch_nop, op_SET3, store_nop ;DE ;SET 3,(Ix+d) |
fb050095 L |
3676 | instr fetch_nop, op_SET3, store2_A ;DF ;SET 3,(Ix+d),A |
3677 | instr fetch_nop, op_SET4, store2_B ;E0 ;SET 4,(Ix+d),B | |
3678 | instr fetch_nop, op_SET4, store2_C ;E1 ;SET 4,(Ix+d),C | |
3679 | instr fetch_nop, op_SET4, store2_D ;E2 ;SET 4,(Ix+d),D | |
3680 | instr fetch_nop, op_SET4, store2_E ;E3 ;SET 4,(Ix+d),E | |
3681 | instr fetch_nop, op_SET4, store2_H ;E4 ;SET 4,(Ix+d),H | |
3682 | instr fetch_nop, op_SET4, store2_L ;E5 ;SET 4,(Ix+d),L | |
e7a0f403 | 3683 | instr fetch_nop, op_SET4, store_nop ;E6 ;SET 4,(Ix+d) |
fb050095 L |
3684 | instr fetch_nop, op_SET4, store2_A ;E7 ;SET 4,(Ix+d),A |
3685 | instr fetch_nop, op_SET5, store2_B ;E8 ;SET 5,(Ix+d),B | |
3686 | instr fetch_nop, op_SET5, store2_C ;E9 ;SET 5,(Ix+d),C | |
3687 | instr fetch_nop, op_SET5, store2_D ;EA ;SET 5,(Ix+d),D | |
3688 | instr fetch_nop, op_SET5, store2_E ;EB ;SET 5,(Ix+d),E | |
3689 | instr fetch_nop, op_SET5, store2_H ;EC ;SET 5,(Ix+d),H | |
3690 | instr fetch_nop, op_SET5, store2_L ;ED ;SET 5,(Ix+d),L | |
e7a0f403 | 3691 | instr fetch_nop, op_SET5, store_nop ;EE ;SET 5,(Ix+d) |
fb050095 L |
3692 | instr fetch_nop, op_SET5, store2_A ;EF ;SET 5,(Ix+d),A |
3693 | instr fetch_nop, op_SET6, store2_B ;F0 ;SET 6,(Ix+d),B | |
3694 | instr fetch_nop, op_SET6, store2_C ;F1 ;SET 6,(Ix+d),C | |
3695 | instr fetch_nop, op_SET6, store2_D ;F2 ;SET 6,(Ix+d),D | |
3696 | instr fetch_nop, op_SET6, store2_E ;F3 ;SET 6,(Ix+d),E | |
3697 | instr fetch_nop, op_SET6, store2_H ;F4 ;SET 6,(Ix+d),H | |
3698 | instr fetch_nop, op_SET6, store2_L ;F5 ;SET 6,(Ix+d),L | |
e7a0f403 | 3699 | instr fetch_nop, op_SET6, store_nop ;F6 ;SET 6,(Ix+d) |
fb050095 L |
3700 | instr fetch_nop, op_SET6, store2_A ;F7 ;SET 6,(Ix+d),A |
3701 | instr fetch_nop, op_SET7, store2_B ;F8 ;SET 7,(Ix+d),B | |
3702 | instr fetch_nop, op_SET7, store2_C ;F9 ;SET 7,(Ix+d),C | |
3703 | instr fetch_nop, op_SET7, store2_D ;FA ;SET 7,(Ix+d),D | |
3704 | instr fetch_nop, op_SET7, store2_E ;FB ;SET 7,(Ix+d),E | |
3705 | instr fetch_nop, op_SET7, store2_H ;FC ;SET 7,(Ix+d),H | |
3706 | instr fetch_nop, op_SET7, store2_L ;FD ;SET 7,(Ix+d),L | |
e7a0f403 | 3707 | instr fetch_nop, op_SET7, store_nop ;FE ;SET 7,(Ix+d) |
fb050095 | 3708 | instr fetch_nop, op_SET7, store2_A ;FF ;SET 7,(Ix+d),A |
fa9059af | 3709 | |
623dd899 L |
3710 | do_fetch_0: |
3711 | ldi opl,0 | |
3712 | ret | |
3713 | ||
3714 | ;---------------------------------------------------------------- | |
3715 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3716 | ;---------------------------------------------------------------- | |
3717 | ;|IN r,[C] |***P0-|Input |r=[C] | | |
3718 | ; | |
3719 | ||
3720 | do_op_in: ; in opl,(opl) | |
3721 | .if PORT_DEBUG | |
3722 | push opl | |
3723 | cp opl,_0 ; don't debug port 0 (con stat) | |
3724 | breq dbg_op_in_1 | |
3725 | printnewline | |
3726 | printstring "Port read: (" | |
3727 | mov temp,opl | |
3728 | lcall printhex | |
3729 | printstring ") -> " | |
3730 | dbg_op_in_1: | |
3731 | .endif | |
3732 | ||
3733 | mov temp2,opl | |
3734 | lcall portRead | |
3735 | mov opl,temp | |
3736 | bst z_flags,ZFL_C ;save Carry | |
3737 | ldpmx z_flags,sz53p_tab,temp ;S,Z,P | |
3738 | bld z_flags,ZFL_C | |
3739 | ||
3740 | .if PORT_DEBUG | |
3741 | pop temp | |
3742 | cp temp,_0 | |
3743 | breq dbg_op_in_2 | |
3744 | lcall printhex | |
3745 | printstring " " | |
3746 | dbg_op_in_2: | |
3747 | .endif | |
3748 | ret | |
3749 | ||
3750 | ;---------------------------------------------------------------- | |
3751 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3752 | ;---------------------------------------------------------------- | |
3753 | ;|OUT [C],r |------|Output |[C]=r | | |
3754 | ; | |
3755 | ||
3756 | do_op_out: ; out (c),opl | |
3757 | .if PORT_DEBUG | |
3758 | printnewline | |
3759 | printstring "Port write: " | |
3760 | mov temp,opl | |
3761 | lcall printhex | |
3762 | printstring " -> (" | |
825ecc9d | 3763 | mov temp,z_c |
623dd899 L |
3764 | lcall printhex |
3765 | printstring ") " | |
3766 | .endif | |
3767 | mov temp,opl | |
825ecc9d | 3768 | mov temp2,z_c |
623dd899 L |
3769 | lcall portWrite |
3770 | ret | |
3771 | ||
3772 | ;---------------------------------------------------------------- | |
3773 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3774 | ;---------------------------------------------------------------- | |
3775 | ;|LD dst,src|------|Load |dst=src | | |
3776 | ; | |
3777 | ||
3778 | do_op_stbc: ;store bc to mem loc in opl:h | |
3779 | movw xl,opl | |
825ecc9d | 3780 | mem_write_s z_c |
623dd899 | 3781 | adiw xl,1 |
825ecc9d | 3782 | mem_write_s z_b |
623dd899 L |
3783 | ret |
3784 | ||
3785 | ;---------------------------------------------------------------- | |
3786 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3787 | ;---------------------------------------------------------------- | |
3788 | ;|LD dst,src|------|Load |dst=src | | |
3789 | ; | |
3790 | ; | |
3791 | do_op_stde: ;store de to mem loc in opl:h | |
3792 | movw xl,opl | |
825ecc9d | 3793 | mem_write_s z_e |
623dd899 | 3794 | adiw xl,1 |
825ecc9d | 3795 | mem_write_s z_d |
623dd899 L |
3796 | ret |
3797 | ||
3798 | ;---------------------------------------------------------------- | |
3799 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3800 | ;---------------------------------------------------------------- | |
3801 | ;|LD dst,src|------|Load |dst=src | | |
3802 | ; | |
3803 | ; | |
3804 | do_op_stsp: ;store sp to mem loc in opl:h | |
3805 | movw xl,opl | |
3806 | mem_write_s z_spl | |
3807 | adiw xl,1 | |
3808 | mem_write_s z_sph | |
3809 | ret | |
3810 | ||
3811 | ;---------------------------------------------------------------- | |
3812 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3813 | ;---------------------------------------------------------------- | |
3814 | ;|ADC HL,ss |***V0*|Add with Carry |HL=HL+ss+CY | | |
3815 | ; | |
3816 | ||
3817 | do_op_ADCHL: | |
825ecc9d | 3818 | lsr z_flags ; ZFL_C --> Carry |
623dd899 | 3819 | ldi z_flags,0 ; clear N |
825ecc9d L |
3820 | adc z_l,opl |
3821 | in temp,sreg ; save lower Z | |
3822 | adc z_h,oph | |
3823 | in temp2,sreg | |
3824 | ||
3825 | and temp,temp2 ; 16bit Z | |
623dd899 L |
3826 | bmov z_flags,ZFL_C, temp2,AVR_C |
3827 | bmov z_flags,ZFL_P, temp2,AVR_V | |
3828 | bmov z_flags,ZFL_H, temp2,AVR_H | |
3829 | bmov z_flags,ZFL_Z, temp,AVR_Z | |
3830 | bmov z_flags,ZFL_S, temp2,AVR_N | |
3831 | ret | |
3832 | ||
3833 | ;---------------------------------------------------------------- | |
3834 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3835 | ;---------------------------------------------------------------- | |
3836 | ;|SBC HL,ss |***V1*|Subtract with carry |HL=HL-ss-CY | | |
3837 | ; | |
3838 | ||
3839 | checkspace PC, 24 | |
3840 | ||
3841 | do_op_sbchl: | |
825ecc9d L |
3842 | lsr z_flags ; get Z80 carry |
3843 | sez ; set z | |
3844 | sbc z_l,opl | |
3845 | sbc z_h,oph | |
623dd899 | 3846 | in temp,sreg |
825ecc9d | 3847 | ldi z_flags,(1<<ZFL_N) ; set N |
623dd899 L |
3848 | bmov z_flags,ZFL_C, temp,AVR_C |
3849 | bmov z_flags,ZFL_P, temp,AVR_V | |
3850 | bmov z_flags,ZFL_H, temp,AVR_H | |
3851 | bmov z_flags,ZFL_Z, temp,AVR_Z | |
3852 | bmov z_flags,ZFL_S, temp,AVR_N | |
3853 | ret | |
3854 | ||
3855 | ;---------------------------------------------------------------- | |
3856 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3857 | ;---------------------------------------------------------------- | |
3858 | ;|NEG |***V1*|Negate A |A=0-A | | |
3859 | ||
3860 | ; | |
3861 | do_op_NEG: | |
3862 | ldi temp,0 | |
3863 | sub temp,z_a | |
3864 | mov z_a,temp | |
3865 | in temp,sreg | |
3866 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,P | |
3867 | bmov z_flags,ZFL_C, temp,AVR_C | |
3868 | bmov z_flags,ZFL_H, temp,AVR_H | |
3869 | do_z80_flags_V | |
3870 | do_z80_flags_set_N | |
3871 | ret | |
3872 | ||
3873 | ;---------------------------------------------------------------- | |
3874 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3875 | ;---------------------------------------------------------------- | |
3876 | ;|RETI |------|Return from Interrupt|PC=[SP]+ | | |
3877 | ;|RETN |------|Return from NMI | Copy IFF2 to IFF1 | | |
3878 | ||
3879 | ||
3880 | do_op_RETI: | |
3881 | do_op_RETN: | |
3882 | ldd temp,y+oz_istat | |
3883 | bmov temp,IFF1, temp,IFF2 | |
3884 | std y+oz_istat,temp | |
3885 | ljmp do_store_ret | |
3886 | ||
3887 | ||
3888 | ;---------------------------------------------------------------- | |
3889 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3890 | ;---------------------------------------------------------------- | |
3891 | ;|IM n |------|Interrupt Mode | (n=0,1,2)| | |
3892 | ||
3893 | do_op_IM0: | |
3894 | ldd temp,y+oz_istat | |
3895 | andi temp, ~IM_MASK | |
3896 | std y+oz_istat,temp | |
3897 | ret | |
3898 | ||
3899 | do_op_IM1: | |
3900 | ldd temp,y+oz_istat | |
3901 | andi temp,~IM_MASK | |
3902 | ori temp,IM1 | |
3903 | std y+oz_istat,temp | |
3904 | ret | |
3905 | ||
3906 | do_op_IM2: | |
3907 | ldd temp,y+oz_istat | |
3908 | andi temp, ~IM_MASK | |
3909 | ori temp,IM2 | |
3910 | std y+oz_istat,temp | |
3911 | ret | |
3912 | ||
3913 | ;---------------------------------------------------------------- | |
3914 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3915 | ;---------------------------------------------------------------- | |
3916 | ;|LD A,i |**0*0-|Load |(i=I,R) IFF2 --> P | | |
3917 | ;|LD i,A |------|Load |(i=I,R) | | |
3918 | ||
3919 | do_op_ldai: | |
3920 | ldd z_a,y+oz_i | |
3921 | rjmp op_ldar1 | |
3922 | ||
3923 | do_op_ldar: | |
3924 | ldd z_a,y+oz_r | |
3925 | op_ldar1: | |
3926 | bst z_flags,ZFL_C ;save C | |
3927 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N | |
3928 | bld z_flags,ZFL_C ; | |
3929 | ldd temp,y+oz_istat | |
3930 | bmov z_flags,ZFL_P, temp,IFF2 | |
3931 | ret | |
3932 | ||
3933 | do_op_ldia: | |
3934 | std y+oz_i,z_a | |
3935 | ret | |
3936 | ||
3937 | do_op_ldra: | |
3938 | std y+oz_r,z_a | |
3939 | ret | |
3940 | ||
3941 | ;---------------------------------------------------------------- | |
3942 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3943 | ;---------------------------------------------------------------- | |
3944 | ;|RLD |**0P0-|Rotate Left 4 bits |{A,[HL]}={A,[HL]}<- ##| | |
3945 | ;|RRD |**0P0-|Rotate Right 4 bits |{A,[HL]}=->{A,[HL]} ##| | |
3946 | ||
3947 | do_op_rld: | |
3948 | swap opl | |
3949 | mov oph,opl | |
3950 | andi opl,0xf0 | |
3951 | andi oph,0x0f | |
3952 | mov temp,z_a | |
3953 | andi temp,0x0f | |
3954 | or opl,temp | |
3955 | mov temp,z_a | |
3956 | andi temp,0xf0 | |
3957 | or temp,oph | |
3958 | mov z_a,temp | |
3959 | bst z_flags,ZFL_C ;save C | |
3960 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N | |
3961 | bld z_flags,ZFL_C ; | |
3962 | ret | |
3963 | ||
3964 | do_op_rrd: | |
3965 | mov oph,opl | |
3966 | andi opl,0xf0 | |
3967 | andi oph,0x0f | |
3968 | mov temp,z_a | |
3969 | andi temp,0x0f | |
3970 | or opl,temp | |
3971 | swap opl | |
3972 | mov temp,z_a | |
3973 | andi temp,0xf0 | |
3974 | or temp,oph | |
3975 | mov z_a,temp | |
3976 | bst z_flags,ZFL_C ;save C | |
3977 | ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N | |
3978 | bld z_flags,ZFL_C ; | |
3979 | ret | |
3980 | ||
3981 | ||
3982 | ;---------------------------------------------------------------- | |
3983 | ;|Mnemonic |SZHPNC|Description |Notes | | |
3984 | ;---------------------------------------------------------------- | |
3985 | ;|LDD |--0*0-|Load and Decrement |[DE]=[HL],HL=HL-1,# | | |
3986 | ;|LDDR |--000-|Load, Dec., Repeat |LDD till BC=0 | | |
3987 | ;|LDI |--0*0-|Load and Increment |[DE]=[HL],HL=HL+1,# | | |
3988 | ;|LDIR |--000-|Load, Inc., Repeat |LDI till BC=0 | | |
3989 | ; | |
3990 | ||
825ecc9d | 3991 | checkspace PC, 13 |
623dd899 L |
3992 | |
3993 | op_LDxx_common: | |
825ecc9d | 3994 | movw x,z_l ;HL |
623dd899 L |
3995 | ; mem_read_ds temp, z |
3996 | lcall dram_read ; temp = (HL) | |
825ecc9d | 3997 | movw x,z_e ;DE |
623dd899 L |
3998 | ; mem_write_ds x, temp |
3999 | lcall dram_write ; (DE) = temp | |
4000 | ||
623dd899 | 4001 | cbr z_flags,(1<<ZFL_H) | (1<<ZFL_P) | (1<<ZFL_N) |
825ecc9d L |
4002 | |
4003 | movw x,z_c | |
4004 | sbiw x,1 ;BC-- | |
4005 | movw z_c,x | |
623dd899 L |
4006 | breq PC+2 |
4007 | sbr z_flags,(1<<ZFL_P) | |
623dd899 L |
4008 | ret |
4009 | ||
825ecc9d | 4010 | checkspace PC, 6 |
623dd899 L |
4011 | |
4012 | do_op_LDI: | |
4013 | rcall op_LDxx_common | |
825ecc9d L |
4014 | sub z_e,_255 ;-low(-1) DE++ |
4015 | sbc z_d,_255 ;-high(-1) | |
4016 | sub z_l,_255 ;-low(-1) HL++ | |
4017 | sbc z_h,_255 ;-high(-1) | |
623dd899 L |
4018 | ret |
4019 | ||
825ecc9d | 4020 | checkspace PC, 6 |
623dd899 L |
4021 | |
4022 | do_op_LDD: | |
4023 | rcall op_LDxx_common | |
825ecc9d L |
4024 | add z_e,_255 ;+low(-1) DE-- |
4025 | adc z_d,_255 ;+high(-1) | |
4026 | add z_l,_255 ;+low(-1) HL-- | |
4027 | adc z_h,_255 ;+high(-1) | |
623dd899 L |
4028 | ret |
4029 | ||
4030 | checkspace PC, 5 | |
4031 | ||
4032 | do_op_LDIR: | |
4033 | rcall do_op_LDI | |
4034 | #if 1 | |
4035 | sbrc z_flags,ZFL_P | |
4036 | rjmp do_op_LDIR | |
4037 | ret | |
4038 | #else | |
4039 | sbrs z_flags,ZFL_P | |
4040 | ret | |
4041 | sbiw z_pcl,2 | |
4042 | ret | |
4043 | #endif | |
4044 | ||
4045 | checkspace PC, 5 | |
4046 | ||
4047 | do_op_LDDR: | |
4048 | rcall do_op_LDD | |
4049 | sbrs z_flags,ZFL_P | |
4050 | ret | |
4051 | sbiw z_pcl,2 | |
4052 | ret | |
4053 | ||
4054 | ;---------------------------------------------------------------- | |
4055 | ;|Mnemonic |SZHPNC|Description |Notes | | |
4056 | ;---------------------------------------------------------------- | |
4057 | ;|CPD |****1-|Compare and Decrement|A-[HL],HL=HL-1,BC=BC-1| | |
4058 | ;|CPDR |****1-|Compare, Dec., Repeat|CPD till A=[HL]or BC=0| | |
4059 | ;|CPI |****1-|Compare and Increment|A-[HL],HL=HL+1,BC=BC-1| | |
4060 | ;|CPIR |****1-|Compare, Inc., Repeat|CPI till A=[HL]or BC=0| | |
4061 | ||
4062 | ||
4063 | checkspace PC, 21 | |
4064 | ||
4065 | op_CPxx_common: | |
825ecc9d L |
4066 | movw x,z_l ; HL |
4067 | ||
4068 | movw z,z_c ;BC | |
623dd899 L |
4069 | |
4070 | cbr z_flags,(1<<ZFL_S)|(1<<ZFL_Z)|(1<<ZFL_H)|(1<<ZFL_P) | |
4071 | sbr z_flags,(1<<ZFL_N) | |
4072 | lcall dram_read ; temp = (HL) | |
4073 | ||
825ecc9d | 4074 | cp z_a,temp ; A - (HL) |
623dd899 L |
4075 | |
4076 | brpl PC+2 | |
4077 | sbr z_flags,(1<<ZFL_S) | |
4078 | brne PC+2 | |
4079 | sbr z_flags,(1<<ZFL_Z) | |
4080 | brhc PC+2 | |
4081 | sbr z_flags,(1<<ZFL_H) | |
4082 | ||
4083 | sbiw z,1 ; BC-- | |
4084 | breq PC+2 | |
4085 | sbr z_flags,(1<<ZFL_P) | |
825ecc9d | 4086 | movw z_c,z ;BC |
623dd899 L |
4087 | ret |
4088 | ||
4089 | checkspace PC, 5 | |
4090 | ||
4091 | do_op_CPI: | |
4092 | rcall op_CPxx_common | |
4093 | adiw x,1 ; HL++ | |
825ecc9d | 4094 | movw z_l,x ; HL |
623dd899 L |
4095 | ret |
4096 | ||
4097 | ||
4098 | checkspace PC, 5 | |
4099 | ||
4100 | do_op_CPD: | |
4101 | rcall op_CPxx_common | |
4102 | sbiw x,1 ; HL-- | |
825ecc9d | 4103 | movw z_l,x ; HL |
623dd899 L |
4104 | ret |
4105 | ||
4106 | checkspace PC, 7 | |
4107 | ||
4108 | do_op_CPIR: | |
4109 | rcall do_op_CPI | |
4110 | sbrc z_flags,ZFL_Z | |
4111 | ret | |
4112 | sbrs z_flags,ZFL_P | |
4113 | ret | |
4114 | sbiw z_pcl,2 | |
4115 | ret | |
4116 | ||
4117 | checkspace PC, 7 | |
4118 | ||
4119 | do_op_CPDR: | |
4120 | rcall do_op_CPD | |
4121 | sbrc z_flags,ZFL_Z | |
4122 | ret | |
4123 | sbrs z_flags,ZFL_P | |
4124 | ret | |
4125 | sbiw z_pcl,2 | |
4126 | ret | |
4127 | ||
4128 | ;---------------------------------------------------------------- | |
4129 | ;|Mnemonic |SZHPNC|Description |Notes | | |
4130 | ;---------------------------------------------------------------- | |
4131 | ;|INI |?*??1-|Input and Increment |[HL]=[C],HL=HL+1,B=B-1| | |
4132 | ;|IND |?*??1-|Input and Decrement |[HL]=[C],HL=HL-1,B=B-1| | |
4133 | ;|INIR |?1??1-|Input, Inc., Repeat |INI till B=0 | | |
4134 | ;|INDR |?1??1-|Input, Dec., Repeat |IND till B=0 | | |
4135 | ||
825ecc9d | 4136 | checkspace PC, 12 |
623dd899 L |
4137 | |
4138 | op_INxx_common: | |
4139 | cbr z_flags,(1<<ZFL_Z) | |
4140 | sbr z_flags,(1<<ZFL_N) | |
825ecc9d | 4141 | mov temp2,z_c ;C |
623dd899 | 4142 | lcall portRead |
825ecc9d | 4143 | movw x,z_l ;HL |
623dd899 | 4144 | lcall dram_write |
825ecc9d | 4145 | dec z_b ;B |
623dd899 L |
4146 | brne PC+2 |
4147 | sbr z_flags,(1<<ZFL_Z) | |
4148 | ret | |
4149 | ||
825ecc9d | 4150 | checkspace PC, 4 |
623dd899 L |
4151 | |
4152 | do_op_INI: | |
4153 | rcall op_INxx_common | |
4154 | adiw x,1 | |
825ecc9d | 4155 | movw z_l,x ;HL |
623dd899 L |
4156 | ret |
4157 | ||
825ecc9d | 4158 | checkspace PC, 4 |
623dd899 L |
4159 | |
4160 | do_op_IND: | |
4161 | rcall op_INxx_common | |
4162 | sbiw x,1 | |
825ecc9d | 4163 | movw z_l,x ;HL |
623dd899 L |
4164 | ret |
4165 | ||
4166 | checkspace PC, 5 | |
4167 | ||
4168 | do_op_INIR: | |
4169 | rcall do_op_INI | |
4170 | sbrc z_flags,ZFL_Z | |
4171 | ret | |
4172 | sbiw z_pcl,2 | |
4173 | ret | |
4174 | ||
4175 | checkspace PC, 5 | |
4176 | ||
4177 | do_op_INDR: | |
4178 | rcall do_op_IND | |
4179 | sbrc z_flags,ZFL_Z | |
4180 | ret | |
4181 | sbiw z_pcl,2 | |
4182 | ret | |
4183 | ||
4184 | ;---------------------------------------------------------------- | |
4185 | ;|Mnemonic |SZHPNC|Description |Notes | | |
4186 | ;---------------------------------------------------------------- | |
4187 | ;|OUTI |?*??1-|Output and Increment |[C]=[HL],HL=HL+1,B=B-1| | |
4188 | ;|OUTD |?*??1-|Output and Decrement |[C]=[HL],HL=HL-1,B=B-1| | |
4189 | ;|OTIR |?1??1-|Output, Inc., Repeat |OUTI till B=0 | | |
4190 | ;|OTDR |?1??1-|Output, Dec., Repeat |OUTD till B=0 | | |
4191 | ||
825ecc9d | 4192 | checkspace PC, 12 |
623dd899 L |
4193 | |
4194 | op_OUTxx_common: | |
825ecc9d | 4195 | movw x,z_l ;HL |
623dd899 | 4196 | lcall dram_read ;temp = (z) |
825ecc9d | 4197 | mov temp2,z_c ;C |
623dd899 | 4198 | lcall portWrite |
825ecc9d L |
4199 | cbr z_flags,(1<<ZFL_Z) |
4200 | sbr z_flags,(1<<ZFL_N) | |
4201 | dec z_b ;B | |
623dd899 L |
4202 | brne PC+2 |
4203 | sbr z_flags,(1<<ZFL_Z) | |
4204 | ret | |
4205 | ||
825ecc9d | 4206 | checkspace PC, 4 |
623dd899 L |
4207 | |
4208 | do_op_OUTI: | |
623dd899 | 4209 | rcall op_OUTxx_common |
825ecc9d L |
4210 | sub z_l,_255 ;-low(-1) |
4211 | sbc z_h,_255 ;-high(-1) | |
623dd899 L |
4212 | ret |
4213 | ||
825ecc9d | 4214 | checkspace PC, 4 |
623dd899 L |
4215 | |
4216 | do_op_OUTD: | |
623dd899 | 4217 | rcall op_OUTxx_common |
825ecc9d L |
4218 | add z_l,_255 ;+low(-1) |
4219 | adc z_h,_255 ;+high(-1) | |
623dd899 L |
4220 | ret |
4221 | ||
4222 | checkspace PC, 5 | |
4223 | ||
4224 | do_op_OTIR: | |
4225 | rcall do_op_OUTI | |
4226 | sbrc z_flags,ZFL_Z | |
4227 | ret | |
4228 | sbiw z_pcl,2 | |
4229 | ret | |
4230 | ||
4231 | checkspace PC, 5 | |
4232 | ||
4233 | do_op_OTDR: | |
4234 | rcall do_op_OUTD | |
4235 | sbrc z_flags,ZFL_Z | |
4236 | ret | |
4237 | sbiw z_pcl,2 | |
4238 | ret | |
4239 | ||
4240 | #if 1 | |
4241 | opctable EDjmp, PC ;+ 2*256 | |
4242 | ||
4243 | instr fetch_nop, op_nop, store_nop ;00 ;NOP | |
4244 | instr fetch_nop, op_nop, store_nop ;01 ;NOP | |
4245 | instr fetch_nop, op_nop, store_nop ;02 ;NOP | |
4246 | instr fetch_nop, op_nop, store_nop ;03 ;NOP | |
4247 | instr fetch_nop, op_nop, store_nop ;04 ;NOP | |
4248 | instr fetch_nop, op_nop, store_nop ;05 ;NOP | |
4249 | instr fetch_nop, op_nop, store_nop ;06 ;NOP | |
4250 | instr fetch_nop, op_nop, store_nop ;07 ;NOP | |
4251 | instr fetch_nop, op_nop, store_nop ;08 ;NOP | |
4252 | instr fetch_nop, op_nop, store_nop ;09 ;NOP | |
4253 | instr fetch_nop, op_nop, store_nop ;0A ;NOP | |
4254 | instr fetch_nop, op_nop, store_nop ;0B ;NOP | |
4255 | instr fetch_nop, op_nop, store_nop ;0C ;NOP | |
4256 | instr fetch_nop, op_nop, store_nop ;0D ;NOP | |
4257 | instr fetch_nop, op_nop, store_nop ;0E ;NOP | |
4258 | instr fetch_nop, op_nop, store_nop ;0F ;NOP | |
4259 | instr fetch_nop, op_nop, store_nop ;10 ;NOP | |
4260 | instr fetch_nop, op_nop, store_nop ;11 ;NOP | |
4261 | instr fetch_nop, op_nop, store_nop ;12 ;NOP | |
4262 | instr fetch_nop, op_nop, store_nop ;13 ;NOP | |
4263 | instr fetch_nop, op_nop, store_nop ;14 ;NOP | |
4264 | instr fetch_nop, op_nop, store_nop ;15 ;NOP | |
4265 | instr fetch_nop, op_nop, store_nop ;16 ;NOP | |
4266 | instr fetch_nop, op_nop, store_nop ;17 ;NOP | |
4267 | instr fetch_nop, op_nop, store_nop ;18 ;NOP | |
4268 | instr fetch_nop, op_nop, store_nop ;19 ;NOP | |
4269 | instr fetch_nop, op_nop, store_nop ;1A ;NOP | |
4270 | instr fetch_nop, op_nop, store_nop ;1B ;NOP | |
4271 | instr fetch_nop, op_nop, store_nop ;1C ;NOP | |
4272 | instr fetch_nop, op_nop, store_nop ;1D ;NOP | |
4273 | instr fetch_nop, op_nop, store_nop ;1E ;NOP | |
4274 | instr fetch_nop, op_nop, store_nop ;1F ;NOP | |
4275 | instr fetch_nop, op_nop, store_nop ;20 ;NOP | |
4276 | instr fetch_nop, op_nop, store_nop ;21 ;NOP | |
4277 | instr fetch_nop, op_nop, store_nop ;22 ;NOP | |
4278 | instr fetch_nop, op_nop, store_nop ;23 ;NOP | |
4279 | instr fetch_nop, op_nop, store_nop ;24 ;NOP | |
4280 | instr fetch_nop, op_nop, store_nop ;25 ;NOP | |
4281 | instr fetch_nop, op_nop, store_nop ;26 ;NOP | |
4282 | instr fetch_nop, op_nop, store_nop ;27 ;NOP | |
4283 | instr fetch_nop, op_nop, store_nop ;28 ;NOP | |
4284 | instr fetch_nop, op_nop, store_nop ;29 ;NOP | |
4285 | instr fetch_nop, op_nop, store_nop ;2A ;NOP | |
4286 | instr fetch_nop, op_nop, store_nop ;2B ;NOP | |
4287 | instr fetch_nop, op_nop, store_nop ;2C ;NOP | |
4288 | instr fetch_nop, op_nop, store_nop ;2D ;NOP | |
4289 | instr fetch_nop, op_nop, store_nop ;2E ;NOP | |
4290 | instr fetch_nop, op_nop, store_nop ;2F ;NOP | |
4291 | instr fetch_nop, op_nop, store_nop ;30 ;NOP | |
4292 | instr fetch_nop, op_nop, store_nop ;31 ;NOP | |
4293 | instr fetch_nop, op_nop, store_nop ;32 ;NOP | |
4294 | instr fetch_nop, op_nop, store_nop ;33 ;NOP | |
4295 | instr fetch_nop, op_nop, store_nop ;34 ;NOP | |
4296 | instr fetch_nop, op_nop, store_nop ;35 ;NOP | |
4297 | instr fetch_nop, op_nop, store_nop ;36 ;NOP | |
4298 | instr fetch_nop, op_nop, store_nop ;37 ;NOP | |
4299 | instr fetch_nop, op_nop, store_nop ;38 ;NOP | |
4300 | instr fetch_nop, op_nop, store_nop ;39 ;NOP | |
4301 | instr fetch_nop, op_nop, store_nop ;3A ;NOP | |
4302 | instr fetch_nop, op_nop, store_nop ;3B ;NOP | |
4303 | instr fetch_nop, op_nop, store_nop ;3C ;NOP | |
4304 | instr fetch_nop, op_nop, store_nop ;3D ;NOP | |
4305 | instr fetch_nop, op_nop, store_nop ;3E ;NOP | |
4306 | instr fetch_nop, op_nop, store_nop ;3F ;NOP | |
4307 | instr fetch_C, op_IN, store2_B ;40 ;IN B,(C) | |
4308 | instr fetch_B, op_OUT, store_nop ;41 ;OUT (C),B | |
4309 | instr fetch_BC, op_SBCHL, store_nop ;42 ;SBC HL,BC | |
4310 | instr fetch_DIR16, op_STBC, store_nop ;43 ;LD (nn),BC | |
4311 | instr fetch_nop, op_NEG, store_nop ;44 ;NEG | |
4312 | instr fetch_nop, op_RETN, store_nop ;45 ;RETN | |
4313 | instr fetch_nop, op_IM0, store_nop ;46 ;IM 0 | |
4314 | instr fetch_nop, op_ldia, store_nop ;47 ;LD I,A | |
4315 | instr fetch_C, op_IN, store2_C ;48 ;IN C,(C) | |
4316 | instr fetch_C, op_OUT, store_nop ;49 ;OUT (C),C | |
4317 | instr fetch_BC, op_ADCHL, store_nop ;4A ;ADC HL,BC | |
4318 | instr fetch_DIR16, op_RMEM16, store_BC ;4B nn nn ;LD BC,(nn) | |
4319 | instr fetch_nop, op_NEG, store_nop ;4C ;NEG | |
4320 | instr fetch_nop, op_RETI, store_nop ;4D ;RETI | |
4321 | instr fetch_nop, op_IM0, store_nop ;4E ;IM 0 | |
4322 | instr fetch_nop, op_ldra, store_nop ;4F ;LD R,A | |
4323 | instr fetch_C, op_IN, store2_D ;50 ;IN D,(C) | |
4324 | instr fetch_D, op_OUT, store_nop ;51 ;OUT (C),D | |
4325 | instr fetch_DE, op_SBCHL, store_nop ;52 ;SBC HL,DE | |
4326 | instr fetch_DIR16, op_STDE, store_nop ;53 nn nn ;LD (nn),DE | |
4327 | instr fetch_nop, op_NEG, store_nop ;54 ;NEG | |
4328 | instr fetch_nop, op_RETN, store_nop ;55 ;RETN | |
4329 | instr fetch_nop, op_IM1, store_nop ;56 ;IM 1 | |
4330 | instr fetch_nop, op_ldai, store_nop ;57 ;LD A,I | |
4331 | instr fetch_C, op_IN, store2_E ;58 ;IN E,(C) | |
4332 | instr fetch_E, op_OUT, store_nop ;59 ;OUT (C),E | |
4333 | instr fetch_DE, op_ADCHL, store_nop ;5A ;ADC HL,DE | |
4334 | instr fetch_DIR16, op_RMEM16, store_DE ;5B nn nn ;LD DE,(nn) | |
4335 | instr fetch_nop, op_NEG, store_nop ;5C ;NEG | |
4336 | instr fetch_nop, op_RETN, store_nop ;5D ;RETN | |
4337 | instr fetch_nop, op_IM2, store_nop ;5E ;IM 2 | |
4338 | instr fetch_nop, op_ldar, store_nop ;5F ;LD A,R | |
4339 | instr fetch_C, op_IN, store2_H ;60 ;IN H,(C) | |
4340 | instr fetch_H, op_OUT, store_nop ;61 ;OUT (C),H | |
4341 | instr fetch_HL, op_SBCHL, store_nop ;62 ;SBC HL,HL | |
4342 | instr fetch_DIR16, op_STHL, store_nop ;63 nn nn ;LD (nn),HL | |
4343 | instr fetch_nop, op_NEG, store_nop ;64 ;NEG | |
4344 | instr fetch_nop, op_RETN, store_nop ;65 ;RETN | |
4345 | instr fetch_nop, op_IM0, store_nop ;66 ;IM 0 | |
4346 | instr fetch2_mhl, op_RRD, store_mhl ;67 ;RRD | |
4347 | instr fetch_C, op_IN, store2_L ;68 ;IN L,(C) | |
4348 | instr fetch_L, op_OUT, store_nop ;69 ;OUT (C),L | |
4349 | instr fetch_HL, op_ADCHL, store_nop ;6A ;ADC HL,HL | |
4350 | instr fetch_DIR16, op_RMEM16, store_HL ;6B nn nn ;LD HL,(nn) | |
4351 | instr fetch_nop, op_NEG, store_nop ;6C ;NEG | |
4352 | instr fetch_nop, op_RETN, store_nop ;6D ;RETN | |
4353 | instr fetch_nop, op_IM0, store_nop ;6E ;IM 0 | |
4354 | instr fetch2_mhl, op_RLD, store_mhl ;6F ;RLD | |
4355 | instr fetch_C, op_IN, store_nop ;70 ;IN (C) | |
4356 | instr fetch_0, op_OUT, store_nop ;71 ;OUT (C),0 | |
4357 | instr fetch_SP, op_SBCHL, store_nop ;72 ;SBC HL,SP | |
4358 | instr fetch_DIR16, op_STSP, store_nop ;73 nn nn ;LD (nn),SP | |
4359 | instr fetch_nop, op_NEG, store_nop ;74 ;NEG | |
4360 | instr fetch_nop, op_RETN, store_nop ;75 ;RETN | |
4361 | instr fetch_nop, op_IM1, store_nop ;76 ;IM 1 | |
4362 | instr fetch_nop, op_nop, store_nop ;77 ;NOP | |
4363 | instr fetch_C, op_IN, store2_A ;78 ;IN A,(C) | |
4364 | instr fetch_A, op_OUT, store_nop ;79 ;OUT (C),A | |
4365 | instr fetch_SP, op_ADCHL, store_nop ;7A ;ADC HL,SP | |
4366 | instr fetch_DIR16, op_RMEM16, store_SP ;7B nn nn ;LD SP,(nn) | |
4367 | instr fetch_nop, op_NEG, store_nop ;7C ;NEG | |
4368 | instr fetch_nop, op_RETN, store_nop ;7D ;RETN | |
4369 | instr fetch_nop, op_IM2, store_nop ;7E ;IM 2 | |
4370 | instr fetch_nop, op_nop, store_nop ;7F ;NOP | |
4371 | instr fetch_nop, op_nop, store_nop ;80 ;NOP | |
4372 | instr fetch_nop, op_nop, store_nop ;81 ;NOP | |
4373 | instr fetch_nop, op_nop, store_nop ;82 ;NOP | |
4374 | instr fetch_nop, op_nop, store_nop ;83 ;NOP | |
4375 | instr fetch_nop, op_nop, store_nop ;84 ;NOP | |
4376 | instr fetch_nop, op_nop, store_nop ;85 ;NOP | |
4377 | instr fetch_nop, op_nop, store_nop ;86 ;NOP | |
4378 | instr fetch_nop, op_nop, store_nop ;87 ;NOP | |
4379 | instr fetch_nop, op_nop, store_nop ;88 ;NOP | |
4380 | instr fetch_nop, op_nop, store_nop ;89 ;NOP | |
4381 | instr fetch_nop, op_nop, store_nop ;8A ;NOP | |
4382 | instr fetch_nop, op_nop, store_nop ;8B ;NOP | |
4383 | instr fetch_nop, op_nop, store_nop ;8C ;NOP | |
4384 | instr fetch_nop, op_nop, store_nop ;8D ;NOP | |
4385 | instr fetch_nop, op_nop, store_nop ;8E ;NOP | |
4386 | instr fetch_nop, op_nop, store_nop ;8F ;NOP | |
4387 | instr fetch_nop, op_nop, store_nop ;90 ;NOP | |
4388 | instr fetch_nop, op_nop, store_nop ;91 ;NOP | |
4389 | instr fetch_nop, op_nop, store_nop ;92 ;NOP | |
4390 | instr fetch_nop, op_nop, store_nop ;93 ;NOP | |
4391 | instr fetch_nop, op_nop, store_nop ;94 ;NOP | |
4392 | instr fetch_nop, op_nop, store_nop ;95 ;NOP | |
4393 | instr fetch_nop, op_nop, store_nop ;96 ;NOP | |
4394 | instr fetch_nop, op_nop, store_nop ;97 ;NOP | |
4395 | instr fetch_nop, op_nop, store_nop ;98 ;NOP | |
4396 | instr fetch_nop, op_nop, store_nop ;99 ;NOP | |
4397 | instr fetch_nop, op_nop, store_nop ;9A ;NOP | |
4398 | instr fetch_nop, op_nop, store_nop ;9B ;NOP | |
4399 | instr fetch_nop, op_nop, store_nop ;9C ;NOP | |
4400 | instr fetch_nop, op_nop, store_nop ;9D ;NOP | |
4401 | instr fetch_nop, op_nop, store_nop ;9E ;NOP | |
4402 | instr fetch_nop, op_nop, store_nop ;9F ;NOP | |
4403 | instr fetch_nop, op_LDI, store_nop ;A0 ;LDI | |
4404 | instr fetch_nop, op_CPI, store_nop ;A1 ;CPI | |
4405 | instr fetch_nop, op_INI, store_nop ;A2 ;INI | |
4406 | instr fetch_nop, op_OUTI, store_nop ;A3 ;OUTI | |
4407 | instr fetch_nop, op_nop, store_nop ;A4 ;NOP | |
4408 | instr fetch_nop, op_nop, store_nop ;A5 ;NOP | |
4409 | instr fetch_nop, op_nop, store_nop ;A6 ;NOP | |
4410 | instr fetch_nop, op_nop, store_nop ;A7 ;NOP | |
4411 | instr fetch_nop, op_LDD, store_nop ;A8 ;LDD | |
4412 | instr fetch_nop, op_CPD, store_nop ;A9 ;CPD | |
4413 | instr fetch_nop, op_IND, store_nop ;AA ;IND | |
4414 | instr fetch_nop, op_OUTD, store_nop ;AB ;OUTD | |
4415 | instr fetch_nop, op_nop, store_nop ;AC ;NOP | |
4416 | instr fetch_nop, op_nop, store_nop ;AD ;NOP | |
4417 | instr fetch_nop, op_nop, store_nop ;AE ;NOP | |
4418 | instr fetch_nop, op_nop, store_nop ;AF ;NOP | |
4419 | instr fetch_nop, op_LDIR, store_nop ;B0 ;LDIR | |
4420 | instr fetch_nop, op_CPIR, store_nop ;B1 ;CPIR | |
4421 | instr fetch_nop, op_INIR, store_nop ;B2 ;INIR | |
4422 | instr fetch_nop, op_OTIR, store_nop ;B3 ;OTIR | |
4423 | instr fetch_nop, op_nop, store_nop ;B4 ;NOP | |
4424 | instr fetch_nop, op_nop, store_nop ;B5 ;NOP | |
4425 | instr fetch_nop, op_nop, store_nop ;B6 ;NOP | |
4426 | instr fetch_nop, op_nop, store_nop ;B7 ;NOP | |
4427 | instr fetch_nop, op_LDDR, store_nop ;B8 ;LDDR | |
4428 | instr fetch_nop, op_CPDR, store_nop ;B9 ;CPDR | |
4429 | instr fetch_nop, op_INDR, store_nop ;BA ;INDR | |
4430 | instr fetch_nop, op_OTDR, store_nop ;BB ;OTDR | |
4431 | instr fetch_nop, op_nop, store_nop ;BC ;NOP | |
4432 | instr fetch_nop, op_nop, store_nop ;BD ;NOP | |
4433 | instr fetch_nop, op_nop, store_nop ;BE ;NOP | |
4434 | instr fetch_nop, op_nop, store_nop ;BF ;NOP | |
4435 | instr fetch_nop, op_nop, store_nop ;C0 ;NOP | |
4436 | instr fetch_nop, op_nop, store_nop ;C1 ;NOP | |
4437 | instr fetch_nop, op_nop, store_nop ;C2 ;NOP | |
4438 | instr fetch_nop, op_nop, store_nop ;C3 ;NOP | |
4439 | instr fetch_nop, op_nop, store_nop ;C4 ;NOP | |
4440 | instr fetch_nop, op_nop, store_nop ;C5 ;NOP | |
4441 | instr fetch_nop, op_nop, store_nop ;C6 ;NOP | |
4442 | instr fetch_nop, op_nop, store_nop ;C7 ;NOP | |
4443 | instr fetch_nop, op_nop, store_nop ;C8 ;NOP | |
4444 | instr fetch_nop, op_nop, store_nop ;C9 ;NOP | |
4445 | instr fetch_nop, op_nop, store_nop ;CA ;NOP | |
4446 | instr fetch_nop, op_nop, store_nop ;CB ;NOP | |
4447 | instr fetch_nop, op_nop, store_nop ;CC ;NOP | |
4448 | instr fetch_nop, op_nop, store_nop ;CD ;NOP | |
4449 | instr fetch_nop, op_nop, store_nop ;CE ;NOP | |
4450 | instr fetch_nop, op_nop, store_nop ;CF ;NOP | |
4451 | instr fetch_nop, op_nop, store_nop ;D0 ;NOP | |
4452 | instr fetch_nop, op_nop, store_nop ;D1 ;NOP | |
4453 | instr fetch_nop, op_nop, store_nop ;D2 ;NOP | |
4454 | instr fetch_nop, op_nop, store_nop ;D3 ;NOP | |
4455 | instr fetch_nop, op_nop, store_nop ;D4 ;NOP | |
4456 | instr fetch_nop, op_nop, store_nop ;D5 ;NOP | |
4457 | instr fetch_nop, op_nop, store_nop ;D6 ;NOP | |
4458 | instr fetch_nop, op_nop, store_nop ;D7 ;NOP | |
4459 | instr fetch_nop, op_nop, store_nop ;D8 ;NOP | |
4460 | instr fetch_nop, op_nop, store_nop ;D9 ;NOP | |
4461 | instr fetch_nop, op_nop, store_nop ;DA ;NOP | |
4462 | instr fetch_nop, op_nop, store_nop ;DB ;NOP | |
4463 | instr fetch_nop, op_nop, store_nop ;DC ;NOP | |
4464 | instr fetch_nop, op_nop, store_nop ;DD ;NOP | |
4465 | instr fetch_nop, op_nop, store_nop ;DE ;NOP | |
4466 | instr fetch_nop, op_nop, store_nop ;DF ;NOP | |
4467 | instr fetch_nop, op_nop, store_nop ;E0 ;NOP | |
4468 | instr fetch_nop, op_nop, store_nop ;E1 ;NOP | |
4469 | instr fetch_nop, op_nop, store_nop ;E2 ;NOP | |
4470 | instr fetch_nop, op_nop, store_nop ;E3 ;NOP | |
4471 | instr fetch_nop, op_nop, store_nop ;E4 ;NOP | |
4472 | instr fetch_nop, op_nop, store_nop ;E5 ;NOP | |
4473 | instr fetch_nop, op_nop, store_nop ;E6 ;NOP | |
4474 | instr fetch_nop, op_nop, store_nop ;E7 ;NOP | |
4475 | instr fetch_nop, op_nop, store_nop ;E8 ;NOP | |
4476 | instr fetch_nop, op_nop, store_nop ;E9 ;NOP | |
4477 | instr fetch_nop, op_nop, store_nop ;EA ;NOP | |
4478 | instr fetch_nop, op_nop, store_nop ;EB ;NOP | |
4479 | instr fetch_nop, op_nop, store_nop ;EC ;NOP | |
4480 | instr fetch_nop, op_nop, store_nop ;ED ;NOP | |
4481 | instr fetch_nop, op_nop, store_nop ;EE ;NOP | |
4482 | instr fetch_nop, op_nop, store_nop ;EF ;NOP | |
4483 | instr fetch_nop, op_nop, store_nop ;F0 ;NOP | |
4484 | instr fetch_nop, op_nop, store_nop ;F1 ;NOP | |
4485 | instr fetch_nop, op_nop, store_nop ;F2 ;NOP | |
4486 | instr fetch_nop, op_nop, store_nop ;F3 ;NOP | |
4487 | instr fetch_nop, op_nop, store_nop ;F4 ;NOP | |
4488 | instr fetch_nop, op_nop, store_nop ;F5 ;NOP | |
4489 | instr fetch_nop, op_nop, store_nop ;F6 ;NOP | |
4490 | instr fetch_nop, op_nop, store_nop ;F7 ;NOP | |
4491 | instr fetch_nop, op_nop, store_nop ;F8 ;NOP | |
4492 | instr fetch_nop, op_nop, store_nop ;F9 ;NOP | |
4493 | instr fetch_nop, op_nop, store_nop ;FA ;NOP | |
4494 | instr fetch_nop, op_nop, store_nop ;FB ;NOP | |
4495 | instr fetch_nop, op_nop, store_nop ;FC ;NOP | |
4496 | instr fetch_nop, op_nop, store_nop ;FD ;NOP | |
4497 | instr fetch_nop, op_nop, store_nop ;FE ;NOP | |
4498 | instr fetch_nop, op_nop, store_nop ;FF ;NOP | |
4499 | #endif | |
fa9059af L |
4500 | |
4501 | #endif | |
4502 | ||
4503 | ;---------------------------------------------------------------- | |
4504 | ; Lookup table, stolen from z80ex, Z80 emulation library. | |
4505 | ; http://z80ex.sourceforge.net/ | |
4506 | ||
4507 | ; The S, Z, 5 and 3 bits and the parity of the lookup value | |
4508 | ||
5c8bb361 | 4509 | checkspace PC, 256 |
623dd899 L |
4510 | |
4511 | .org (PC+255) & 0xff00 | |
fa9059af | 4512 | ; .org opcjmp + 256 |
623dd899 | 4513 | ; .org sz53p_table_pos |
e7a0f403 | 4514 | ; .org FLASHEND & 0xff00 |
4c92af0d | 4515 | ; .org 0x1fff & 0xff00 |
fa9059af L |
4516 | |
4517 | sz53p_tab: | |
4518 | .db 0x44,0x00,0x00,0x04,0x00,0x04,0x04,0x00 | |
4519 | .db 0x08,0x0c,0x0c,0x08,0x0c,0x08,0x08,0x0c | |
4520 | .db 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 | |
4521 | .db 0x0c,0x08,0x08,0x0c,0x08,0x0c,0x0c,0x08 | |
4522 | .db 0x20,0x24,0x24,0x20,0x24,0x20,0x20,0x24 | |
4523 | .db 0x2c,0x28,0x28,0x2c,0x28,0x2c,0x2c,0x28 | |
4524 | .db 0x24,0x20,0x20,0x24,0x20,0x24,0x24,0x20 | |
4525 | .db 0x28,0x2c,0x2c,0x28,0x2c,0x28,0x28,0x2c | |
4526 | .db 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 | |
4527 | .db 0x0c,0x08,0x08,0x0c,0x08,0x0c,0x0c,0x08 | |
4528 | .db 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 | |
4529 | .db 0x08,0x0c,0x0c,0x08,0x0c,0x08,0x08,0x0c | |
4530 | .db 0x24,0x20,0x20,0x24,0x20,0x24,0x24,0x20 | |
4531 | .db 0x28,0x2c,0x2c,0x28,0x2c,0x28,0x28,0x2c | |
4532 | .db 0x20,0x24,0x24,0x20,0x24,0x20,0x20,0x24 | |
4533 | .db 0x2c,0x28,0x28,0x2c,0x28,0x2c,0x2c,0x28 | |
4534 | .db 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84 | |
4535 | .db 0x8c,0x88,0x88,0x8c,0x88,0x8c,0x8c,0x88 | |
4536 | .db 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80 | |
4537 | .db 0x88,0x8c,0x8c,0x88,0x8c,0x88,0x88,0x8c | |
4538 | .db 0xa4,0xa0,0xa0,0xa4,0xa0,0xa4,0xa4,0xa0 | |
4539 | .db 0xa8,0xac,0xac,0xa8,0xac,0xa8,0xa8,0xac | |
4540 | .db 0xa0,0xa4,0xa4,0xa0,0xa4,0xa0,0xa0,0xa4 | |
4541 | .db 0xac,0xa8,0xa8,0xac,0xa8,0xac,0xac,0xa8 | |
4542 | .db 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80 | |
4543 | .db 0x88,0x8c,0x8c,0x88,0x8c,0x88,0x88,0x8c | |
4544 | .db 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84 | |
4545 | .db 0x8c,0x88,0x88,0x8c,0x88,0x8c,0x8c,0x88 | |
4546 | .db 0xa0,0xa4,0xa4,0xa0,0xa4,0xa0,0xa0,0xa4 | |
4547 | .db 0xac,0xa8,0xa8,0xac,0xa8,0xac,0xac,0xa8 | |
4548 | .db 0xa4,0xa0,0xa0,0xa4,0xa0,0xa4,0xa4,0xa0 | |
4549 | .db 0xa8,0xac,0xac,0xa8,0xac,0xa8,0xa8,0xac | |
4550 | ||
4551 | ; vim:set ts=8 noet nowrap | |
4552 |