annotate z80inst.c @ 914:28ec32e720b2

Scale mouse data based on window size
author Michael Pavone <pavone@retrodev.com>
date Mon, 14 Dec 2015 19:36:01 -0800
parents 103d5cabbe14
children 1625555e346e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 314
diff changeset
1 /*
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 314
diff changeset
2 Copyright 2013 Michael Pavone
651
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
3 This file is part of BlastEm.
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 314
diff changeset
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 314
diff changeset
5 */
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 #include "z80inst.h"
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 #include <string.h>
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 #include <stdio.h>
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
10 #define NOP {Z80_NOP, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 1}
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
11 #define NOP2 {Z80_NOP, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 2}
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
12
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 z80inst z80_tbl_a[256] = {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 //0
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
15 NOP,
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16 {Z80_LD, Z80_BC, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 {Z80_LD, Z80_A, Z80_REG_INDIRECT | Z80_DIR, Z80_BC, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 {Z80_INC, Z80_BC, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 {Z80_INC, Z80_B, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20 {Z80_DEC, Z80_B, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21 {Z80_LD, Z80_B, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 {Z80_RLC, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 {Z80_EX, Z80_AF, Z80_REG, Z80_AF, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 {Z80_ADD, Z80_HL, Z80_REG, Z80_BC, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25 {Z80_LD, Z80_A, Z80_REG_INDIRECT, Z80_BC, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26 {Z80_DEC, Z80_BC, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 {Z80_INC, Z80_C, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
28 {Z80_DEC, Z80_C, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 {Z80_LD, Z80_C, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30 {Z80_RRC, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 //1
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
32 {Z80_DJNZ, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 {Z80_LD, Z80_DE, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 {Z80_LD, Z80_A, Z80_REG_INDIRECT | Z80_DIR, Z80_DE, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35 {Z80_INC, Z80_DE, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36 {Z80_INC, Z80_D, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 {Z80_DEC, Z80_D, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 {Z80_LD, Z80_D, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 {Z80_RL, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40 {Z80_JR, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41 {Z80_ADD, Z80_HL, Z80_REG, Z80_DE, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 {Z80_LD, Z80_A, Z80_REG_INDIRECT, Z80_DE, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43 {Z80_DEC, Z80_DE, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 {Z80_INC, Z80_E, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45 {Z80_DEC, Z80_E, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
46 {Z80_LD, Z80_E, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
47 {Z80_RR, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
48 //2
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
49 {Z80_JRCC, Z80_CC_NZ, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
50 {Z80_LD, Z80_HL, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
51 {Z80_LD, Z80_HL, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
52 {Z80_INC, Z80_HL, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
53 {Z80_INC, Z80_H, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
54 {Z80_DEC, Z80_H, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
55 {Z80_LD, Z80_H, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
56 {Z80_DAA, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
57 {Z80_JRCC, Z80_CC_Z, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
58 {Z80_ADD, Z80_HL, Z80_REG, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
59 {Z80_LD, Z80_HL, Z80_IMMED_INDIRECT, Z80_IMMED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
60 {Z80_DEC, Z80_HL, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
61 {Z80_INC, Z80_L, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
62 {Z80_DEC, Z80_L, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
63 {Z80_LD, Z80_L, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
64 {Z80_CPL, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
65 //3
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
66 {Z80_JRCC, Z80_CC_NC, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
67 {Z80_LD, Z80_SP, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
68 {Z80_LD, Z80_A, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
69 {Z80_INC, Z80_SP, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
70 {Z80_INC, Z80_UNUSED, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
71 {Z80_DEC, Z80_UNUSED, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
72 {Z80_LD, Z80_USE_IMMED, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
73 {Z80_SCF, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
74 {Z80_JRCC, Z80_CC_C, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
75 {Z80_ADD, Z80_HL, Z80_REG, Z80_SP, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
76 {Z80_LD, Z80_A, Z80_IMMED_INDIRECT, Z80_IMMED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
77 {Z80_DEC, Z80_SP, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
78 {Z80_INC, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
79 {Z80_DEC, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
80 {Z80_LD, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
81 {Z80_CCF, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
82 //4
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
83 {Z80_LD, Z80_B, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
84 {Z80_LD, Z80_B, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
85 {Z80_LD, Z80_B, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
86 {Z80_LD, Z80_B, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
87 {Z80_LD, Z80_B, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
88 {Z80_LD, Z80_B, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
89 {Z80_LD, Z80_B, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
90 {Z80_LD, Z80_B, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
91 {Z80_LD, Z80_C, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
92 {Z80_LD, Z80_C, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
93 {Z80_LD, Z80_C, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
94 {Z80_LD, Z80_C, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
95 {Z80_LD, Z80_C, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
96 {Z80_LD, Z80_C, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
97 {Z80_LD, Z80_C, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
98 {Z80_LD, Z80_C, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
99 //5
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
100 {Z80_LD, Z80_D, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
101 {Z80_LD, Z80_D, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
102 {Z80_LD, Z80_D, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
103 {Z80_LD, Z80_D, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
104 {Z80_LD, Z80_D, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
105 {Z80_LD, Z80_D, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
106 {Z80_LD, Z80_D, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
107 {Z80_LD, Z80_D, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
108 {Z80_LD, Z80_E, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
109 {Z80_LD, Z80_E, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
110 {Z80_LD, Z80_E, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 {Z80_LD, Z80_E, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112 {Z80_LD, Z80_E, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
113 {Z80_LD, Z80_E, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
114 {Z80_LD, Z80_E, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
115 {Z80_LD, Z80_E, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
116 //6
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
117 {Z80_LD, Z80_H, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
118 {Z80_LD, Z80_H, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
119 {Z80_LD, Z80_H, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120 {Z80_LD, Z80_H, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
121 {Z80_LD, Z80_H, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
122 {Z80_LD, Z80_H, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
123 {Z80_LD, Z80_H, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
124 {Z80_LD, Z80_H, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
125 {Z80_LD, Z80_L, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
126 {Z80_LD, Z80_L, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127 {Z80_LD, Z80_L, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
128 {Z80_LD, Z80_L, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
129 {Z80_LD, Z80_L, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
130 {Z80_LD, Z80_L, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
131 {Z80_LD, Z80_L, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
132 {Z80_LD, Z80_L, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
133 //7
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
134 {Z80_LD, Z80_B, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
135 {Z80_LD, Z80_C, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
136 {Z80_LD, Z80_D, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
137 {Z80_LD, Z80_E, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
138 {Z80_LD, Z80_H, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
139 {Z80_LD, Z80_L, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
140 {Z80_HALT, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
141 {Z80_LD, Z80_A, Z80_REG_INDIRECT | Z80_DIR, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
142 {Z80_LD, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
143 {Z80_LD, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
144 {Z80_LD, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
145 {Z80_LD, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
146 {Z80_LD, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
147 {Z80_LD, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
148 {Z80_LD, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
149 {Z80_LD, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
150 //8
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
151 {Z80_ADD, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
152 {Z80_ADD, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
153 {Z80_ADD, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
154 {Z80_ADD, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
155 {Z80_ADD, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
156 {Z80_ADD, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
157 {Z80_ADD, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
158 {Z80_ADD, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
159 {Z80_ADC, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
160 {Z80_ADC, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
161 {Z80_ADC, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
162 {Z80_ADC, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
163 {Z80_ADC, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
164 {Z80_ADC, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
165 {Z80_ADC, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
166 {Z80_ADC, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
167 //9
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
168 {Z80_SUB, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
169 {Z80_SUB, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
170 {Z80_SUB, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
171 {Z80_SUB, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
172 {Z80_SUB, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
173 {Z80_SUB, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
174 {Z80_SUB, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
175 {Z80_SUB, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
176 {Z80_SBC, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
177 {Z80_SBC, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
178 {Z80_SBC, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
179 {Z80_SBC, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
180 {Z80_SBC, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
181 {Z80_SBC, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
182 {Z80_SBC, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
183 {Z80_SBC, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
184 //A
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
185 {Z80_AND, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
186 {Z80_AND, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
187 {Z80_AND, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
188 {Z80_AND, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
189 {Z80_AND, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
190 {Z80_AND, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
191 {Z80_AND, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
192 {Z80_AND, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
193 {Z80_XOR, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
194 {Z80_XOR, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
195 {Z80_XOR, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
196 {Z80_XOR, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
197 {Z80_XOR, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
198 {Z80_XOR, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
199 {Z80_XOR, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
200 {Z80_XOR, Z80_A, Z80_REG, Z80_A, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
201 //B
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
202 {Z80_OR, Z80_A, Z80_REG, Z80_B, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
203 {Z80_OR, Z80_A, Z80_REG, Z80_C, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
204 {Z80_OR, Z80_A, Z80_REG, Z80_D, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
205 {Z80_OR, Z80_A, Z80_REG, Z80_E, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
206 {Z80_OR, Z80_A, Z80_REG, Z80_H, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
207 {Z80_OR, Z80_A, Z80_REG, Z80_L, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
208 {Z80_OR, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
209 {Z80_OR, Z80_A, Z80_REG, Z80_A, 0},
270
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
210 {Z80_CP, Z80_A, Z80_REG, Z80_B, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
211 {Z80_CP, Z80_A, Z80_REG, Z80_C, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
212 {Z80_CP, Z80_A, Z80_REG, Z80_D, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
213 {Z80_CP, Z80_A, Z80_REG, Z80_E, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
214 {Z80_CP, Z80_A, Z80_REG, Z80_H, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
215 {Z80_CP, Z80_A, Z80_REG, Z80_L, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
216 {Z80_CP, Z80_A, Z80_REG_INDIRECT, Z80_HL, 0},
df5bf4c113dc Fix decoding of CP.
Mike Pavone <pavone@retrodev.com>
parents: 256
diff changeset
217 {Z80_CP, Z80_A, Z80_REG, Z80_A, 0},
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
218 //C
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
219 {Z80_RETCC, Z80_CC_NZ, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
220 {Z80_POP, Z80_BC, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
221 {Z80_JPCC, Z80_CC_NZ, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
222 {Z80_JP, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
223 {Z80_CALLCC, Z80_CC_NZ, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
224 {Z80_PUSH, Z80_BC, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
225 {Z80_ADD, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
226 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
227 {Z80_RETCC, Z80_CC_Z, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
228 {Z80_RET, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
229 {Z80_JPCC, Z80_CC_Z, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
230 {0, 0, 0, 0, 0},//BITS Prefix
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
231 {Z80_CALLCC, Z80_CC_Z, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
232 {Z80_CALL, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
233 {Z80_ADC, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
234 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x8},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
235 //D
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
236 {Z80_RETCC, Z80_CC_NC, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
237 {Z80_POP, Z80_DE, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
238 {Z80_JPCC, Z80_CC_NC, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
239 {Z80_OUT, Z80_A, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
240 {Z80_CALLCC, Z80_CC_NC, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
241 {Z80_PUSH, Z80_DE, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
242 {Z80_SUB, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
243 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x10},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
244 {Z80_RETCC, Z80_CC_C, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
245 {Z80_EXX, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
246 {Z80_JPCC, Z80_CC_C, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
247 {Z80_IN, Z80_A, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
248 {Z80_CALLCC, Z80_CC_C, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
249 {0, 0, 0, 0, 0},//IX Prefix
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
250 {Z80_SBC, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
251 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x18},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
252 //E
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
253 {Z80_RETCC, Z80_CC_PO, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
254 {Z80_POP, Z80_HL, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
255 {Z80_JPCC, Z80_CC_PO, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
256 {Z80_EX, Z80_HL, Z80_REG_INDIRECT | Z80_DIR, Z80_SP, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
257 {Z80_CALLCC, Z80_CC_PO, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
258 {Z80_PUSH, Z80_HL, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
259 {Z80_AND, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
260 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x20},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
261 {Z80_RETCC, Z80_CC_PE, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
262 {Z80_JP, Z80_UNUSED, Z80_REG_INDIRECT, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
263 {Z80_JPCC, Z80_CC_PE, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
264 {Z80_EX, Z80_DE, Z80_REG, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
265 {Z80_CALLCC, Z80_CC_PE, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
266 {0, 0, 0, 0, 0},//EXTD Prefix
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
267 {Z80_XOR, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
268 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x28},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
269 //F
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
270 {Z80_RETCC, Z80_CC_P, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
271 {Z80_POP, Z80_AF, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
272 {Z80_JPCC, Z80_CC_P, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
273 {Z80_DI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
274 {Z80_CALLCC, Z80_CC_P, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
275 {Z80_PUSH, Z80_AF, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
276 {Z80_OR, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
277 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x30},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
278 {Z80_RETCC, Z80_CC_M, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
279 {Z80_LD, Z80_SP, Z80_REG, Z80_HL, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
280 {Z80_JPCC, Z80_CC_M, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
281 {Z80_EI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
282 {Z80_CALLCC, Z80_CC_M, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
283 {0, 0, 0, 0, 0},//IY Prefix
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
284 {Z80_CP, Z80_A, Z80_IMMED, Z80_UNUSED, 0},
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
285 {Z80_RST, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0x38}
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
286 };
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
287
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
288 z80inst z80_tbl_extd[0xC0-0x40] = {
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
289 //4
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
290 {Z80_IN, Z80_B, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
291 {Z80_OUT, Z80_B, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
292 {Z80_SBC, Z80_HL, Z80_REG, Z80_BC, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
293 {Z80_LD, Z80_BC, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
294 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
295 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
296 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
297 {Z80_LD, Z80_I, Z80_REG, Z80_A, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
298 {Z80_IN, Z80_C, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
299 {Z80_OUT, Z80_C, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
300 {Z80_ADC, Z80_HL, Z80_REG, Z80_BC, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
301 {Z80_LD, Z80_BC, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
302 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
303 {Z80_RETI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
304 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 3},//Set undocumented mode 0/1
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
305 {Z80_LD, Z80_R, Z80_REG, Z80_A, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
306 //5
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
307 {Z80_IN, Z80_D, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
308 {Z80_OUT, Z80_D, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
309 {Z80_SBC, Z80_HL, Z80_REG, Z80_DE, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
310 {Z80_LD, Z80_DE, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
311 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
312 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
313 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 1},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
314 {Z80_LD, Z80_A, Z80_REG, Z80_I, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
315 {Z80_IN, Z80_E, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
316 {Z80_OUT, Z80_E, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
317 {Z80_ADC, Z80_HL, Z80_REG, Z80_DE, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
318 {Z80_LD, Z80_DE, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
319 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
320 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
321 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 2},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
322 {Z80_LD, Z80_A, Z80_REG, Z80_R, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
323 //6
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
324 {Z80_IN, Z80_H, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
325 {Z80_OUT, Z80_H, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
326 {Z80_SBC, Z80_HL, Z80_REG, Z80_HL, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
327 {Z80_LD, Z80_HL, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
328 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
329 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
330 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
331 {Z80_RRD, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
332 {Z80_IN, Z80_L, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
333 {Z80_OUT, Z80_L, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
334 {Z80_ADC, Z80_HL, Z80_REG, Z80_HL, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
335 {Z80_LD, Z80_HL, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
336 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
337 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
338 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 3},//Set undocumented mode 0/1
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
339 {Z80_RLD, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
340 //7
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
341 {Z80_IN, Z80_UNUSED, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
342 {Z80_OUT, Z80_USE_IMMED, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
343 {Z80_SBC, Z80_HL, Z80_REG, Z80_SP, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
344 {Z80_LD, Z80_SP, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
345 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
346 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
347 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 1},
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
348 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
349 {Z80_IN, Z80_A, Z80_REG_INDIRECT, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
350 {Z80_OUT, Z80_A, Z80_REG_INDIRECT | Z80_DIR, Z80_C, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
351 {Z80_ADC, Z80_HL, Z80_REG, Z80_SP, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
352 {Z80_LD, Z80_SP, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
353 {Z80_NEG, Z80_A, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
354 {Z80_RETN, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
355 {Z80_IM, Z80_UNUSED, Z80_IMMED, Z80_UNUSED, 2},
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
356 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
357 //8
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
358 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
359 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
360 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
361 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
362 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
363 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
364 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
365 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
366 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
367 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
368 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
369 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
370 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
371 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
372 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
373 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
374 //9
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
375 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
376 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
377 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
378 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
379 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
380 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
381 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
382 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
383 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
384 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
385 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
386 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
387 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
388 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
389 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
390 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
391 //A
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
392 {Z80_LDI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
393 {Z80_CPI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
394 {Z80_INI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
395 {Z80_OUTI, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
396 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
397 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
398 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
399 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
400 {Z80_LDD, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
401 {Z80_CPD, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
402 {Z80_IND, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
403 {Z80_OUTD, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
404 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
405 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
406 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
407 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
408 //B
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
409 {Z80_LDIR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
410 {Z80_CPIR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
411 {Z80_INIR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
412 {Z80_OTIR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
413 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
414 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
415 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
416 NOP2,
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
417 {Z80_LDDR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
418 {Z80_CPDR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
419 {Z80_INDR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
420 {Z80_OTDR, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 0},
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
421 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
422 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
423 NOP2,
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
424 NOP2
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
425 };
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
426
201
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
427 #define SHIFT_BLOCK(op) \
247
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
428 {op, Z80_B, Z80_UNUSED, Z80_UNUSED, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
429 {op, Z80_C, Z80_UNUSED, Z80_UNUSED, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
430 {op, Z80_D, Z80_UNUSED, Z80_UNUSED, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
431 {op, Z80_E, Z80_UNUSED, Z80_UNUSED, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
432 {op, Z80_H, Z80_UNUSED, Z80_UNUSED, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
433 {op, Z80_L, Z80_UNUSED, Z80_UNUSED, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
434 {op, Z80_UNUSED, Z80_REG_INDIRECT, Z80_HL, 1},\
682e505f5757 Implement rotation and bit set/reset instructions (untested).
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
435 {op, Z80_A, Z80_UNUSED, Z80_UNUSED, 1}
651
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
436
201
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
437 #define BIT_BLOCK(op, bit) \
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
438 {op, Z80_USE_IMMED, Z80_REG, Z80_B, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
439 {op, Z80_USE_IMMED, Z80_REG, Z80_C, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
440 {op, Z80_USE_IMMED, Z80_REG, Z80_D, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
441 {op, Z80_USE_IMMED, Z80_REG, Z80_E, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
442 {op, Z80_USE_IMMED, Z80_REG, Z80_H, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
443 {op, Z80_USE_IMMED, Z80_REG, Z80_L, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
444 {op, Z80_USE_IMMED, Z80_REG_INDIRECT, Z80_HL, bit},\
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
445 {op, Z80_USE_IMMED, Z80_REG, Z80_A, bit}
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
446
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
447 z80inst z80_tbl_bit[256] = {
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
448 //0
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
449 SHIFT_BLOCK(Z80_RLC),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
450 SHIFT_BLOCK(Z80_RRC),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
451 //1
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
452 SHIFT_BLOCK(Z80_RL),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
453 SHIFT_BLOCK(Z80_RR),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
454 //2
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
455 SHIFT_BLOCK(Z80_SLA),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
456 SHIFT_BLOCK(Z80_SRA),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
457 //3
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
458 SHIFT_BLOCK(Z80_SLL),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
459 SHIFT_BLOCK(Z80_SRL),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
460 //4
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
461 BIT_BLOCK(Z80_BIT, 0),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
462 BIT_BLOCK(Z80_BIT, 1),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
463 //5
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
464 BIT_BLOCK(Z80_BIT, 2),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
465 BIT_BLOCK(Z80_BIT, 3),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
466 //6
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
467 BIT_BLOCK(Z80_BIT, 4),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
468 BIT_BLOCK(Z80_BIT, 5),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
469 //7
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
470 BIT_BLOCK(Z80_BIT, 6),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
471 BIT_BLOCK(Z80_BIT, 7),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
472 //8
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
473 BIT_BLOCK(Z80_RES, 0),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
474 BIT_BLOCK(Z80_RES, 1),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
475 //9
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
476 BIT_BLOCK(Z80_RES, 2),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
477 BIT_BLOCK(Z80_RES, 3),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
478 //A
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
479 BIT_BLOCK(Z80_RES, 4),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
480 BIT_BLOCK(Z80_RES, 5),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
481 //B
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
482 BIT_BLOCK(Z80_RES, 6),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
483 BIT_BLOCK(Z80_RES, 7),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
484 //C
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
485 BIT_BLOCK(Z80_SET, 0),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
486 BIT_BLOCK(Z80_SET, 1),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
487 //D
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
488 BIT_BLOCK(Z80_SET, 2),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
489 BIT_BLOCK(Z80_SET, 3),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
490 //E
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
491 BIT_BLOCK(Z80_SET, 4),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
492 BIT_BLOCK(Z80_SET, 5),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
493 //F
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
494 BIT_BLOCK(Z80_SET, 6),
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
495 BIT_BLOCK(Z80_SET, 7)
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
496 };
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
497
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
498 z80inst z80_tbl_ix[256] = {
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
499 //0
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
500 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
501 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
502 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
503 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
504 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
505 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
506 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
507 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
508 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
509 {Z80_ADD, Z80_IX, Z80_REG, Z80_BC, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
510 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
511 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
512 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
513 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
514 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
515 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
516 //1
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
517 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
518 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
519 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
520 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
521 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
522 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
523 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
524 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
525 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
526 {Z80_ADD, Z80_IX, Z80_REG, Z80_DE, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
527 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
528 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
529 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
530 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
531 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
532 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
533 //2
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
534 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
535 {Z80_LD, Z80_IX, Z80_IMMED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
536 {Z80_LD, Z80_IX, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
537 {Z80_INC, Z80_IX, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
538 {Z80_INC, Z80_IXH, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
539 {Z80_DEC, Z80_IXH, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
540 {Z80_LD, Z80_IXH, Z80_IMMED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
541 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
542 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
543 {Z80_ADD, Z80_IX, Z80_REG, Z80_IX, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
544 {Z80_LD, Z80_IX, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
545 {Z80_DEC, Z80_IX, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
546 {Z80_INC, Z80_IXL, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
547 {Z80_DEC, Z80_IXL, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
548 {Z80_LD, Z80_IXL, Z80_IMMED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
549 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
550 //3
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
551 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
552 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
553 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
554 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
555 {Z80_INC, Z80_UNUSED, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
556 {Z80_DEC, Z80_UNUSED, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
557 {Z80_LD, Z80_USE_IMMED, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
558 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
559 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
560 {Z80_ADD, Z80_IX, Z80_REG, Z80_SP, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
561 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
562 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
563 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
564 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
565 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
566 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
567 //4
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
568 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
569 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
570 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
571 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
572 {Z80_LD, Z80_B, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
573 {Z80_LD, Z80_B, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
574 {Z80_LD, Z80_B, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
575 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
576 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
577 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
578 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
579 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
580 {Z80_LD, Z80_C, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
581 {Z80_LD, Z80_C, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
582 {Z80_LD, Z80_C, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
583 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
584 //5
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
585 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
586 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
587 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
588 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
589 {Z80_LD, Z80_D, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
590 {Z80_LD, Z80_D, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
591 {Z80_LD, Z80_D, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
592 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
593 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
594 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
595 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
596 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
597 {Z80_LD, Z80_E, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
598 {Z80_LD, Z80_E, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
599 {Z80_LD, Z80_E, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
600 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
601 //6
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
602 {Z80_LD, Z80_IXH, Z80_REG, Z80_B, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
603 {Z80_LD, Z80_IXH, Z80_REG, Z80_C, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
604 {Z80_LD, Z80_IXH, Z80_REG, Z80_D, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
605 {Z80_LD, Z80_IXH, Z80_REG, Z80_E, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
606 {Z80_LD, Z80_IXH, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
607 {Z80_LD, Z80_IXH, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
608 {Z80_LD, Z80_H, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
609 {Z80_LD, Z80_IXH, Z80_REG, Z80_A, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
610 {Z80_LD, Z80_IXL, Z80_REG, Z80_B, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
611 {Z80_LD, Z80_IXL, Z80_REG, Z80_C, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
612 {Z80_LD, Z80_IXL, Z80_REG, Z80_D, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
613 {Z80_LD, Z80_IXL, Z80_REG, Z80_E, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
614 {Z80_LD, Z80_IXL, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
615 {Z80_LD, Z80_IXL, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
616 {Z80_LD, Z80_L, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
617 {Z80_LD, Z80_IXL, Z80_REG, Z80_A, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
618 //7
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
619 {Z80_LD, Z80_B, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
620 {Z80_LD, Z80_C, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
621 {Z80_LD, Z80_D, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
622 {Z80_LD, Z80_E, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
623 {Z80_LD, Z80_H, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
624 {Z80_LD, Z80_L, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
625 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
626 {Z80_LD, Z80_A, Z80_IX_DISPLACE | Z80_DIR, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
627 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
628 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
629 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
630 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
631 {Z80_LD, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
632 {Z80_LD, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
633 {Z80_LD, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
634 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
635 //8
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
636 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
637 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
638 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
639 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
640 {Z80_ADD, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
641 {Z80_ADD, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
642 {Z80_ADD, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
643 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
644 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
645 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
646 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
647 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
648 {Z80_ADC, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
649 {Z80_ADC, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
650 {Z80_ADC, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
651 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
652 //9
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
653 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
654 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
655 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
656 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
657 {Z80_SUB, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
658 {Z80_SUB, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
659 {Z80_SUB, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
660 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
661 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
662 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
663 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
664 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
665 {Z80_SBC, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
666 {Z80_SBC, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
667 {Z80_SBC, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
668 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
669 //A
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
670 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
671 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
672 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
673 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
674 {Z80_AND, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
675 {Z80_AND, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
676 {Z80_AND, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
677 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
678 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
679 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
680 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
681 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
682 {Z80_XOR, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
683 {Z80_XOR, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
684 {Z80_XOR, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
685 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
686 //B
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
687 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
688 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
689 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
690 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
691 {Z80_OR, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
692 {Z80_OR, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
693 {Z80_OR, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
694 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
695 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
696 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
697 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
698 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
699 {Z80_CP, Z80_A, Z80_REG, Z80_IXH, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
700 {Z80_CP, Z80_A, Z80_REG, Z80_IXL, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
701 {Z80_CP, Z80_A, Z80_IX_DISPLACE, 0, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
702 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
703 //C
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
704 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
705 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
706 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
707 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
708 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
709 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
710 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
711 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
712 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
713 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
714 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
715 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
716 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
717 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
718 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
719 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
720 //D
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
721 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
722 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
723 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
724 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
725 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
726 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
727 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
728 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
729 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
730 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
731 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
732 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
733 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
734 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
735 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
736 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
737 //E
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
738 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
739 {Z80_POP, Z80_IX, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
740 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
741 {Z80_EX, Z80_IX, Z80_REG_INDIRECT | Z80_DIR, Z80_SP, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
742 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
743 {Z80_PUSH, Z80_IX, Z80_UNUSED, Z80_UNUSED, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
744 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
745 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
746 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
747 {Z80_JP, Z80_UNUSED, Z80_REG_INDIRECT, Z80_IX, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
748 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
749 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
750 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
751 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
752 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
753 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
754 //F
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
755 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
756 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
757 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
758 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
759 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
760 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
761 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
762 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
763 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
764 {Z80_LD, Z80_SP, Z80_REG, Z80_IX, 0},
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
765 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
766 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
767 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
768 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
769 NOP2,
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
770 NOP2
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
771 };
202
693ad04b965e Distinguish between 1-byte and 2-byte NOPs
Mike Pavone <pavone@retrodev.com>
parents: 201
diff changeset
772
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
773 #define SHIFT_BLOCK_IX(op) \
651
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
774 {op, Z80_B, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
775 {op, Z80_C, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
776 {op, Z80_D, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
777 {op, Z80_E, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
778 {op, Z80_H, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
779 {op, Z80_L, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
780 {op, Z80_UNUSED, Z80_IX_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
781 {op, Z80_A, Z80_IX_DISPLACE | Z80_DIR, 0, 1}
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
782
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
783 #define BIT_BLOCK_IX(bit) \
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
784 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
785 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
786 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
787 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
788 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
789 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
790 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
791 {Z80_BIT, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit}
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
792
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
793 #define BIT_BLOCK_IX_REG(op, bit) \
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
794 {op, Z80_B, Z80_IX_DISPLACE | Z80_DIR, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
795 {op, Z80_C, Z80_IX_DISPLACE | Z80_DIR, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
796 {op, Z80_D, Z80_IX_DISPLACE | Z80_DIR, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
797 {op, Z80_E, Z80_IX_DISPLACE | Z80_DIR, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
798 {op, Z80_H, Z80_IX_DISPLACE | Z80_DIR, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
799 {op, Z80_L, Z80_IX_DISPLACE | Z80_DIR, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
800 {op, Z80_USE_IMMED, Z80_IX_DISPLACE, 0, bit},\
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
801 {op, Z80_A, Z80_IX_DISPLACE | Z80_DIR, 0, bit}
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
802
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
803 z80inst z80_tbl_ix_bit[256] = {
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
804 //0
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
805 SHIFT_BLOCK_IX(Z80_RLC),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
806 SHIFT_BLOCK_IX(Z80_RRC),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
807 //1
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
808 SHIFT_BLOCK_IX(Z80_RL),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
809 SHIFT_BLOCK_IX(Z80_RR),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
810 //2
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
811 SHIFT_BLOCK_IX(Z80_SLA),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
812 SHIFT_BLOCK_IX(Z80_SRA),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
813 //3
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
814 SHIFT_BLOCK_IX(Z80_SLL),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
815 SHIFT_BLOCK_IX(Z80_SRL),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
816 //4
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
817 BIT_BLOCK_IX(0),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
818 BIT_BLOCK_IX(1),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
819 //5
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
820 BIT_BLOCK_IX(2),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
821 BIT_BLOCK_IX(3),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
822 //6
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
823 BIT_BLOCK_IX(4),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
824 BIT_BLOCK_IX(5),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
825 //7
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
826 BIT_BLOCK_IX(6),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
827 BIT_BLOCK_IX(7),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
828 //8
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
829 BIT_BLOCK_IX_REG(Z80_RES, 0),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
830 BIT_BLOCK_IX_REG(Z80_RES, 1),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
831 //9
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
832 BIT_BLOCK_IX_REG(Z80_RES, 2),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
833 BIT_BLOCK_IX_REG(Z80_RES, 3),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
834 //A
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
835 BIT_BLOCK_IX_REG(Z80_RES, 4),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
836 BIT_BLOCK_IX_REG(Z80_RES, 5),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
837 //B
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
838 BIT_BLOCK_IX_REG(Z80_RES, 6),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
839 BIT_BLOCK_IX_REG(Z80_RES, 7),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
840 //C
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
841 BIT_BLOCK_IX_REG(Z80_SET, 0),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
842 BIT_BLOCK_IX_REG(Z80_SET, 1),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
843 //D
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
844 BIT_BLOCK_IX_REG(Z80_SET, 2),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
845 BIT_BLOCK_IX_REG(Z80_SET, 3),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
846 //E
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
847 BIT_BLOCK_IX_REG(Z80_SET, 4),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
848 BIT_BLOCK_IX_REG(Z80_SET, 5),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
849 //F
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
850 BIT_BLOCK_IX_REG(Z80_SET, 6),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
851 BIT_BLOCK_IX_REG(Z80_SET, 7),
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
852 };
204
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
853
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
854 z80inst z80_tbl_iy[256] = {
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
855 //0
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
856 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
857 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
858 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
859 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
860 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
861 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
862 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
863 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
864 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
865 {Z80_ADD, Z80_IY, Z80_REG, Z80_BC, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
866 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
867 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
868 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
869 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
870 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
871 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
872 //1
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
873 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
874 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
875 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
876 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
877 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
878 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
879 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
880 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
881 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
882 {Z80_ADD, Z80_IY, Z80_REG, Z80_DE, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
883 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
884 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
885 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
886 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
887 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
888 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
889 //2
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
890 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
891 {Z80_LD, Z80_IY, Z80_IMMED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
892 {Z80_LD, Z80_IY, Z80_IMMED_INDIRECT | Z80_DIR, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
893 {Z80_INC, Z80_IY, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
894 {Z80_INC, Z80_IYH, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
895 {Z80_DEC, Z80_IYH, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
896 {Z80_LD, Z80_IYH, Z80_IMMED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
897 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
898 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
899 {Z80_ADD, Z80_IY, Z80_REG, Z80_IY, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
900 {Z80_LD, Z80_IY, Z80_IMMED_INDIRECT, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
901 {Z80_DEC, Z80_IY, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
902 {Z80_INC, Z80_IYL, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
903 {Z80_DEC, Z80_IYL, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
904 {Z80_LD, Z80_IYL, Z80_IMMED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
905 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
906 //3
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
907 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
908 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
909 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
910 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
911 {Z80_INC, Z80_UNUSED, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
912 {Z80_DEC, Z80_UNUSED, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
913 {Z80_LD, Z80_USE_IMMED, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
914 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
915 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
916 {Z80_ADD, Z80_IY, Z80_REG, Z80_SP, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
917 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
918 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
919 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
920 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
921 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
922 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
923 //4
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
924 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
925 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
926 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
927 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
928 {Z80_LD, Z80_B, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
929 {Z80_LD, Z80_B, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
930 {Z80_LD, Z80_B, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
931 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
932 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
933 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
934 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
935 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
936 {Z80_LD, Z80_C, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
937 {Z80_LD, Z80_C, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
938 {Z80_LD, Z80_C, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
939 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
940 //5
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
941 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
942 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
943 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
944 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
945 {Z80_LD, Z80_D, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
946 {Z80_LD, Z80_D, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
947 {Z80_LD, Z80_D, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
948 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
949 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
950 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
951 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
952 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
953 {Z80_LD, Z80_E, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
954 {Z80_LD, Z80_E, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
955 {Z80_LD, Z80_E, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
956 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
957 //6
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
958 {Z80_LD, Z80_IYH, Z80_REG, Z80_B, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
959 {Z80_LD, Z80_IYH, Z80_REG, Z80_C, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
960 {Z80_LD, Z80_IYH, Z80_REG, Z80_D, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
961 {Z80_LD, Z80_IYH, Z80_REG, Z80_E, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
962 {Z80_LD, Z80_IYH, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
963 {Z80_LD, Z80_IYH, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
964 {Z80_LD, Z80_H, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
965 {Z80_LD, Z80_IYH, Z80_REG, Z80_A, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
966 {Z80_LD, Z80_IYL, Z80_REG, Z80_B, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
967 {Z80_LD, Z80_IYL, Z80_REG, Z80_C, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
968 {Z80_LD, Z80_IYL, Z80_REG, Z80_D, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
969 {Z80_LD, Z80_IYL, Z80_REG, Z80_E, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
970 {Z80_LD, Z80_IYL, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
971 {Z80_LD, Z80_IYL, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
972 {Z80_LD, Z80_L, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
973 {Z80_LD, Z80_IYL, Z80_REG, Z80_A, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
974 //7
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
975 {Z80_LD, Z80_B, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
976 {Z80_LD, Z80_C, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
977 {Z80_LD, Z80_D, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
978 {Z80_LD, Z80_E, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
979 {Z80_LD, Z80_H, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
980 {Z80_LD, Z80_L, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
981 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
982 {Z80_LD, Z80_A, Z80_IY_DISPLACE | Z80_DIR, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
983 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
984 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
985 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
986 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
987 {Z80_LD, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
988 {Z80_LD, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
989 {Z80_LD, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
990 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
991 //8
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
992 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
993 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
994 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
995 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
996 {Z80_ADD, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
997 {Z80_ADD, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
998 {Z80_ADD, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
999 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1000 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1001 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1002 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1003 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1004 {Z80_ADC, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1005 {Z80_ADC, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1006 {Z80_ADC, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1007 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1008 //9
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1009 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1010 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1011 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1012 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1013 {Z80_SUB, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1014 {Z80_SUB, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1015 {Z80_SUB, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1016 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1017 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1018 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1019 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1020 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1021 {Z80_SBC, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1022 {Z80_SBC, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1023 {Z80_SBC, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1024 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1025 //A
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1026 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1027 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1028 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1029 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1030 {Z80_AND, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1031 {Z80_AND, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1032 {Z80_AND, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1033 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1034 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1035 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1036 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1037 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1038 {Z80_XOR, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1039 {Z80_XOR, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1040 {Z80_XOR, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1041 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1042 //B
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1043 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1044 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1045 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1046 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1047 {Z80_OR, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1048 {Z80_OR, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1049 {Z80_OR, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1050 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1051 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1052 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1053 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1054 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1055 {Z80_CP, Z80_A, Z80_REG, Z80_IYH, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1056 {Z80_CP, Z80_A, Z80_REG, Z80_IYL, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1057 {Z80_CP, Z80_A, Z80_IY_DISPLACE, 0, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1058 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1059 //C
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1060 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1061 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1062 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1063 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1064 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1065 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1066 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1067 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1068 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1069 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1070 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1071 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1072 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1073 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1074 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1075 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1076 //D
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1077 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1078 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1079 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1080 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1081 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1082 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1083 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1084 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1085 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1086 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1087 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1088 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1089 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1090 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1091 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1092 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1093 //E
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1094 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1095 {Z80_POP, Z80_IY, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1096 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1097 {Z80_EX, Z80_IY, Z80_REG_INDIRECT | Z80_DIR, Z80_SP, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1098 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1099 {Z80_PUSH, Z80_IY, Z80_UNUSED, Z80_UNUSED, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1100 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1101 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1102 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1103 {Z80_JP, Z80_UNUSED, Z80_REG_INDIRECT, Z80_IY, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1104 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1105 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1106 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1107 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1108 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1109 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1110 //F
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1111 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1112 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1113 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1114 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1115 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1116 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1117 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1118 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1119 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1120 {Z80_LD, Z80_SP, Z80_REG, Z80_IY, 0},
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1121 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1122 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1123 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1124 NOP2,
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1125 NOP2,
213
4d4559b04c59 Make reset trigger debug exit to make it easier to test the same cases in blastem and musashi. Fix asl #1 overflow flag.
Mike Pavone <pavone@retrodev.com>
parents: 206
diff changeset
1126 //TODO: Enable this based on a define
4d4559b04c59 Make reset trigger debug exit to make it easier to test the same cases in blastem and musashi. Fix asl #1 overflow flag.
Mike Pavone <pavone@retrodev.com>
parents: 206
diff changeset
1127 {Z80_NOP, Z80_UNUSED, Z80_UNUSED, Z80_UNUSED, 42}
4d4559b04c59 Make reset trigger debug exit to make it easier to test the same cases in blastem and musashi. Fix asl #1 overflow flag.
Mike Pavone <pavone@retrodev.com>
parents: 206
diff changeset
1128 //NOP2
204
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1129 };
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1130
206
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1131 #define SHIFT_BLOCK_IY(op) \
651
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1132 {op, Z80_B, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1133 {op, Z80_C, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1134 {op, Z80_D, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1135 {op, Z80_E, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1136 {op, Z80_H, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1137 {op, Z80_L, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1138 {op, Z80_UNUSED, Z80_IY_DISPLACE | Z80_DIR, 0, 1},\
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1139 {op, Z80_A, Z80_IY_DISPLACE | Z80_DIR, 0, 1}
206
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1140
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1141 #define BIT_BLOCK_IY(bit) \
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1142 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1143 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1144 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1145 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1146 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1147 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1148 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1149 {Z80_BIT, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit}
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1150
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1151 #define BIT_BLOCK_IY_REG(op, bit) \
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1152 {op, Z80_B, Z80_IY_DISPLACE | Z80_DIR, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1153 {op, Z80_C, Z80_IY_DISPLACE | Z80_DIR, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1154 {op, Z80_D, Z80_IY_DISPLACE | Z80_DIR, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1155 {op, Z80_E, Z80_IY_DISPLACE | Z80_DIR, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1156 {op, Z80_H, Z80_IY_DISPLACE | Z80_DIR, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1157 {op, Z80_L, Z80_IY_DISPLACE | Z80_DIR, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1158 {op, Z80_USE_IMMED, Z80_IY_DISPLACE, 0, bit},\
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1159 {op, Z80_A, Z80_IY_DISPLACE | Z80_DIR, 0, bit}
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1160
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1161 z80inst z80_tbl_iy_bit[256] = {
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1162 //0
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1163 SHIFT_BLOCK_IY(Z80_RLC),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1164 SHIFT_BLOCK_IY(Z80_RRC),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1165 //1
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1166 SHIFT_BLOCK_IY(Z80_RL),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1167 SHIFT_BLOCK_IY(Z80_RR),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1168 //2
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1169 SHIFT_BLOCK_IY(Z80_SLA),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1170 SHIFT_BLOCK_IY(Z80_SRA),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1171 //3
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1172 SHIFT_BLOCK_IY(Z80_SLL),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1173 SHIFT_BLOCK_IY(Z80_SRL),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1174 //4
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1175 BIT_BLOCK_IY(0),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1176 BIT_BLOCK_IY(1),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1177 //5
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1178 BIT_BLOCK_IY(2),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1179 BIT_BLOCK_IY(3),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1180 //6
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1181 BIT_BLOCK_IY(4),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1182 BIT_BLOCK_IY(5),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1183 //7
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1184 BIT_BLOCK_IY(6),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1185 BIT_BLOCK_IY(7),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1186 //8
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1187 BIT_BLOCK_IY_REG(Z80_RES, 0),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1188 BIT_BLOCK_IY_REG(Z80_RES, 1),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1189 //9
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1190 BIT_BLOCK_IY_REG(Z80_RES, 2),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1191 BIT_BLOCK_IY_REG(Z80_RES, 3),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1192 //A
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1193 BIT_BLOCK_IY_REG(Z80_RES, 4),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1194 BIT_BLOCK_IY_REG(Z80_RES, 5),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1195 //B
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1196 BIT_BLOCK_IY_REG(Z80_RES, 6),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1197 BIT_BLOCK_IY_REG(Z80_RES, 7),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1198 //C
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1199 BIT_BLOCK_IY_REG(Z80_SET, 0),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1200 BIT_BLOCK_IY_REG(Z80_SET, 1),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1201 //D
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1202 BIT_BLOCK_IY_REG(Z80_SET, 2),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1203 BIT_BLOCK_IY_REG(Z80_SET, 3),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1204 //E
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1205 BIT_BLOCK_IY_REG(Z80_SET, 4),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1206 BIT_BLOCK_IY_REG(Z80_SET, 5),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1207 //F
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1208 BIT_BLOCK_IY_REG(Z80_SET, 6),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1209 BIT_BLOCK_IY_REG(Z80_SET, 7),
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1210 };
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1211
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1212 uint8_t * z80_decode(uint8_t * istream, z80inst * decoded)
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1213 {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1214 uint8_t tmp;
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1215 if (*istream == 0xCB) {
201
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1216 istream++;
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1217 memcpy(decoded, z80_tbl_bit + *istream, sizeof(z80inst));
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1218 } else if (*istream == 0xDD) {
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1219 istream++;
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1220 if (*istream == 0xCB) {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1221 tmp = *(++istream);
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1222 istream++;
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1223 memcpy(decoded, z80_tbl_ix_bit + *istream, sizeof(z80inst));
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1224 decoded->ea_reg = tmp;
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1225 } else {
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1226 memcpy(decoded, z80_tbl_ix + *istream, sizeof(z80inst));
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1227 if ((decoded->addr_mode & 0x1F) == Z80_IX_DISPLACE) {
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1228 decoded->ea_reg = *(++istream);
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1229 }
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1230 }
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1231 } else if (*istream == 0xED) {
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1232 istream++;
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1233 if (*istream < 0x40 || *istream >= 0xC0) {
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1234 memcpy(decoded, z80_tbl_extd + 0xBF, sizeof(z80inst));
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1235 } else {
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1236 memcpy(decoded, z80_tbl_extd + *istream-0x40, sizeof(z80inst));
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1237 }
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1238 } else if (*istream == 0xFD) {
204
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1239 istream++;
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1240 if (*istream == 0xCB) {
206
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1241 tmp = *(++istream);
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1242 istream++;
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1243 memcpy(decoded, z80_tbl_iy_bit + *istream, sizeof(z80inst));
807ca611b561 Add support for IY bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 205
diff changeset
1244 decoded->ea_reg = tmp;
204
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1245 } else {
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1246 memcpy(decoded, z80_tbl_iy + *istream, sizeof(z80inst));
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1247 if ((decoded->addr_mode & 0x1F) == Z80_IY_DISPLACE) {
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1248 decoded->ea_reg = *(++istream);
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1249 }
204
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1250 }
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1251 } else {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1252 memcpy(decoded, z80_tbl_a + *istream, sizeof(z80inst));
651
103d5cabbe14 Fix flags for rra, rrca, rla and rlca. Fix timing for rr, rrc, rl and rlc when using IX or IY. Fix access to I and R registers (R still needs to be made 7-bit though). Fix flags for ld a, i. The fix for access to I fixes PCM playback in Titan Overdrive and music playback in Crackdown.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
1253
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1254 }
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1255 if ((decoded->addr_mode & 0x1F) == Z80_IMMED && decoded->op != Z80_RST && decoded->op != Z80_IM) {
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1256 decoded->immed = *(++istream);
256
ce7ce2b9c2df Fix decoding of address in JP and JPCC instructions in the Z80 core
Mike Pavone <pavone@retrodev.com>
parents: 247
diff changeset
1257 if ((decoded->reg >= Z80_BC && decoded->reg < Z80_UNUSED) || decoded->op == Z80_CALL || decoded->op == Z80_CALLCC || decoded->op == Z80_JP || decoded->op == Z80_JPCC) {
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1258 decoded->immed |= *(++istream) << 8;
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1259 } else if (decoded->immed & 0x80) {
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1260 decoded->immed |= 0xFF00;
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1261 }
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1262 } else if ((decoded->addr_mode & 0x1F) == Z80_IMMED_INDIRECT) {
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1263 decoded->immed = *(++istream);
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1264 if (decoded->op != Z80_OUT && decoded->op != Z80_IN) {
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1265 decoded->immed |= *(++istream) << 8;
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1266 }
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1267 }
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1268 if (decoded->reg == Z80_USE_IMMED && decoded->op != Z80_BIT && decoded->op != Z80_RES && decoded->op != Z80_SET) {
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1269 decoded->immed = *(++istream);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1270 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1271 return istream+1;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1272 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1273
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1274 char *z80_mnemonics[Z80_OTDR+1] = {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1275 "ld",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1276 "push",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1277 "pop",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1278 "ex",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1279 "exx",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1280 "ldi",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1281 "ldir",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1282 "ldd",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1283 "lddr",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1284 "cpi",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1285 "cpir",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1286 "cpd",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1287 "cpdr",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1288 "add",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1289 "adc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1290 "sub",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1291 "sbc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1292 "and",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1293 "or",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1294 "xor",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1295 "cp",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1296 "inc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1297 "dec",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1298 "daa",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1299 "cpl",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1300 "neg",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1301 "ccf",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1302 "scf",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1303 "nop",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1304 "halt",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1305 "di",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1306 "ei",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1307 "im",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1308 "rlc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1309 "rl",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1310 "rrc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1311 "rr",
201
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1312 "sla",
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1313 "sra",
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1314 "sll",
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1315 "srl",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1316 "rld",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1317 "rrd",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1318 "bit",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1319 "set",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1320 "res",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1321 "jp",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1322 "jp",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1323 "jr",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1324 "jr",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1325 "djnz",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1326 "call",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1327 "call",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1328 "ret",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1329 "ret",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1330 "reti",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1331 "retn",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1332 "rst",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1333 "in",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1334 "ini",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1335 "inir",
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1336 "ind",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1337 "indr",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1338 "out",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1339 "outi",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1340 "otir",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1341 "outd",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1342 "otdr"
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1343 };
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1344
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1345 char * z80_regs[Z80_USE_IMMED] = {
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 213
diff changeset
1346 "c",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1347 "b",
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 213
diff changeset
1348 "e",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1349 "d",
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 213
diff changeset
1350 "l",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1351 "h",
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 213
diff changeset
1352 "ixl",
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1353 "ixh",
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 213
diff changeset
1354 "iyl",
204
02dfa5962522 Add support for 2-byte IY instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 203
diff changeset
1355 "iyh",
200
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1356 "i",
d3066ceb29d1 Add support for EXTD group 2-byte Z80 instructions in decoder
Mike Pavone <pavone@retrodev.com>
parents: 199
diff changeset
1357 "r",
213
4d4559b04c59 Make reset trigger debug exit to make it easier to test the same cases in blastem and musashi. Fix asl #1 overflow flag.
Mike Pavone <pavone@retrodev.com>
parents: 206
diff changeset
1358 "a",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1359 "bc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1360 "de",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1361 "hl",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1362 "sp",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1363 "af",
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1364 "ix",
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1365 "iy",
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1366 };
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1367
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1368 char * z80_conditions[Z80_CC_M+1] = {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1369 "nz",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1370 "z",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1371 "nc",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1372 "c",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1373 "po",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1374 "pe",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1375 "p",
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1376 "m"
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1377 };
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1378
314
54c0e5f22198 Show absolute addresses for JR, JRCC and DJNZ in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 313
diff changeset
1379 int z80_disasm(z80inst * decoded, char * dst, uint16_t address)
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1380 {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1381 int len = sprintf(dst, "%s", z80_mnemonics[decoded->op]);
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1382 uint8_t needcomma;
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1383 if (decoded->addr_mode & Z80_DIR) {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1384 needcomma = 1;
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1385 switch (decoded->addr_mode & 0x1F)
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1386 {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1387 case Z80_REG:
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1388 len += sprintf(dst+len, " %s", z80_regs[decoded->ea_reg]);
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1389 break;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1390 case Z80_REG_INDIRECT:
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1391 len += sprintf(dst+len, " (%s)", z80_regs[decoded->ea_reg]);
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1392 break;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1393 case Z80_IMMED:
278
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1394 if (decoded->immed >= 63 || decoded->op == Z80_JP || decoded->op == Z80_JPCC || decoded->op == Z80_CALL || decoded->op == Z80_CALLCC || decoded->op == Z80_RST)
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1395 {
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1396 len += sprintf(dst+len, " $%X", decoded->immed);
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1397 } else {
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1398 len += sprintf(dst+len, " %d", decoded->immed);
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1399 }
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1400 break;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1401 case Z80_IMMED_INDIRECT:
278
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1402 len += sprintf(dst+len, " ($%X)", decoded->immed);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1403 break;
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1404 case Z80_IX_DISPLACE:
297
147e31983730 Fix printing of negative displacements in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 292
diff changeset
1405 len += sprintf(dst+len, " (ix+%d)", decoded->ea_reg & 0x80 ? decoded->ea_reg - 256 : decoded->ea_reg);
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1406 break;
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1407 case Z80_IY_DISPLACE:
297
147e31983730 Fix printing of negative displacements in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 292
diff changeset
1408 len += sprintf(dst+len, " (iy+%d)", decoded->ea_reg & 0x80 ? decoded->ea_reg - 256 : decoded->ea_reg);
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1409 break;
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1410 default:
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1411 needcomma = 0;
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1412 }
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1413 if (decoded->reg & Z80_IMMED_FLAG) {
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1414 len += sprintf(dst+len, "%s %d", needcomma ? "," : "", decoded->immed);
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1415 }
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1416 if ((decoded->reg & 0x1F) != Z80_UNUSED) {
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1417 if (decoded->op == Z80_JRCC || decoded->op == Z80_JPCC || decoded->op == Z80_CALLCC || decoded->op == Z80_RETCC) {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1418 len += sprintf(dst+len, "%s %s", needcomma ? "," : "", z80_conditions[decoded->reg & 0x1F]);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1419 } else {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1420 len += sprintf(dst+len, "%s %s", needcomma ? "," : "", z80_regs[decoded->reg & 0x1F]);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1421 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1422 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1423 } else {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1424 needcomma = 0;
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1425 if (decoded->reg & Z80_IMMED_FLAG) {
201
2d2fa345e1fc Add support for bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 200
diff changeset
1426 len += sprintf(dst+len, " %d", decoded->immed);
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1427 needcomma = 1;
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1428 }
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1429 if ((decoded->reg & 0x1F) != Z80_UNUSED) {
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1430 if (decoded->op == Z80_JRCC || decoded->op == Z80_JPCC || decoded->op == Z80_CALLCC || decoded->op == Z80_RETCC) {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1431 len += sprintf(dst+len, " %s", z80_conditions[decoded->reg & 0x1F]);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1432 } else {
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1433 len += sprintf(dst+len, " %s", z80_regs[decoded->reg & 0x1F]);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1434 }
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1435 needcomma = 1;
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1436 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1437 switch (decoded->addr_mode)
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1438 {
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1439 case Z80_REG:
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1440 len += sprintf(dst+len, "%s %s", needcomma ? "," : "" , z80_regs[decoded->ea_reg]);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1441 break;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1442 case Z80_REG_INDIRECT:
205
19b323614309 Add support for IX bit instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 204
diff changeset
1443 len += sprintf(dst+len, "%s (%s)", needcomma ? "," : "" , z80_regs[decoded->ea_reg]);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1444 break;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1445 case Z80_IMMED:
314
54c0e5f22198 Show absolute addresses for JR, JRCC and DJNZ in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 313
diff changeset
1446 if (decoded->op == Z80_JR || decoded->op == Z80_JRCC || decoded->op == Z80_DJNZ) {
54c0e5f22198 Show absolute addresses for JR, JRCC and DJNZ in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 313
diff changeset
1447 address += 2 + decoded->immed;
54c0e5f22198 Show absolute addresses for JR, JRCC and DJNZ in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 313
diff changeset
1448 len += sprintf(dst+len, "%s %X", needcomma ? "," : "" , address);
54c0e5f22198 Show absolute addresses for JR, JRCC and DJNZ in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 313
diff changeset
1449 } else if (decoded->immed >= 63 || decoded->op == Z80_JP || decoded->op == Z80_JPCC || decoded->op == Z80_CALL || decoded->op == Z80_CALLCC || decoded->op == Z80_RST)
278
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1450 {
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1451 len += sprintf(dst+len, "%s $%X", needcomma ? "," : "" , decoded->immed);
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1452 } else {
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1453 len += sprintf(dst+len, "%s %d", needcomma ? "," : "" , decoded->immed);
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1454 }
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1455 break;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1456 case Z80_IMMED_INDIRECT:
278
9578e5dea147 Use hex where appropriate in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 270
diff changeset
1457 len += sprintf(dst+len, "%s ($%X)", needcomma ? "," : "" , decoded->immed);
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1458 break;
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1459 case Z80_IX_DISPLACE:
297
147e31983730 Fix printing of negative displacements in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 292
diff changeset
1460 len += sprintf(dst+len, "%s (ix+%d)", needcomma ? "," : "" , decoded->ea_reg & 0x80 ? decoded->ea_reg - 256 : decoded->ea_reg);
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1461 break;
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1462 case Z80_IY_DISPLACE:
297
147e31983730 Fix printing of negative displacements in Z80 disassembler
Mike Pavone <pavone@retrodev.com>
parents: 292
diff changeset
1463 len += sprintf(dst+len, "%s (iy+%d)", needcomma ? "," : "" , decoded->ea_reg & 0x80 ? decoded->ea_reg - 256 : decoded->ea_reg);
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 202
diff changeset
1464 break;
199
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1465 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1466 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1467 return len;
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1468 }
69585e7d474f Add initial stab at Z80 decoder and disassembler
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1469
292
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1470 uint8_t z80_high_reg(uint8_t reg)
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1471 {
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1472 switch(reg)
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1473 {
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1474 case Z80_C:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1475 case Z80_BC:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1476 return Z80_B;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1477 case Z80_E:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1478 case Z80_DE:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1479 return Z80_D;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1480 case Z80_L:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1481 case Z80_HL:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1482 return Z80_H;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1483 case Z80_IXL:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1484 case Z80_IX:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1485 return Z80_IXH;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1486 case Z80_IYL:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1487 case Z80_IY:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1488 return Z80_IYH;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1489 default:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1490 return Z80_UNUSED;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1491 }
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1492 }
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1493
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1494 uint8_t z80_low_reg(uint8_t reg)
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1495 {
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1496 switch(reg)
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1497 {
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1498 case Z80_B:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1499 case Z80_BC:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1500 return Z80_C;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1501 case Z80_D:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1502 case Z80_DE:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1503 return Z80_E;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1504 case Z80_H:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1505 case Z80_HL:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1506 return Z80_L;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1507 case Z80_IXH:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1508 case Z80_IX:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1509 return Z80_IXL;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1510 case Z80_IYH:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1511 case Z80_IY:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1512 return Z80_IYL;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1513 default:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1514 return Z80_UNUSED;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1515 }
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1516 }
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1517
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1518 uint8_t z80_word_reg(uint8_t reg)
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1519 {
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1520 switch(reg)
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1521 {
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1522 case Z80_B:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1523 case Z80_C:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1524 return Z80_BC;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1525 case Z80_D:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1526 case Z80_E:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1527 return Z80_DE;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1528 case Z80_H:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1529 case Z80_L:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1530 return Z80_HL;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1531 case Z80_IXH:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1532 case Z80_IXL:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1533 return Z80_IX;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1534 case Z80_IYH:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1535 case Z80_IYL:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1536 return Z80_IY;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1537 default:
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1538 return Z80_UNUSED;
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1539 }
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1540 }
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1541
313
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1542 uint8_t z80_is_terminal(z80inst * inst)
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1543 {
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1544 return inst->op == Z80_RET || inst->op == Z80_RETI || inst->op == Z80_RETN || inst->op == Z80_JP
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1545 || inst->op == Z80_JR || inst->op == Z80_HALT || (inst->op == Z80_NOP && inst->immed == 42);
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1546 }
292
b970ea214ecb Added z80 test generator and z80 test runner.
Mike Pavone <pavone@retrodev.com>
parents: 278
diff changeset
1547
313
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1548
a13329645ea3 Fix terminal instruction detection in disassembler
Mike Pavone <pavone@retrodev.com>
parents: 297
diff changeset
1549