~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/emu/cpu/z8/z8dasm.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "emu.h"
2
 
#include "debugger.h"
3
 
#include "z8.h"
4
 
 
5
 
/***************************************************************************
6
 
    CONSTANTS
7
 
***************************************************************************/
8
 
 
9
 
static const char *const REGISTER_NAME[256] =
10
 
{
11
 
        "P0", "P1", "P2", "P3", "", "", "", "", "", "", "", "", "", "", "", "",
12
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
13
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
14
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
15
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
16
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
17
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
18
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
19
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
20
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
21
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
22
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
23
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
24
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
25
 
        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
26
 
        "SIO", "TMR", "T1", "PRE1", "T0", "PRE0", "P2M", "P3M", "P01M", "IPR", "IRQ", "IMR", "FLAGS", "RP", "SPH", "SPL"
27
 
};
28
 
 
29
 
static const char *const CONDITION_CODE[16] =
30
 
{
31
 
        "F", "LT", "LE", "ULE", "OV", "MI", "Z", "C",
32
 
        "", "GE", "GT", "UGT", "NOV", "PL", "NZ", "NC"
33
 
};
34
 
 
35
 
/***************************************************************************
36
 
    MACROS
37
 
***************************************************************************/
38
 
 
39
 
#define r               "R%u"
40
 
#define Ir              "@R%u"
41
 
#define R               "%02Xh"
42
 
#define RR              "%02Xh"
43
 
#define IR              "@%02Xh"
44
 
#define Irr             "@RR%u"
45
 
#define IRR             "@%02Xh"
46
 
#define IM              "#%02Xh"
47
 
#define X               "%02Xh(R%u)"
48
 
#define DA              "%04Xh"
49
 
#define RA              "%04Xh"
50
 
 
51
 
#define B0              oprom[0]
52
 
#define B1              oprom[1]
53
 
#define B0H             (B0 >> 4)
54
 
#define B0L             (B0 & 0x0f)
55
 
#define OPH             (opcode >> 4)
56
 
 
57
 
#define ARG(_formatting, _value)        { if (argc) dst += sprintf(dst, ", "); dst += sprintf(dst, _formatting, _value); argc++; }
58
 
 
59
 
#define arg_name(_value)                        ARG("%s", REGISTER_NAME[_value])
60
 
#define arg_cc                                          ARG("%s", CONDITION_CODE[OPH])
61
 
#define arg_r(_value)                           ARG(r, _value)
62
 
#define arg_Ir(_value)                          ARG(Ir, _value)
63
 
#define arg_Irr(_value)                         ARG(Irr, _value & 0x0f)
64
 
#define arg_R(_value)                           if ((_value & 0xf0) == 0xe0) ARG(r, _value & 0x0f) else if ((_value < 4) || (_value >= 0xf0)) arg_name(_value) else ARG(R, _value)
65
 
#define arg_RR(_value)                          if ((_value & 0xf0) == 0xe0) ARG(r, _value & 0x0f) else ARG(R, _value)
66
 
#define arg_IR(_value)                          if ((_value & 0xf0) == 0xe0) ARG(Ir, _value & 0x0f) else ARG(IR, _value)
67
 
#define arg_IRR(_value)                         if ((_value & 0xf0) == 0xe0) ARG(Irr, _value & 0x0f) else ARG(IRR, _value)
68
 
#define arg_IM(_value)                          ARG(IM, _value)
69
 
#define arg_RA                                          ARG(RA, pc + (INT8)B0 + 2)
70
 
#define arg_DA                                          ARG(DA, B0 << 8 | B1)
71
 
#define arg_X(_value1, _value2)         { if (argc) dst += sprintf(dst, ", "); dst += sprintf(dst, X, _value1, _value2); argc++; }
72
 
 
73
 
#define illegal                                         dst += sprintf(dst, "Illegal")
74
 
#define mnemonic(_mnemonic)                     dst += sprintf(dst, "%-5s", _mnemonic)
75
 
#define bytes(_count)                           oprom += (_count - 1)
76
 
#define step_over                                       flags = DASMFLAG_STEP_OVER
77
 
#define step_out                                        flags = DASMFLAG_STEP_OUT
78
 
 
79
 
/***************************************************************************
80
 
    DISASSEMBLER
81
 
***************************************************************************/
82
 
 
83
 
CPU_DISASSEMBLE( z8 )
84
 
{
85
 
        const UINT8 *startrom = oprom;
86
 
        UINT32 flags = 0;
87
 
        UINT8 opcode = *oprom++;
88
 
        char *dst = buffer;
89
 
        int argc = 0;
90
 
 
91
 
        switch (pc)
92
 
        {
93
 
        case 0x0000:
94
 
        case 0x0002:
95
 
        case 0x0004:
96
 
        case 0x0006:
97
 
        case 0x0008:
98
 
        case 0x000a:
99
 
                sprintf(buffer, "IRQ%u Vector %04Xh", pc / 2, opcode << 8 | *oprom++); break;
100
 
        default:
101
 
                switch (opcode)
102
 
                {
103
 
                        case 0x00:              mnemonic("DEC"); arg_R(B0); bytes(2);                                   break;
104
 
                        case 0x01:              mnemonic("DEC"); arg_IR(B0); bytes(2);                                  break;
105
 
                        case 0x02:              mnemonic("ADD"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
106
 
                        case 0x03:              mnemonic("ADD"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
107
 
                        case 0x04:              mnemonic("ADD"); arg_R(B1); arg_R(B0); bytes(3);                break;
108
 
                        case 0x05:              mnemonic("ADD"); arg_R(B1); arg_IR(B0); bytes(3);               break;
109
 
                        case 0x06:              mnemonic("ADD"); arg_R(B0); arg_IM(B1); bytes(3);               break;
110
 
                        case 0x07:              mnemonic("ADD"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
111
 
                        case 0x08:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
112
 
                        case 0x09:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
113
 
                        case 0x0a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
114
 
                        case 0x0b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
115
 
                        case 0x0c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
116
 
                        case 0x0d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
117
 
                        case 0x0e:              mnemonic("INC"); arg_r(OPH);                                                    break;
118
 
                        case 0x0f:              illegal;                                                                                                break;
119
 
 
120
 
                        case 0x10:              mnemonic("RLC"); arg_R(B0); bytes(2);                                   break;
121
 
                        case 0x11:              mnemonic("RLC"); arg_IR(B0); bytes(2);                                  break;
122
 
                        case 0x12:              mnemonic("ADC"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
123
 
                        case 0x13:              mnemonic("ADC"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
124
 
                        case 0x14:              mnemonic("ADC"); arg_R(B1); arg_R(B0); bytes(3);                break;
125
 
                        case 0x15:              mnemonic("ADC"); arg_R(B1); arg_IR(B0); bytes(3);               break;
126
 
                        case 0x16:              mnemonic("ADC"); arg_R(B0); arg_IM(B1); bytes(3);               break;
127
 
                        case 0x17:              mnemonic("ADC"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
128
 
                        case 0x18:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
129
 
                        case 0x19:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
130
 
                        case 0x1a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
131
 
                        case 0x1b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
132
 
                        case 0x1c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
133
 
                        case 0x1d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
134
 
                        case 0x1e:              mnemonic("INC"); arg_r(OPH);                                                    break;
135
 
                        case 0x1f:              illegal;                                                                                                break;
136
 
 
137
 
                        case 0x20:              mnemonic("INC"); arg_R(B0); bytes(2);                                   break;
138
 
                        case 0x21:              mnemonic("INC"); arg_IR(B0); bytes(2);                                  break;
139
 
                        case 0x22:              mnemonic("SUB"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
140
 
                        case 0x23:              mnemonic("SUB"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
141
 
                        case 0x24:              mnemonic("SUB"); arg_R(B1); arg_R(B0); bytes(3);                break;
142
 
                        case 0x25:              mnemonic("SUB"); arg_R(B1); arg_IR(B0); bytes(3);               break;
143
 
                        case 0x26:              mnemonic("SUB"); arg_R(B0); arg_IM(B1); bytes(3);               break;
144
 
                        case 0x27:              mnemonic("SUB"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
145
 
                        case 0x28:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
146
 
                        case 0x29:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
147
 
                        case 0x2a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
148
 
                        case 0x2b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
149
 
                        case 0x2c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
150
 
                        case 0x2d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
151
 
                        case 0x2e:              mnemonic("INC"); arg_r(OPH);                                                    break;
152
 
                        case 0x2f:              illegal;                                                                                                break;
153
 
 
154
 
                        case 0x30:              mnemonic("JP"); arg_IRR(B0); bytes(2);                                  break;
155
 
                        case 0x31:              mnemonic("SRP"); arg_IM(*oprom++);                                              break;
156
 
                        case 0x32:              mnemonic("SBC"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
157
 
                        case 0x33:              mnemonic("SBC"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
158
 
                        case 0x34:              mnemonic("SBC"); arg_R(B1); arg_R(B0); bytes(3);                break;
159
 
                        case 0x35:              mnemonic("SBC"); arg_R(B1); arg_IR(B0); bytes(3);               break;
160
 
                        case 0x36:              mnemonic("SBC"); arg_R(B0); arg_IM(B1); bytes(3);               break;
161
 
                        case 0x37:              mnemonic("SBC"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
162
 
                        case 0x38:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
163
 
                        case 0x39:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
164
 
                        case 0x3a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
165
 
                        case 0x3b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
166
 
                        case 0x3c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
167
 
                        case 0x3d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
168
 
                        case 0x3e:              mnemonic("INC"); arg_r(OPH);                                                    break;
169
 
                        case 0x3f:              illegal;                                                                                                break;
170
 
 
171
 
                        case 0x40:              mnemonic("DA"); arg_R(B0); bytes(2);                                    break;
172
 
                        case 0x41:              mnemonic("DA"); arg_IR(B0); bytes(2);                                   break;
173
 
                        case 0x42:              mnemonic("OR"); arg_r(B0H); arg_r(B0L); bytes(2);               break;
174
 
                        case 0x43:              mnemonic("OR"); arg_r(B0H); arg_Ir(B0L); bytes(2);              break;
175
 
                        case 0x44:              mnemonic("OR"); arg_R(B1); arg_R(B0); bytes(3);                 break;
176
 
                        case 0x45:              mnemonic("OR"); arg_R(B1); arg_IR(B0); bytes(3);                break;
177
 
                        case 0x46:              mnemonic("OR"); arg_R(B0); arg_IM(B1); bytes(3);                break;
178
 
                        case 0x47:              mnemonic("OR"); arg_IR(B0); arg_IM(B1); bytes(3);               break;
179
 
                        case 0x48:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
180
 
                        case 0x49:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
181
 
                        case 0x4a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
182
 
                        case 0x4b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
183
 
                        case 0x4c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
184
 
                        case 0x4d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
185
 
                        case 0x4e:              mnemonic("INC"); arg_r(OPH);                                                    break;
186
 
                        case 0x4f:              illegal; /* mnemonic("WDH"); */                                                 break;
187
 
 
188
 
                        case 0x50:              mnemonic("POP"); arg_R(B0); bytes(2);                                   break;
189
 
                        case 0x51:              mnemonic("POP"); arg_IR(B0); bytes(2);                                  break;
190
 
                        case 0x52:              mnemonic("AND"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
191
 
                        case 0x53:              mnemonic("AND"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
192
 
                        case 0x54:              mnemonic("AND"); arg_R(B1); arg_R(B0); bytes(3);                break;
193
 
                        case 0x55:              mnemonic("AND"); arg_R(B1); arg_IR(B0); bytes(3);               break;
194
 
                        case 0x56:              mnemonic("AND"); arg_R(B0); arg_IM(B1); bytes(3);               break;
195
 
                        case 0x57:              mnemonic("AND"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
196
 
                        case 0x58:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
197
 
                        case 0x59:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
198
 
                        case 0x5a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
199
 
                        case 0x5b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
200
 
                        case 0x5c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
201
 
                        case 0x5d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
202
 
                        case 0x5e:              mnemonic("INC"); arg_r(OPH);                                                    break;
203
 
                        case 0x5f:              illegal; /* mnemonic("WDT"); */                                                 break;
204
 
 
205
 
                        case 0x60:              mnemonic("COM"); arg_R(B0); bytes(2);                                   break;
206
 
                        case 0x61:              mnemonic("COM"); arg_IR(B0); bytes(2);                                  break;
207
 
                        case 0x62:              mnemonic("TCM"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
208
 
                        case 0x63:              mnemonic("TCM"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
209
 
                        case 0x64:              mnemonic("TCM"); arg_R(B1); arg_R(B0); bytes(3);                break;
210
 
                        case 0x65:              mnemonic("TCM"); arg_R(B1); arg_IR(B0); bytes(3);               break;
211
 
                        case 0x66:              mnemonic("TCM"); arg_R(B0); arg_IM(B1); bytes(3);               break;
212
 
                        case 0x67:              mnemonic("TCM"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
213
 
                        case 0x68:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
214
 
                        case 0x69:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
215
 
                        case 0x6a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
216
 
                        case 0x6b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
217
 
                        case 0x6c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
218
 
                        case 0x6d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
219
 
                        case 0x6e:              mnemonic("INC"); arg_r(OPH);                                                    break;
220
 
                        case 0x6f:              illegal; /* mnemonic("STOP"); */                                                break;
221
 
 
222
 
                        case 0x70:              mnemonic("PUSH"); arg_R(B0); bytes(2);                                  break;
223
 
                        case 0x71:              mnemonic("PUSH"); arg_IR(B0); bytes(2);                                 break;
224
 
                        case 0x72:              mnemonic("TM"); arg_r(B0H); arg_r(B0L); bytes(2);               break;
225
 
                        case 0x73:              mnemonic("TM"); arg_r(B0H); arg_Ir(B0L); bytes(2);              break;
226
 
                        case 0x74:              mnemonic("TM"); arg_R(B1); arg_R(B0); bytes(3);                 break;
227
 
                        case 0x75:              mnemonic("TM"); arg_R(B1); arg_IR(B0); bytes(3);                break;
228
 
                        case 0x76:              mnemonic("TM"); arg_R(B0); arg_IM(B1); bytes(3);                break;
229
 
                        case 0x77:              mnemonic("TM"); arg_IR(B0); arg_IM(B1); bytes(3);               break;
230
 
                        case 0x78:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
231
 
                        case 0x79:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
232
 
                        case 0x7a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
233
 
                        case 0x7b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
234
 
                        case 0x7c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
235
 
                        case 0x7d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
236
 
                        case 0x7e:              mnemonic("INC"); arg_r(OPH);                                                    break;
237
 
                        case 0x7f:              illegal; /* mnemonic("HALT"); */                                                break;
238
 
 
239
 
                        case 0x80:              mnemonic("DECW"); arg_RR(*oprom++);                                             break;
240
 
                        case 0x81:              mnemonic("DECW"); arg_IR(B0); bytes(2);                                 break;
241
 
                        case 0x82:              mnemonic("LDE"); arg_r(B0H); arg_Irr(B0L); bytes(2);    break;
242
 
                        case 0x83:              mnemonic("LDEI"); arg_Ir(B0H); arg_Irr(B0L); bytes(2);  break;
243
 
                        case 0x84:              illegal;                                                                                                break;
244
 
                        case 0x85:              illegal;                                                                                                break;
245
 
                        case 0x86:              illegal;                                                                                                break;
246
 
                        case 0x87:              illegal;                                                                                                break;
247
 
                        case 0x88:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
248
 
                        case 0x89:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
249
 
                        case 0x8a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
250
 
                        case 0x8b:              mnemonic("JR"); arg_RA; bytes(2);                                               break;
251
 
                        case 0x8c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
252
 
                        case 0x8d:              mnemonic("JP"); arg_DA; bytes(3);                                               break;
253
 
                        case 0x8e:              mnemonic("INC"); arg_r(OPH);                                                    break;
254
 
                        case 0x8f:              mnemonic("DI");                                                                                 break;
255
 
 
256
 
                        case 0x90:              mnemonic("RL"); arg_R(B0); bytes(2);                                    break;
257
 
                        case 0x91:              mnemonic("RL"); arg_IR(B0); bytes(2);                                   break;
258
 
                        case 0x92:              mnemonic("LDE"); arg_r(B0L); arg_Irr(B0H); bytes(2);    break;
259
 
                        case 0x93:              mnemonic("LDEI"); arg_Ir(B0L); arg_Irr(B0H); bytes(2);  break;
260
 
                        case 0x94:              illegal;                                                                                                break;
261
 
                        case 0x95:              illegal;                                                                                                break;
262
 
                        case 0x96:              illegal;                                                                                                break;
263
 
                        case 0x97:              illegal;                                                                                                break;
264
 
                        case 0x98:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
265
 
                        case 0x99:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
266
 
                        case 0x9a:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
267
 
                        case 0x9b:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
268
 
                        case 0x9c:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
269
 
                        case 0x9d:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
270
 
                        case 0x9e:              mnemonic("INC"); arg_r(OPH);                                                    break;
271
 
                        case 0x9f:              mnemonic("EI");                                                                                 break;
272
 
 
273
 
                        case 0xa0:              mnemonic("INCW"); arg_RR(B0); bytes(2);                                 break;
274
 
                        case 0xa1:              mnemonic("INCW"); arg_IR(B0); bytes(2);                                 break;
275
 
                        case 0xa2:              mnemonic("CP"); arg_r(B0H); arg_r(B0L); bytes(2);               break;
276
 
                        case 0xa3:              mnemonic("CP"); arg_r(B0H); arg_Ir(B0L); bytes(2);              break;
277
 
                        case 0xa4:              mnemonic("CP"); arg_R(B1); arg_R(B0); bytes(3);                 break;
278
 
                        case 0xa5:              mnemonic("CP"); arg_R(B1); arg_IR(B0); bytes(3);                break;
279
 
                        case 0xa6:              mnemonic("CP"); arg_R(B0); arg_IM(B1); bytes(3);                break;
280
 
                        case 0xa7:              mnemonic("CP"); arg_IR(B0); arg_IM(B1); bytes(3);               break;
281
 
                        case 0xa8:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
282
 
                        case 0xa9:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
283
 
                        case 0xaa:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
284
 
                        case 0xab:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
285
 
                        case 0xac:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
286
 
                        case 0xad:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
287
 
                        case 0xae:              mnemonic("INC"); arg_r(OPH);                                                    break;
288
 
                        case 0xaf:              mnemonic("RET"); step_out;                                                              break;
289
 
 
290
 
                        case 0xb0:              mnemonic("CLR"); arg_R(B0); bytes(2);                                   break;
291
 
                        case 0xb1:              mnemonic("CLR"); arg_IR(B0); bytes(2);                                  break;
292
 
                        case 0xb2:              mnemonic("XOR"); arg_r(B0H); arg_r(B0L); bytes(2);              break;
293
 
                        case 0xb3:              mnemonic("XOR"); arg_r(B0H); arg_Ir(B0L); bytes(2);             break;
294
 
                        case 0xb4:              mnemonic("XOR"); arg_R(B1); arg_R(B0); bytes(3);                break;
295
 
                        case 0xb5:              mnemonic("XOR"); arg_R(B1); arg_IR(B0); bytes(3);               break;
296
 
                        case 0xb6:              mnemonic("XOR"); arg_R(B0); arg_IM(B1); bytes(3);               break;
297
 
                        case 0xb7:              mnemonic("XOR"); arg_IR(B0); arg_IM(B1); bytes(3);              break;
298
 
                        case 0xb8:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
299
 
                        case 0xb9:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
300
 
                        case 0xba:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
301
 
                        case 0xbb:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
302
 
                        case 0xbc:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
303
 
                        case 0xbd:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
304
 
                        case 0xbe:              mnemonic("INC"); arg_r(OPH);                                                    break;
305
 
                        case 0xbf:              mnemonic("IRET"); step_out;                                                             break;
306
 
 
307
 
                        case 0xc0:              mnemonic("RRC"); arg_R(B0); bytes(2);                                   break;
308
 
                        case 0xc1:              mnemonic("RRC"); arg_IR(B0); bytes(2);                                  break;
309
 
                        case 0xc2:              mnemonic("LDC"); arg_r(B0H); arg_Irr(B0L); bytes(2);    break;
310
 
                        case 0xc3:              mnemonic("LDCI"); arg_Ir(B0H); arg_Irr(B0L); bytes(2);  break;
311
 
                        case 0xc4:              illegal;                                                                                                break;
312
 
                        case 0xc5:              illegal;                                                                                                break;
313
 
                        case 0xc6:              illegal;                                                                                                break;
314
 
                        case 0xc7:              mnemonic("LD"); arg_r(B0H); arg_X(B1, B0L); bytes(3);   break;
315
 
                        case 0xc8:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
316
 
                        case 0xc9:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
317
 
                        case 0xca:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
318
 
                        case 0xcb:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
319
 
                        case 0xcc:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
320
 
                        case 0xcd:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
321
 
                        case 0xce:              mnemonic("INC"); arg_r(OPH);                                                    break;
322
 
                        case 0xcf:              mnemonic("RCF");                                                                                break;
323
 
 
324
 
                        case 0xd0:              mnemonic("SRA"); arg_R(B0); bytes(2);                                   break;
325
 
                        case 0xd1:              mnemonic("SRA"); arg_IR(B0); bytes(2);                                  break;
326
 
                        case 0xd2:              mnemonic("LDC"); arg_Irr(B0L); arg_r(B0H); bytes(2);    break;
327
 
                        case 0xd3:              mnemonic("LDCI"); arg_Irr(B0L); arg_Ir(B0H); bytes(2);  break;
328
 
                        case 0xd4:              mnemonic("CALL"); arg_IRR(B0); bytes(2); step_over;             break;
329
 
                        case 0xd5:              illegal;                                                                                                break;
330
 
                        case 0xd6:              mnemonic("CALL"); arg_DA; bytes(3);     step_over;                      break;
331
 
                        case 0xd7:              mnemonic("LD"); arg_r(B0L); arg_X(B1, B0H); bytes(3);   break;
332
 
                        case 0xd8:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
333
 
                        case 0xd9:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
334
 
                        case 0xda:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
335
 
                        case 0xdb:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
336
 
                        case 0xdc:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
337
 
                        case 0xdd:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
338
 
                        case 0xde:              mnemonic("INC"); arg_r(OPH);                                                    break;
339
 
                        case 0xdf:              mnemonic("SCF");                                                                                break;
340
 
 
341
 
                        case 0xe0:              mnemonic("RR"); arg_R(B0); bytes(2);                                    break;
342
 
                        case 0xe1:              mnemonic("RR"); arg_IR(B0); bytes(2);                                   break;
343
 
                        case 0xe2:              illegal;                                                                                                break;
344
 
                        case 0xe3:              mnemonic("LD"); arg_r(B0H); arg_Ir(B0L); bytes(2);              break;
345
 
                        case 0xe4:              mnemonic("LD"); arg_R(B1); arg_R(B0); bytes(3);                 break;
346
 
                        case 0xe5:              mnemonic("LD"); arg_R(B1); arg_IR(B0); bytes(3);                break;
347
 
                        case 0xe6:              mnemonic("LD"); arg_R(B0); arg_IM(B1); bytes(3);                break;
348
 
                        case 0xe7:              mnemonic("LD"); arg_IR(B0); arg_IM(B1); bytes(3);               break;
349
 
                        case 0xe8:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
350
 
                        case 0xe9:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
351
 
                        case 0xea:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
352
 
                        case 0xeb:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
353
 
                        case 0xec:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
354
 
                        case 0xed:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
355
 
                        case 0xee:              mnemonic("INC"); arg_r(OPH);                                                    break;
356
 
                        case 0xef:              mnemonic("CCF");                                                                                break;
357
 
 
358
 
                        case 0xf0:              mnemonic("SWAP"); arg_R(B0); bytes(2);                                  break;
359
 
                        case 0xf1:              mnemonic("SWAP"); arg_IR(B0); bytes(2);                                 break;
360
 
                        case 0xf2:              illegal;                                                                                                break;
361
 
                        case 0xf3:              mnemonic("LD"); arg_Ir(B0H); arg_r(B0L); bytes(2);              break;
362
 
                        case 0xf4:              illegal;                                                                                                break;
363
 
                        case 0xf5:              mnemonic("LD"); arg_IR(B0); arg_R(B1); bytes(3);                break;
364
 
                        case 0xf6:              illegal;                                                                                                break;
365
 
                        case 0xf7:              illegal;                                                                                                break;
366
 
                        case 0xf8:              mnemonic("LD"); arg_r(OPH); arg_R(B0); bytes(2);                break;
367
 
                        case 0xf9:              mnemonic("LD"); arg_R(B0); arg_r(OPH); bytes(2);                break;
368
 
                        case 0xfa:              mnemonic("DJNZ"); arg_r(OPH); arg_RA; bytes(2);                 break;
369
 
                        case 0xfb:              mnemonic("JR"); arg_cc; arg_RA; bytes(2);                               break;
370
 
                        case 0xfc:              mnemonic("LD"); arg_r(OPH); arg_IM(B0); bytes(2);               break;
371
 
                        case 0xfd:              mnemonic("JP"); arg_cc; arg_DA; bytes(3);                               break;
372
 
                        case 0xfe:              mnemonic("INC"); arg_r(OPH);                                                    break;
373
 
                        case 0xff:              mnemonic("NOP");                                                                                break;
374
 
                }
375
 
        }
376
 
 
377
 
        return (oprom - startrom) | flags | DASMFLAG_SUPPORTED;
378
 
}