Previous 199869 Revisions Next

r33808 Thursday 11th December, 2014 at 00:44:52 UTC by David Haywood
arcompact -  reorganize a little (nw)
[src/emu/cpu]cpu.mak
[src/emu/cpu/arcompact]arcompactdasm.c arcompactdasm_dispatch.c* arcompactdasm_dispatch.h* arcompactdasm_ops.c* arcompactdasm_ops.h*
[src/mess/drivers]leapster.c

trunk/src/emu/cpu/arcompact/arcompactdasm.c
r242319r242320
77#include "emu.h"
88#include <stdarg.h>
99
10static char *output;
10#include "arcompactdasm_dispatch.h"
11#include "arcompactdasm_ops.h"
1112
12static void ATTR_PRINTF(1,2) print(const char *fmt, ...)
13{
14   va_list vl;
1513
16   va_start(vl, fmt);
17   vsprintf(output, fmt, vl);
18   va_end(vl);
19}
20
2114/*****************************************************************************/
2215
2316
2417
2518/*****************************************************************************/
2619
27#define DASM_OPS_16 char *output, offs_t pc, UINT16 op, const UINT8* oprom
28#define DASM_OPS_32 char *output, offs_t pc, UINT32 op, const UINT8* oprom
29#define DASM_PARAMS output, pc, op, oprom
3020
31#define LIMM_REG 62
32
33#define GET_LIMM_32 \
34   limm = oprom[6] | (oprom[7] << 8); \
35   limm |= (oprom[4] << 16) | (oprom[5] << 24); \
36
37int arcompact_handle04_00_dasm(DASM_OPS_32);
38int arcompact_handle04_01_dasm(DASM_OPS_32);
39int arcompact_handle04_02_dasm(DASM_OPS_32);
40int arcompact_handle04_03_dasm(DASM_OPS_32);
41int arcompact_handle04_04_dasm(DASM_OPS_32);
42int arcompact_handle04_05_dasm(DASM_OPS_32);
43int arcompact_handle04_06_dasm(DASM_OPS_32);
44int arcompact_handle04_07_dasm(DASM_OPS_32);
45int arcompact_handle04_08_dasm(DASM_OPS_32);
46int arcompact_handle04_09_dasm(DASM_OPS_32);
47int arcompact_handle04_0a_dasm(DASM_OPS_32);
48int arcompact_handle04_0b_dasm(DASM_OPS_32);
49int arcompact_handle04_0c_dasm(DASM_OPS_32);
50int arcompact_handle04_0d_dasm(DASM_OPS_32);
51int arcompact_handle04_0e_dasm(DASM_OPS_32);
52int arcompact_handle04_0f_dasm(DASM_OPS_32);
53int arcompact_handle04_10_dasm(DASM_OPS_32);
54int arcompact_handle04_11_dasm(DASM_OPS_32);
55int arcompact_handle04_12_dasm(DASM_OPS_32);
56int arcompact_handle04_13_dasm(DASM_OPS_32);
57int arcompact_handle04_14_dasm(DASM_OPS_32);
58int arcompact_handle04_15_dasm(DASM_OPS_32);
59int arcompact_handle04_16_dasm(DASM_OPS_32);
60int arcompact_handle04_17_dasm(DASM_OPS_32);
61int arcompact_handle04_18_dasm(DASM_OPS_32);
62int arcompact_handle04_19_dasm(DASM_OPS_32);
63int arcompact_handle04_1a_dasm(DASM_OPS_32);
64int arcompact_handle04_1b_dasm(DASM_OPS_32);
65int arcompact_handle04_1c_dasm(DASM_OPS_32);
66int arcompact_handle04_1d_dasm(DASM_OPS_32);
67int arcompact_handle04_1e_dasm(DASM_OPS_32);
68int arcompact_handle04_1f_dasm(DASM_OPS_32);
69int arcompact_handle04_20_dasm(DASM_OPS_32);
70int arcompact_handle04_21_dasm(DASM_OPS_32);
71int arcompact_handle04_22_dasm(DASM_OPS_32);
72int arcompact_handle04_23_dasm(DASM_OPS_32);
73int arcompact_handle04_24_dasm(DASM_OPS_32);
74int arcompact_handle04_25_dasm(DASM_OPS_32);
75int arcompact_handle04_26_dasm(DASM_OPS_32);
76int arcompact_handle04_27_dasm(DASM_OPS_32);
77int arcompact_handle04_28_dasm(DASM_OPS_32);
78int arcompact_handle04_29_dasm(DASM_OPS_32);
79int arcompact_handle04_2a_dasm(DASM_OPS_32);
80int arcompact_handle04_2b_dasm(DASM_OPS_32);
81int arcompact_handle04_2c_dasm(DASM_OPS_32);
82int arcompact_handle04_2d_dasm(DASM_OPS_32);
83int arcompact_handle04_2e_dasm(DASM_OPS_32);
84int arcompact_handle04_2f_dasm(DASM_OPS_32);
85int arcompact_handle04_30_dasm(DASM_OPS_32);
86int arcompact_handle04_31_dasm(DASM_OPS_32);
87int arcompact_handle04_32_dasm(DASM_OPS_32);
88int arcompact_handle04_33_dasm(DASM_OPS_32);
89int arcompact_handle04_34_dasm(DASM_OPS_32);
90int arcompact_handle04_35_dasm(DASM_OPS_32);
91int arcompact_handle04_36_dasm(DASM_OPS_32);
92int arcompact_handle04_37_dasm(DASM_OPS_32);
93int arcompact_handle04_38_dasm(DASM_OPS_32);
94int arcompact_handle04_39_dasm(DASM_OPS_32);
95int arcompact_handle04_3a_dasm(DASM_OPS_32);
96int arcompact_handle04_3b_dasm(DASM_OPS_32);
97int arcompact_handle04_3c_dasm(DASM_OPS_32);
98int arcompact_handle04_3d_dasm(DASM_OPS_32);
99int arcompact_handle04_3e_dasm(DASM_OPS_32);
100int arcompact_handle04_3f_dasm(DASM_OPS_32);
101
102int arcompact_handle04_2f_00_dasm(DASM_OPS_32);
103int arcompact_handle04_2f_01_dasm(DASM_OPS_32);
104int arcompact_handle04_2f_02_dasm(DASM_OPS_32);
105int arcompact_handle04_2f_03_dasm(DASM_OPS_32);
106int arcompact_handle04_2f_04_dasm(DASM_OPS_32);
107int arcompact_handle04_2f_05_dasm(DASM_OPS_32);
108int arcompact_handle04_2f_06_dasm(DASM_OPS_32);
109int arcompact_handle04_2f_07_dasm(DASM_OPS_32);
110int arcompact_handle04_2f_08_dasm(DASM_OPS_32);
111int arcompact_handle04_2f_09_dasm(DASM_OPS_32);
112int arcompact_handle04_2f_0a_dasm(DASM_OPS_32);
113int arcompact_handle04_2f_0b_dasm(DASM_OPS_32);
114int arcompact_handle04_2f_0c_dasm(DASM_OPS_32);
115int arcompact_handle04_2f_0d_dasm(DASM_OPS_32);
116int arcompact_handle04_2f_0e_dasm(DASM_OPS_32);
117int arcompact_handle04_2f_0f_dasm(DASM_OPS_32);
118int arcompact_handle04_2f_10_dasm(DASM_OPS_32);
119int arcompact_handle04_2f_11_dasm(DASM_OPS_32);
120int arcompact_handle04_2f_12_dasm(DASM_OPS_32);
121int arcompact_handle04_2f_13_dasm(DASM_OPS_32);
122int arcompact_handle04_2f_14_dasm(DASM_OPS_32);
123int arcompact_handle04_2f_15_dasm(DASM_OPS_32);
124int arcompact_handle04_2f_16_dasm(DASM_OPS_32);
125int arcompact_handle04_2f_17_dasm(DASM_OPS_32);
126int arcompact_handle04_2f_18_dasm(DASM_OPS_32);
127int arcompact_handle04_2f_19_dasm(DASM_OPS_32);
128int arcompact_handle04_2f_1a_dasm(DASM_OPS_32);
129int arcompact_handle04_2f_1b_dasm(DASM_OPS_32);
130int arcompact_handle04_2f_1c_dasm(DASM_OPS_32);
131int arcompact_handle04_2f_1d_dasm(DASM_OPS_32);
132int arcompact_handle04_2f_1e_dasm(DASM_OPS_32);
133int arcompact_handle04_2f_1f_dasm(DASM_OPS_32);
134int arcompact_handle04_2f_20_dasm(DASM_OPS_32);
135int arcompact_handle04_2f_21_dasm(DASM_OPS_32);
136int arcompact_handle04_2f_22_dasm(DASM_OPS_32);
137int arcompact_handle04_2f_23_dasm(DASM_OPS_32);
138int arcompact_handle04_2f_24_dasm(DASM_OPS_32);
139int arcompact_handle04_2f_25_dasm(DASM_OPS_32);
140int arcompact_handle04_2f_26_dasm(DASM_OPS_32);
141int arcompact_handle04_2f_27_dasm(DASM_OPS_32);
142int arcompact_handle04_2f_28_dasm(DASM_OPS_32);
143int arcompact_handle04_2f_29_dasm(DASM_OPS_32);
144int arcompact_handle04_2f_2a_dasm(DASM_OPS_32);
145int arcompact_handle04_2f_2b_dasm(DASM_OPS_32);
146int arcompact_handle04_2f_2c_dasm(DASM_OPS_32);
147int arcompact_handle04_2f_2d_dasm(DASM_OPS_32);
148int arcompact_handle04_2f_2e_dasm(DASM_OPS_32);
149int arcompact_handle04_2f_2f_dasm(DASM_OPS_32);
150int arcompact_handle04_2f_30_dasm(DASM_OPS_32);
151int arcompact_handle04_2f_31_dasm(DASM_OPS_32);
152int arcompact_handle04_2f_32_dasm(DASM_OPS_32);
153int arcompact_handle04_2f_33_dasm(DASM_OPS_32);
154int arcompact_handle04_2f_34_dasm(DASM_OPS_32);
155int arcompact_handle04_2f_35_dasm(DASM_OPS_32);
156int arcompact_handle04_2f_36_dasm(DASM_OPS_32);
157int arcompact_handle04_2f_37_dasm(DASM_OPS_32);
158int arcompact_handle04_2f_38_dasm(DASM_OPS_32);
159int arcompact_handle04_2f_39_dasm(DASM_OPS_32);
160int arcompact_handle04_2f_3a_dasm(DASM_OPS_32);
161int arcompact_handle04_2f_3b_dasm(DASM_OPS_32);
162int arcompact_handle04_2f_3c_dasm(DASM_OPS_32);
163int arcompact_handle04_2f_3d_dasm(DASM_OPS_32);
164int arcompact_handle04_2f_3e_dasm(DASM_OPS_32);
165int arcompact_handle04_2f_3f_dasm(DASM_OPS_32);
166
167int arcompact_handle04_2f_3f_00_dasm(DASM_OPS_32);
168int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32);
169int arcompact_handle04_2f_3f_02_dasm(DASM_OPS_32);
170int arcompact_handle04_2f_3f_03_dasm(DASM_OPS_32);
171int arcompact_handle04_2f_3f_04_dasm(DASM_OPS_32);
172int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32);
173int arcompact_handle04_2f_3f_06_dasm(DASM_OPS_32);
174int arcompact_handle04_2f_3f_07_dasm(DASM_OPS_32);
175int arcompact_handle04_2f_3f_08_dasm(DASM_OPS_32);
176int arcompact_handle04_2f_3f_09_dasm(DASM_OPS_32);
177int arcompact_handle04_2f_3f_0a_dasm(DASM_OPS_32);
178int arcompact_handle04_2f_3f_0b_dasm(DASM_OPS_32);
179int arcompact_handle04_2f_3f_0c_dasm(DASM_OPS_32);
180int arcompact_handle04_2f_3f_0d_dasm(DASM_OPS_32);
181int arcompact_handle04_2f_3f_0e_dasm(DASM_OPS_32);
182int arcompact_handle04_2f_3f_0f_dasm(DASM_OPS_32);
183int arcompact_handle04_2f_3f_10_dasm(DASM_OPS_32);
184int arcompact_handle04_2f_3f_11_dasm(DASM_OPS_32);
185int arcompact_handle04_2f_3f_12_dasm(DASM_OPS_32);
186int arcompact_handle04_2f_3f_13_dasm(DASM_OPS_32);
187int arcompact_handle04_2f_3f_14_dasm(DASM_OPS_32);
188int arcompact_handle04_2f_3f_15_dasm(DASM_OPS_32);
189int arcompact_handle04_2f_3f_16_dasm(DASM_OPS_32);
190int arcompact_handle04_2f_3f_17_dasm(DASM_OPS_32);
191int arcompact_handle04_2f_3f_18_dasm(DASM_OPS_32);
192int arcompact_handle04_2f_3f_19_dasm(DASM_OPS_32);
193int arcompact_handle04_2f_3f_1a_dasm(DASM_OPS_32);
194int arcompact_handle04_2f_3f_1b_dasm(DASM_OPS_32);
195int arcompact_handle04_2f_3f_1c_dasm(DASM_OPS_32);
196int arcompact_handle04_2f_3f_1d_dasm(DASM_OPS_32);
197int arcompact_handle04_2f_3f_1e_dasm(DASM_OPS_32);
198int arcompact_handle04_2f_3f_1f_dasm(DASM_OPS_32);
199int arcompact_handle04_2f_3f_20_dasm(DASM_OPS_32);
200int arcompact_handle04_2f_3f_21_dasm(DASM_OPS_32);
201int arcompact_handle04_2f_3f_22_dasm(DASM_OPS_32);
202int arcompact_handle04_2f_3f_23_dasm(DASM_OPS_32);
203int arcompact_handle04_2f_3f_24_dasm(DASM_OPS_32);
204int arcompact_handle04_2f_3f_25_dasm(DASM_OPS_32);
205int arcompact_handle04_2f_3f_26_dasm(DASM_OPS_32);
206int arcompact_handle04_2f_3f_27_dasm(DASM_OPS_32);
207int arcompact_handle04_2f_3f_28_dasm(DASM_OPS_32);
208int arcompact_handle04_2f_3f_29_dasm(DASM_OPS_32);
209int arcompact_handle04_2f_3f_2a_dasm(DASM_OPS_32);
210int arcompact_handle04_2f_3f_2b_dasm(DASM_OPS_32);
211int arcompact_handle04_2f_3f_2c_dasm(DASM_OPS_32);
212int arcompact_handle04_2f_3f_2d_dasm(DASM_OPS_32);
213int arcompact_handle04_2f_3f_2e_dasm(DASM_OPS_32);
214int arcompact_handle04_2f_3f_2f_dasm(DASM_OPS_32);
215int arcompact_handle04_2f_3f_30_dasm(DASM_OPS_32);
216int arcompact_handle04_2f_3f_31_dasm(DASM_OPS_32);
217int arcompact_handle04_2f_3f_32_dasm(DASM_OPS_32);
218int arcompact_handle04_2f_3f_33_dasm(DASM_OPS_32);
219int arcompact_handle04_2f_3f_34_dasm(DASM_OPS_32);
220int arcompact_handle04_2f_3f_35_dasm(DASM_OPS_32);
221int arcompact_handle04_2f_3f_36_dasm(DASM_OPS_32);
222int arcompact_handle04_2f_3f_37_dasm(DASM_OPS_32);
223int arcompact_handle04_2f_3f_38_dasm(DASM_OPS_32);
224int arcompact_handle04_2f_3f_39_dasm(DASM_OPS_32);
225int arcompact_handle04_2f_3f_3a_dasm(DASM_OPS_32);
226int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32);
227int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32);
228int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32);
229int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32);
230int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32);
231
232int arcompact_handle05_00_dasm(DASM_OPS_32);
233int arcompact_handle05_01_dasm(DASM_OPS_32);
234int arcompact_handle05_02_dasm(DASM_OPS_32);
235int arcompact_handle05_03_dasm(DASM_OPS_32);
236int arcompact_handle05_04_dasm(DASM_OPS_32);
237int arcompact_handle05_05_dasm(DASM_OPS_32);
238int arcompact_handle05_06_dasm(DASM_OPS_32);
239int arcompact_handle05_07_dasm(DASM_OPS_32);
240int arcompact_handle05_08_dasm(DASM_OPS_32);
241int arcompact_handle05_09_dasm(DASM_OPS_32);
242int arcompact_handle05_0a_dasm(DASM_OPS_32);
243int arcompact_handle05_0b_dasm(DASM_OPS_32);
244int arcompact_handle05_0c_dasm(DASM_OPS_32);
245int arcompact_handle05_0d_dasm(DASM_OPS_32);
246int arcompact_handle05_0e_dasm(DASM_OPS_32);
247int arcompact_handle05_0f_dasm(DASM_OPS_32);
248int arcompact_handle05_10_dasm(DASM_OPS_32);
249int arcompact_handle05_11_dasm(DASM_OPS_32);
250int arcompact_handle05_12_dasm(DASM_OPS_32);
251int arcompact_handle05_13_dasm(DASM_OPS_32);
252int arcompact_handle05_14_dasm(DASM_OPS_32);
253int arcompact_handle05_15_dasm(DASM_OPS_32);
254int arcompact_handle05_16_dasm(DASM_OPS_32);
255int arcompact_handle05_17_dasm(DASM_OPS_32);
256int arcompact_handle05_18_dasm(DASM_OPS_32);
257int arcompact_handle05_19_dasm(DASM_OPS_32);
258int arcompact_handle05_1a_dasm(DASM_OPS_32);
259int arcompact_handle05_1b_dasm(DASM_OPS_32);
260int arcompact_handle05_1c_dasm(DASM_OPS_32);
261int arcompact_handle05_1d_dasm(DASM_OPS_32);
262int arcompact_handle05_1e_dasm(DASM_OPS_32);
263int arcompact_handle05_1f_dasm(DASM_OPS_32);
264int arcompact_handle05_20_dasm(DASM_OPS_32);
265int arcompact_handle05_21_dasm(DASM_OPS_32);
266int arcompact_handle05_22_dasm(DASM_OPS_32);
267int arcompact_handle05_23_dasm(DASM_OPS_32);
268int arcompact_handle05_24_dasm(DASM_OPS_32);
269int arcompact_handle05_25_dasm(DASM_OPS_32);
270int arcompact_handle05_26_dasm(DASM_OPS_32);
271int arcompact_handle05_27_dasm(DASM_OPS_32);
272int arcompact_handle05_28_dasm(DASM_OPS_32);
273int arcompact_handle05_29_dasm(DASM_OPS_32);
274int arcompact_handle05_2a_dasm(DASM_OPS_32);
275int arcompact_handle05_2b_dasm(DASM_OPS_32);
276int arcompact_handle05_2c_dasm(DASM_OPS_32);
277int arcompact_handle05_2d_dasm(DASM_OPS_32);
278int arcompact_handle05_2e_dasm(DASM_OPS_32);
279int arcompact_handle05_2f_dasm(DASM_OPS_32);
280int arcompact_handle05_30_dasm(DASM_OPS_32);
281int arcompact_handle05_31_dasm(DASM_OPS_32);
282int arcompact_handle05_32_dasm(DASM_OPS_32);
283int arcompact_handle05_33_dasm(DASM_OPS_32);
284int arcompact_handle05_34_dasm(DASM_OPS_32);
285int arcompact_handle05_35_dasm(DASM_OPS_32);
286int arcompact_handle05_36_dasm(DASM_OPS_32);
287int arcompact_handle05_37_dasm(DASM_OPS_32);
288int arcompact_handle05_38_dasm(DASM_OPS_32);
289int arcompact_handle05_39_dasm(DASM_OPS_32);
290int arcompact_handle05_3a_dasm(DASM_OPS_32);
291int arcompact_handle05_3b_dasm(DASM_OPS_32);
292int arcompact_handle05_3c_dasm(DASM_OPS_32);
293int arcompact_handle05_3d_dasm(DASM_OPS_32);
294int arcompact_handle05_3e_dasm(DASM_OPS_32);
295int arcompact_handle05_3f_dasm(DASM_OPS_32);
296
297
298int arcompact_handle0c_00_dasm(DASM_OPS_16);
299int arcompact_handle0c_01_dasm(DASM_OPS_16);
300int arcompact_handle0c_02_dasm(DASM_OPS_16);
301int arcompact_handle0c_03_dasm(DASM_OPS_16);
302
303int arcompact_handle0d_00_dasm(DASM_OPS_16);
304int arcompact_handle0d_01_dasm(DASM_OPS_16);
305int arcompact_handle0d_02_dasm(DASM_OPS_16);
306int arcompact_handle0d_03_dasm(DASM_OPS_16);
307
308int arcompact_handle0e_00_dasm(DASM_OPS_16);
309int arcompact_handle0e_01_dasm(DASM_OPS_16);
310int arcompact_handle0e_02_dasm(DASM_OPS_16);
311int arcompact_handle0e_03_dasm(DASM_OPS_16);
312
313int arcompact_handle17_00_dasm(DASM_OPS_16);
314int arcompact_handle17_01_dasm(DASM_OPS_16);
315int arcompact_handle17_02_dasm(DASM_OPS_16);
316int arcompact_handle17_03_dasm(DASM_OPS_16);
317int arcompact_handle17_04_dasm(DASM_OPS_16);
318int arcompact_handle17_05_dasm(DASM_OPS_16);
319int arcompact_handle17_06_dasm(DASM_OPS_16);
320int arcompact_handle17_07_dasm(DASM_OPS_16);
321
322int arcompact_handle18_00_dasm(DASM_OPS_16);
323int arcompact_handle18_01_dasm(DASM_OPS_16);
324int arcompact_handle18_02_dasm(DASM_OPS_16);
325int arcompact_handle18_03_dasm(DASM_OPS_16);
326int arcompact_handle18_04_dasm(DASM_OPS_16);
327
328int arcompact_handle18_05_dasm(DASM_OPS_16);
329int arcompact_handle18_05_00_dasm(DASM_OPS_16);
330int arcompact_handle18_05_01_dasm(DASM_OPS_16);
331int arcompact_handle18_05_02_dasm(DASM_OPS_16);
332int arcompact_handle18_05_03_dasm(DASM_OPS_16);
333int arcompact_handle18_05_04_dasm(DASM_OPS_16);
334int arcompact_handle18_05_05_dasm(DASM_OPS_16);
335int arcompact_handle18_05_06_dasm(DASM_OPS_16);
336int arcompact_handle18_05_07_dasm(DASM_OPS_16);
337
338int arcompact_handle18_06_dasm(DASM_OPS_16);
339int arcompact_handle18_06_00_dasm(DASM_OPS_16);
340int arcompact_handle18_06_01_dasm(DASM_OPS_16);
341int arcompact_handle18_06_02_dasm(DASM_OPS_16);
342int arcompact_handle18_06_03_dasm(DASM_OPS_16);
343int arcompact_handle18_06_04_dasm(DASM_OPS_16);
344int arcompact_handle18_06_05_dasm(DASM_OPS_16);
345int arcompact_handle18_06_06_dasm(DASM_OPS_16);
346int arcompact_handle18_06_07_dasm(DASM_OPS_16);
347int arcompact_handle18_06_08_dasm(DASM_OPS_16);
348int arcompact_handle18_06_09_dasm(DASM_OPS_16);
349int arcompact_handle18_06_0a_dasm(DASM_OPS_16);
350int arcompact_handle18_06_0b_dasm(DASM_OPS_16);
351int arcompact_handle18_06_0c_dasm(DASM_OPS_16);
352int arcompact_handle18_06_0d_dasm(DASM_OPS_16);
353int arcompact_handle18_06_0e_dasm(DASM_OPS_16);
354int arcompact_handle18_06_0f_dasm(DASM_OPS_16);
355int arcompact_handle18_06_10_dasm(DASM_OPS_16);
356int arcompact_handle18_06_11_dasm(DASM_OPS_16);
357int arcompact_handle18_06_12_dasm(DASM_OPS_16);
358int arcompact_handle18_06_13_dasm(DASM_OPS_16);
359int arcompact_handle18_06_14_dasm(DASM_OPS_16);
360int arcompact_handle18_06_15_dasm(DASM_OPS_16);
361int arcompact_handle18_06_16_dasm(DASM_OPS_16);
362int arcompact_handle18_06_17_dasm(DASM_OPS_16);
363int arcompact_handle18_06_18_dasm(DASM_OPS_16);
364int arcompact_handle18_06_19_dasm(DASM_OPS_16);
365int arcompact_handle18_06_1a_dasm(DASM_OPS_16);
366int arcompact_handle18_06_1b_dasm(DASM_OPS_16);
367int arcompact_handle18_06_1c_dasm(DASM_OPS_16);
368int arcompact_handle18_06_1d_dasm(DASM_OPS_16);
369int arcompact_handle18_06_1e_dasm(DASM_OPS_16);
370int arcompact_handle18_06_1f_dasm(DASM_OPS_16);
371
372int arcompact_handle18_07_dasm(DASM_OPS_16);
373int arcompact_handle18_07_00_dasm(DASM_OPS_16);
374int arcompact_handle18_07_01_dasm(DASM_OPS_16);
375int arcompact_handle18_07_02_dasm(DASM_OPS_16);
376int arcompact_handle18_07_03_dasm(DASM_OPS_16);
377int arcompact_handle18_07_04_dasm(DASM_OPS_16);
378int arcompact_handle18_07_05_dasm(DASM_OPS_16);
379int arcompact_handle18_07_06_dasm(DASM_OPS_16);
380int arcompact_handle18_07_07_dasm(DASM_OPS_16);
381int arcompact_handle18_07_08_dasm(DASM_OPS_16);
382int arcompact_handle18_07_09_dasm(DASM_OPS_16);
383int arcompact_handle18_07_0a_dasm(DASM_OPS_16);
384int arcompact_handle18_07_0b_dasm(DASM_OPS_16);
385int arcompact_handle18_07_0c_dasm(DASM_OPS_16);
386int arcompact_handle18_07_0d_dasm(DASM_OPS_16);
387int arcompact_handle18_07_0e_dasm(DASM_OPS_16);
388int arcompact_handle18_07_0f_dasm(DASM_OPS_16);
389int arcompact_handle18_07_10_dasm(DASM_OPS_16);
390int arcompact_handle18_07_11_dasm(DASM_OPS_16);
391int arcompact_handle18_07_12_dasm(DASM_OPS_16);
392int arcompact_handle18_07_13_dasm(DASM_OPS_16);
393int arcompact_handle18_07_14_dasm(DASM_OPS_16);
394int arcompact_handle18_07_15_dasm(DASM_OPS_16);
395int arcompact_handle18_07_16_dasm(DASM_OPS_16);
396int arcompact_handle18_07_17_dasm(DASM_OPS_16);
397int arcompact_handle18_07_18_dasm(DASM_OPS_16);
398int arcompact_handle18_07_19_dasm(DASM_OPS_16);
399int arcompact_handle18_07_1a_dasm(DASM_OPS_16);
400int arcompact_handle18_07_1b_dasm(DASM_OPS_16);
401int arcompact_handle18_07_1c_dasm(DASM_OPS_16);
402int arcompact_handle18_07_1d_dasm(DASM_OPS_16);
403int arcompact_handle18_07_1e_dasm(DASM_OPS_16);
404int arcompact_handle18_07_1f_dasm(DASM_OPS_16);
405
406int arcompact_handle19_00_dasm(DASM_OPS_16);
407int arcompact_handle19_01_dasm(DASM_OPS_16);
408int arcompact_handle19_02_dasm(DASM_OPS_16);
409int arcompact_handle19_03_dasm(DASM_OPS_16);
410
411int arcompact_handle1c_00_dasm(DASM_OPS_16);
412int arcompact_handle1c_01_dasm(DASM_OPS_16);
413
414int arcompact_handle1d_00_dasm(DASM_OPS_16);
415int arcompact_handle1d_01_dasm(DASM_OPS_16);
416
417int arcompact_handle1e_00_dasm(DASM_OPS_16);
418int arcompact_handle1e_01_dasm(DASM_OPS_16);
419int arcompact_handle1e_02_dasm(DASM_OPS_16);
420int arcompact_handle1e_03_dasm(DASM_OPS_16);
421
422int arcompact_handle1e_03_00_dasm(DASM_OPS_16);
423int arcompact_handle1e_03_01_dasm(DASM_OPS_16);
424int arcompact_handle1e_03_02_dasm(DASM_OPS_16);
425int arcompact_handle1e_03_03_dasm(DASM_OPS_16);
426int arcompact_handle1e_03_04_dasm(DASM_OPS_16);
427int arcompact_handle1e_03_05_dasm(DASM_OPS_16);
428int arcompact_handle1e_03_06_dasm(DASM_OPS_16);
429int arcompact_handle1e_03_07_dasm(DASM_OPS_16);
430
431
432
433// condition codes (basic ones are the same as arc
434static const char *conditions[0x20] =
435{
436   /* 00 */ "AL", // (aka RA         - Always)
437   /* 01 */ "EQ", // (aka Z          - Zero
438   /* 02 */ "NE", // (aka NZ         - Non-Zero)
439   /* 03 */ "PL", // (aka P          - Positive)
440   /* 04 */ "MI", // (aka N          - Negative)
441   /* 05 */ "CS", // (aka C,  LO     - Carry set / Lower than) (unsigned)
442   /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned)
443   /* 07 */ "VS", // (aka V          - Overflow set)
444   /* 08 */ "VC", // (aka NV         - Overflow clear)
445   /* 09 */ "GT", // (               - Greater than) (signed)
446   /* 0a */ "GE", // (               - Greater than or Equal) (signed)
447   /* 0b */ "LT", // (               - Less than) (signed)
448   /* 0c */ "LE", // (               - Less than or Equal) (signed)
449   /* 0d */ "HI", // (               - Higher than) (unsigned)
450   /* 0e */ "LS", // (               - Lower or Same) (unsigned)
451   /* 0f */ "PNZ",// (               - Positive non-0 value)
452   /* 10 */ "0x10 Reserved", // possible CPU implementation specifics
453   /* 11 */ "0x11 Reserved",
454   /* 12 */ "0x12 Reserved",
455   /* 13 */ "0x13 Reserved",
456   /* 14 */ "0x14 Reserved",
457   /* 15 */ "0x15 Reserved",
458   /* 16 */ "0x16 Reserved",
459   /* 17 */ "0x17 Reserved",
460   /* 18 */ "0x18 Reserved",
461   /* 19 */ "0x19 Reserved",
462   /* 1a */ "0x1a Reserved",
463   /* 1b */ "0x1b Reserved",
464   /* 1c */ "0x1c Reserved",
465   /* 1d */ "0x1d Reserved",
466   /* 1e */ "0x1e Reserved",
467   /* 1f */ "0x1f Reserved"
468};
469
470static const char *table01_01_0x[0x10] =
471{
472   /* 00 */ "BREQ",
473   /* 01 */ "BRNE",
474   /* 02 */ "BRLT",
475   /* 03 */ "BRGE",
476   /* 04 */ "BRLO",
477   /* 05 */ "BRHS",
478   /* 06 */ "<reserved>",
479   /* 07 */ "<reserved>",
480   /* 08 */ "<reserved>",
481   /* 09 */ "<reserved>",
482   /* 0a */ "<reserved>",
483   /* 0b */ "<reserved>",
484   /* 0c */ "<reserved>",
485   /* 0d */ "<reserved>",
486   /* 0e */ "<BBIT0>",
487   /* 0f */ "<BBIT1>"
488};
489
490
491
492
493
494static const char *table0f[0x20] =
495{
496   /* 00 */ "SOPs", // Sub Operation (another table..) ( table0f_00 )
497   /* 01 */ "0x01 <illegal>",
498   /* 02 */ "SUB_S",
499   /* 03 */ "0x03 <illegal>",
500   /* 04 */ "AND_S",
501   /* 05 */ "OR_S",
502   /* 06 */ "BIC_S",
503   /* 07 */ "XOR_S",
504   /* 08 */ "0x08 <illegal>",
505   /* 09 */ "0x09 <illegal>",
506   /* 0a */ "0x0a <illegal>",
507   /* 0b */ "TST_S",
508   /* 0c */ "MUL64_S",
509   /* 0d */ "SEXB_S",
510   /* 0e */ "SEXW_S",
511   /* 0f */ "EXTB_S",
512   /* 10 */ "EXTW_S",
513   /* 11 */ "ABS_S",
514   /* 12 */ "NOT_S",
515   /* 13 */ "NEG_S",
516   /* 14 */ "ADD1_S",
517   /* 15 */ "ADD2_S>",
518   /* 16 */ "ADD3_S",
519   /* 17 */ "0x17 <illegal>",
520   /* 18 */ "ASL_S (multiple)",
521   /* 19 */ "LSR_S (multiple)",
522/* 1a */ "ASR_S (multiple)",
523/* 1b */ "ASL_S (single)",
524/* 1c */ "LSR_S (single)",
525/* 1d */ "ASR_S (single)",
526/* 1e */ "TRAP (not a5?)",
527/* 1f */ "BRK_S" // 0x7fff only?
528};
529
530static const char *table0f_00[0x8] =
531{
532   /* 00 */ "J_S",
533   /* 01 */ "J_S.D",
534   /* 02 */ "JL_S",
535   /* 03 */ "JL_S.D",
536   /* 04 */ "0x04 <illegal>",
537   /* 05 */ "0x05 <illegal>",
538   /* 06 */ "SUB_S.NE",
539   /* 07 */ "ZOPs", // Sub Operations (yet another table..) ( table0f_00_07 )
540};
541
542static const char *table0f_00_07[0x8] =
543{
544   /* 00 */ "NOP_S",
545   /* 01 */ "UNIMP_S", // unimplemented (not a5?)
546   /* 02 */ "0x02 <illegal>",
547   /* 03 */ "0x03 <illegal>",
548   /* 04 */ "JEQ_S [BLINK]",
549   /* 05 */ "JNE_S [BLINK]",
550   /* 06 */ "J_S [BLINK]",
551   /* 07 */ "J_S.D [BLINK]",
552};
553
55421#define ARCOMPACT_OPERATION ((op & 0xf800) >> 11)
55522
23extern char *output;;
55624
557int arcompact_handle00_dasm(DASM_OPS_32)
558{
559   if (op & 0x00010000)
560   { // Branch Unconditionally Far
561      // 00000 ssssssssss 1  SSSSSSSSSS N R TTTT
562      INT32 address = (op & 0x07fe0000) >> 17;
563      address |= ((op & 0x0000ffc0) >> 6) << 10;
564      address |= ((op & 0x0000000f) >> 0) << 20;
565      if (address & 0x800000) address = -(address & 0x7fffff);
566
567      print("B %08x (%08x)", pc + (address * 2) + 2, op & ~0xffffffcf);
568   }
569   else
570   { // Branch Conditionally
571      // 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ
572      INT32 address = (op & 0x07fe0000) >> 17;
573      address |= ((op & 0x0000ffc0) >> 6) << 10;
574      if (address & 0x800000) address = -(address & 0x7fffff);
575
576      UINT8 condition = op & 0x0000001f;
577
578      print("B(%s) %08x (%08x)", conditions[condition], pc + (address * 2) + 2, op & ~0xffffffdf);
579   }
580   return 4;
581}
582
583int arcompact_handle01_dasm(DASM_OPS_32)
584{
585   int size = 4;
586
587   if (op & 0x00010000)
588   {
589      if (op & 0x00000010)
590      { // Branch on Compare / Bit Test - Register-Immediate
591         // 00001 bbb sssssss 1 S BBB UUUUUU N 1 iiii
592         UINT8 subinstr = op & 0x0000000f;
593         INT32 address = (op & 0x00fe0000) >> 17;
594         address |= ((op & 0x00008000) >> 15) << 7;
595         if (address & 0x80) address = -(address & 0x7f);
596
597
598         print("%s (reg-imm) %08x (%08x)", table01_01_0x[subinstr], pc + (address * 2) + 4, op & ~0xf8fe800f);
599
600
601      }
602      else
603      {
604         // Branch on Compare / Bit Test - Register-Register
605         // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii
606         UINT8 subinstr = op & 0x0000000f;
607         INT32 address = (op & 0x00fe0000) >> 17;
608         address |= ((op & 0x00008000) >> 15) << 7;
609         if (address & 0x80) address = -(address & 0x7f);
610
611         int c = (op & 0x00000fc0)>> 6;
612         int b = (op & 0x07000000) >> 24;
613         b |=   ((op & 0x00007000) >> 12) << 3;
614
615         op &= ~0x07007fe0;
616
617         if ((b != LIMM_REG) && (c != LIMM_REG))
618         {
619            print("%s (reg-reg) (r%d) (r%d) %08x (%08x)", table01_01_0x[subinstr], b, c, pc + (address * 2) + 4, op & ~0xf8fe800f);
620         }
621         else
622         {
623            UINT32 limm;
624            GET_LIMM_32;
625            size = 8;
626
627            if ((b == LIMM_REG) && (c != LIMM_REG))
628            {
629               print("%s (reg-reg) (%08x) (r%d) %08x (%08x)", table01_01_0x[subinstr], limm, c, pc + (address * 2) + 4, op & ~0xf8fe800f);
630            }
631            else if ((c == LIMM_REG) && (b != LIMM_REG))
632            {
633               print("%s (reg-reg) (r%d) (%08x) %08x (%08x)", table01_01_0x[subinstr], b, limm, pc + (address * 2) + 4, op & ~0xf8fe800f);
634            }
635            else
636            {
637               // b and c are LIMM? invalid??
638               print("%s (reg-reg) (%08x) (%08x) (illegal?) %08x (%08x)", table01_01_0x[subinstr], limm, limm, pc + (address * 2) + 4, op & ~0xf8fe800f);
639
640            }
641         }
642
643      }
644
645   }
646   else
647   {
648      if (op & 0x00020000)
649      { // Branch and Link Unconditionally Far
650         // 00001 sssssssss 10  SSSSSSSSSS N R TTTT
651         INT32 address =   (op & 0x07fc0000) >> 17;
652         address |=        ((op & 0x0000ffc0) >> 6) << 10;
653         address |=        ((op & 0x0000000f) >> 0) << 20;
654         if (address & 0x800000) address = -(address&0x7fffff);   
655
656         print("BL %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
657      }
658      else
659      { // Branch and Link Conditionally
660         // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ
661         INT32 address =   (op & 0x07fc0000) >> 17;
662         address |=        ((op & 0x0000ffc0) >> 6) << 10;
663         if (address & 0x800000) address = -(address&0x7fffff);   
664
665         UINT8 condition = op & 0x0000001f;
666
667         print("BL(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
668
669      }
670
671   }
672   return size;
673}
674
675int arcompact_handle02_dasm(DASM_OPS_32)
676{
677   // bitpos
678   // 11111 111 11111111 0 000 0 00 00 0 000000
679   // fedcb a98 76543210 f edc b a9 87 6 543210
680   // fields
681   // 00010 bbb ssssssss S BBB D aa ZZ X AAAAAA
682#if 0   
683   int A = (op & 0x0000003f >> 0);  op &= ~0x0000003f;
684   int X = (op & 0x00000040 >> 6);  op &= ~0x00000040;
685   int Z = (op & 0x00000180 >> 7);  op &= ~0x00000180;
686   int a = (op & 0x00000600 >> 9);  op &= ~0x00000600;
687   int D = (op & 0x00000800 >> 11); op &= ~0x00000800;
688   int B = (op & 0x00007000 >> 12); op &= ~0x00007000;
689   int S = (op & 0x00008000 >> 15); op &= ~0x00008000;
690   int s = (op & 0x00ff0000 >> 16); op &= ~0x00ff0000;
691   int b = (op & 0x07000000 >> 24); op &= ~0x07000000;
692#endif
693
694   print("LD r+o (%08x)", op );
695   return 4;
696}
697
698int arcompact_handle03_dasm(DASM_OPS_32)
699{
700   // bitpos
701   // 11111 111 11111111 0 000 000000 0 00 00 0
702   // fedcb a98 76543210 f edc ba9876 5 43 21 0
703   // fields
704   // 00011 bbb ssssssss S BBB CCCCCC D aa ZZ R
705
706   print("ST r+o (%08x)", op );
707   return 4;
708}
709
710int arcompact_handle04_dasm(DASM_OPS_32)
711{
712   int size = 4;
713   // General Operations
714
715   // bitpos
716   // 11111 111 11 111111 0 000 000000 0 00000
717   // fedcb a98 76 543210 f edc ba9876 5 43210
718   //
719   // 00100 bbb 00 iiiiii F BBB CCCCCC A AAAAA   General Operations *UN*Conditional Register to Register
720   // 00100 bbb 01 iiiiii F BBB UUUUUU A AAAAA   General Operations *UN*Conditional Register (Unsigned 6-bit IMM)
721   // 00100 bbb 10 iiiiii F BBB ssssss S SSSSS   General Operations *UN*Conditional Register (Signed 12-bit IMM)
722   
723   // 00100 bbb 11 iiiiii F BBB CCCCCC 0 QQQQQ   General Operations Conditional Register
724   // 00100 bbb 11 iiiiii F BBB UUUUUU 1 QQQQQ   General Operations Conditional Register (Unsigned 6-bit IMM)
725   UINT8 subinstr = (op & 0x003f0000) >> 16;
726   op &= ~0x003f0000;
727
728   switch (subinstr)
729   {
730      case 0x00: size = arcompact_handle04_00_dasm(DASM_PARAMS); break; // ADD
731      case 0x01: size = arcompact_handle04_01_dasm(DASM_PARAMS); break; // ADC
732      case 0x02: size = arcompact_handle04_02_dasm(DASM_PARAMS); break; // SUB
733      case 0x03: size = arcompact_handle04_03_dasm(DASM_PARAMS); break; // SBC
734      case 0x04: size = arcompact_handle04_04_dasm(DASM_PARAMS); break; // AND
735      case 0x05: size = arcompact_handle04_05_dasm(DASM_PARAMS); break; // OR
736      case 0x06: size = arcompact_handle04_06_dasm(DASM_PARAMS); break; // BIC
737      case 0x07: size = arcompact_handle04_07_dasm(DASM_PARAMS); break; // XOR
738      case 0x08: size = arcompact_handle04_08_dasm(DASM_PARAMS); break; // MAX
739      case 0x09: size = arcompact_handle04_09_dasm(DASM_PARAMS); break; // MIN
740      case 0x0a: size = arcompact_handle04_0a_dasm(DASM_PARAMS); break; // MOV
741      case 0x0b: size = arcompact_handle04_0b_dasm(DASM_PARAMS); break; // TST
742      case 0x0c: size = arcompact_handle04_0c_dasm(DASM_PARAMS); break; // CMP
743      case 0x0d: size = arcompact_handle04_0d_dasm(DASM_PARAMS); break; // RCMP
744      case 0x0e: size = arcompact_handle04_0e_dasm(DASM_PARAMS); break; // RSUB
745      case 0x0f: size = arcompact_handle04_0f_dasm(DASM_PARAMS); break; // BSET
746      case 0x10: size = arcompact_handle04_10_dasm(DASM_PARAMS); break; // BCLR
747      case 0x11: size = arcompact_handle04_11_dasm(DASM_PARAMS); break; // BTST
748      case 0x12: size = arcompact_handle04_12_dasm(DASM_PARAMS); break; // BXOR
749      case 0x13: size = arcompact_handle04_13_dasm(DASM_PARAMS); break; // BMSK
750      case 0x14: size = arcompact_handle04_14_dasm(DASM_PARAMS); break; // ADD1
751      case 0x15: size = arcompact_handle04_15_dasm(DASM_PARAMS); break; // ADD2
752      case 0x16: size = arcompact_handle04_16_dasm(DASM_PARAMS); break; // ADD3
753      case 0x17: size = arcompact_handle04_17_dasm(DASM_PARAMS); break; // SUB1
754      case 0x18: size = arcompact_handle04_18_dasm(DASM_PARAMS); break; // SUB2
755      case 0x19: size = arcompact_handle04_19_dasm(DASM_PARAMS); break; // SUB3
756      case 0x1a: size = arcompact_handle04_1a_dasm(DASM_PARAMS); break; // MPY *
757      case 0x1b: size = arcompact_handle04_1b_dasm(DASM_PARAMS); break; // MPYH *
758      case 0x1c: size = arcompact_handle04_1c_dasm(DASM_PARAMS); break; // MPYHU *
759      case 0x1d: size = arcompact_handle04_1d_dasm(DASM_PARAMS); break; // MPYU *
760      case 0x1e: size = arcompact_handle04_1e_dasm(DASM_PARAMS); break; // illegal
761      case 0x1f: size = arcompact_handle04_1f_dasm(DASM_PARAMS); break; // illegal
762      case 0x20: size = arcompact_handle04_20_dasm(DASM_PARAMS); break; // Jcc
763      case 0x21: size = arcompact_handle04_21_dasm(DASM_PARAMS); break; // Jcc.D
764      case 0x22: size = arcompact_handle04_22_dasm(DASM_PARAMS); break; // JLcc
765      case 0x23: size = arcompact_handle04_23_dasm(DASM_PARAMS); break; // JLcc.D
766      case 0x24: size = arcompact_handle04_24_dasm(DASM_PARAMS); break; // illegal
767      case 0x25: size = arcompact_handle04_25_dasm(DASM_PARAMS); break; // illegal
768      case 0x26: size = arcompact_handle04_26_dasm(DASM_PARAMS); break; // illegal
769      case 0x27: size = arcompact_handle04_27_dasm(DASM_PARAMS); break; // illegal
770      case 0x28: size = arcompact_handle04_28_dasm(DASM_PARAMS); break; // LPcc
771      case 0x29: size = arcompact_handle04_29_dasm(DASM_PARAMS); break; // FLAG
772      case 0x2a: size = arcompact_handle04_2a_dasm(DASM_PARAMS); break; // LR
773      case 0x2b: size = arcompact_handle04_2b_dasm(DASM_PARAMS); break; // SR
774      case 0x2c: size = arcompact_handle04_2c_dasm(DASM_PARAMS); break; // illegal
775      case 0x2d: size = arcompact_handle04_2d_dasm(DASM_PARAMS); break; // illegal
776      case 0x2e: size = arcompact_handle04_2e_dasm(DASM_PARAMS); break; // illegal
777      case 0x2f: size = arcompact_handle04_2f_dasm(DASM_PARAMS); break; // Sub Opcode
778      case 0x30: size = arcompact_handle04_30_dasm(DASM_PARAMS); break; // LD r-r
779      case 0x31: size = arcompact_handle04_31_dasm(DASM_PARAMS); break; // LD r-r
780      case 0x32: size = arcompact_handle04_32_dasm(DASM_PARAMS); break; // LD r-r
781      case 0x33: size = arcompact_handle04_33_dasm(DASM_PARAMS); break; // LD r-r
782      case 0x34: size = arcompact_handle04_34_dasm(DASM_PARAMS); break; // LD r-r
783      case 0x35: size = arcompact_handle04_35_dasm(DASM_PARAMS); break; // LD r-r
784      case 0x36: size = arcompact_handle04_36_dasm(DASM_PARAMS); break; // LD r-r
785      case 0x37: size = arcompact_handle04_37_dasm(DASM_PARAMS); break; // LD r-r
786      case 0x38: size = arcompact_handle04_38_dasm(DASM_PARAMS); break; // illegal
787      case 0x39: size = arcompact_handle04_39_dasm(DASM_PARAMS); break; // illegal
788      case 0x3a: size = arcompact_handle04_3a_dasm(DASM_PARAMS); break; // illegal
789      case 0x3b: size = arcompact_handle04_3b_dasm(DASM_PARAMS); break; // illegal
790      case 0x3c: size = arcompact_handle04_3c_dasm(DASM_PARAMS); break; // illegal
791      case 0x3d: size = arcompact_handle04_3d_dasm(DASM_PARAMS); break; // illegal
792      case 0x3e: size = arcompact_handle04_3e_dasm(DASM_PARAMS); break; // illegal
793      case 0x3f: size = arcompact_handle04_3f_dasm(DASM_PARAMS); break; // illegal
794   }
795
796   return size;
797}
798
799int arcompact_handle04_00_dasm(DASM_OPS_32)  { print("ADD (%08x)", op); return 4;}
800int arcompact_handle04_01_dasm(DASM_OPS_32)  { print("ADC (%08x)", op); return 4;}
801int arcompact_handle04_02_dasm(DASM_OPS_32)  { print("SUB (%08x)", op); return 4;}
802int arcompact_handle04_03_dasm(DASM_OPS_32)  { print("SBC (%08x)", op); return 4;}
803int arcompact_handle04_04_dasm(DASM_OPS_32)  { print("AND (%08x)", op); return 4;}
804int arcompact_handle04_05_dasm(DASM_OPS_32)  { print("OR (%08x)", op); return 4;}
805int arcompact_handle04_06_dasm(DASM_OPS_32)  { print("BIC (%08x)", op); return 4;}
806int arcompact_handle04_07_dasm(DASM_OPS_32)  { print("XOR (%08x)", op); return 4;}
807int arcompact_handle04_08_dasm(DASM_OPS_32)  { print("MAX (%08x)", op); return 4;}
808int arcompact_handle04_09_dasm(DASM_OPS_32)  { print("MIN (%08x)", op); return 4;}
809int arcompact_handle04_0a_dasm(DASM_OPS_32)  { print("MOV (%08x)", op); return 4;}
810int arcompact_handle04_0b_dasm(DASM_OPS_32)  { print("TST (%08x)", op); return 4;}
811int arcompact_handle04_0c_dasm(DASM_OPS_32)  { print("CMP (%08x)", op); return 4;}
812int arcompact_handle04_0d_dasm(DASM_OPS_32)  { print("RCMP (%08x)", op); return 4;}
813int arcompact_handle04_0e_dasm(DASM_OPS_32)  { print("RSUB (%08x)", op); return 4;}
814int arcompact_handle04_0f_dasm(DASM_OPS_32)  { print("BSET (%08x)", op); return 4;}
815int arcompact_handle04_10_dasm(DASM_OPS_32)  { print("BCLR (%08x)", op); return 4;}
816int arcompact_handle04_11_dasm(DASM_OPS_32)  { print("BTST (%08x)", op); return 4;}
817int arcompact_handle04_12_dasm(DASM_OPS_32)  { print("BXOR (%08x)", op); return 4;}
818int arcompact_handle04_13_dasm(DASM_OPS_32)  { print("BMSK (%08x)", op); return 4;}
819int arcompact_handle04_14_dasm(DASM_OPS_32)  { print("ADD1 (%08x)", op); return 4;}
820int arcompact_handle04_15_dasm(DASM_OPS_32)  { print("ADD2 (%08x)", op); return 4;}
821int arcompact_handle04_16_dasm(DASM_OPS_32)  { print("ADD3 (%08x)", op); return 4;}
822int arcompact_handle04_17_dasm(DASM_OPS_32)  { print("SUB1 (%08x)", op); return 4;}
823int arcompact_handle04_18_dasm(DASM_OPS_32)  { print("SUB2 (%08x)", op); return 4;}
824int arcompact_handle04_19_dasm(DASM_OPS_32)  { print("SUB3 (%08x)", op); return 4;}
825int arcompact_handle04_1a_dasm(DASM_OPS_32)  { print("MPY (%08x)", op); return 4;} // *
826int arcompact_handle04_1b_dasm(DASM_OPS_32)  { print("MPYH (%08x)", op); return 4;} // *
827int arcompact_handle04_1c_dasm(DASM_OPS_32)  { print("MPYHU (%08x)", op); return 4;} // *
828int arcompact_handle04_1d_dasm(DASM_OPS_32)  { print("MPYU (%08x)", op); return 4;} // *
829int arcompact_handle04_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_1e> (%08x)", op); return 4;}
830int arcompact_handle04_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_1f> (%08x)", op); return 4;}
831
832
833
834int arcompact_handle04_20_dasm(DASM_OPS_32)
835{
836   // todo, other bits (in none long immediate mode at least)
837
838   int size = 4;
839   int C = (op & 0x00000fc0) >> 6;
840   UINT8 condition = op & 0x0000001f;
841
842   op &= ~0x00000fc0;
843   
844   if (C == LIMM_REG)
845   {
846      UINT32 limm;
847      GET_LIMM_32;
848      size = 8;
849     
850      print("J(%s) %08x (%08x)", conditions[condition], limm, op);
851   }
852   else
853   {
854      print("J(%s) (r%d) (%08x)", conditions[condition], C, op);
855   }
856
857   return size;
858}
859
860
861
862int arcompact_handle04_21_dasm(DASM_OPS_32)  { print("Jcc.D (%08x)", op); return 4;}
863int arcompact_handle04_22_dasm(DASM_OPS_32)  { print("JLcc (%08x)", op); return 4;}
864int arcompact_handle04_23_dasm(DASM_OPS_32)  { print("JLcc.D (%08x)", op); return 4;}
865int arcompact_handle04_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_24> (%08x)", op); return 4;}
866int arcompact_handle04_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_25> (%08x)", op); return 4;}
867int arcompact_handle04_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_26> (%08x)", op); return 4;}
868int arcompact_handle04_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_27> (%08x)", op); return 4;}
869int arcompact_handle04_28_dasm(DASM_OPS_32)  { print("LPcc (%08x)", op); return 4;}
870int arcompact_handle04_29_dasm(DASM_OPS_32)  { print("FLAG (%08x)", op); return 4;}
871int arcompact_handle04_2a_dasm(DASM_OPS_32)  { print("LR (%08x)", op); return 4;}
872int arcompact_handle04_2b_dasm(DASM_OPS_32)  { print("SR (%08x)", op); return 4;}
873int arcompact_handle04_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2c> (%08x)", op); return 4;}
874int arcompact_handle04_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2d> (%08x)", op); return 4;}
875int arcompact_handle04_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2e> (%08x)", op); return 4;}
876
877int arcompact_handle04_2f_dasm(DASM_OPS_32)
878{
879   int size = 4;
880   UINT8 subinstr2 = (op & 0x0000003f) >> 0;
881   op &= ~0x0000003f;
882
883   switch (subinstr2)
884   {
885      case 0x00: size = arcompact_handle04_2f_00_dasm(DASM_PARAMS); break; // ASL
886      case 0x01: size = arcompact_handle04_2f_01_dasm(DASM_PARAMS); break; // ASR
887      case 0x02: size = arcompact_handle04_2f_02_dasm(DASM_PARAMS); break; // LSR
888      case 0x03: size = arcompact_handle04_2f_03_dasm(DASM_PARAMS); break; // ROR
889      case 0x04: size = arcompact_handle04_2f_04_dasm(DASM_PARAMS); break; // RCC
890      case 0x05: size = arcompact_handle04_2f_05_dasm(DASM_PARAMS); break; // SEXB
891      case 0x06: size = arcompact_handle04_2f_06_dasm(DASM_PARAMS); break; // SEXW
892      case 0x07: size = arcompact_handle04_2f_07_dasm(DASM_PARAMS); break; // EXTB
893      case 0x08: size = arcompact_handle04_2f_08_dasm(DASM_PARAMS); break; // EXTW
894      case 0x09: size = arcompact_handle04_2f_09_dasm(DASM_PARAMS); break; // ABS
895      case 0x0a: size = arcompact_handle04_2f_0a_dasm(DASM_PARAMS); break; // NOT
896      case 0x0b: size = arcompact_handle04_2f_0b_dasm(DASM_PARAMS); break; // RLC
897      case 0x0c: size = arcompact_handle04_2f_0c_dasm(DASM_PARAMS); break; // EX
898      case 0x0d: size = arcompact_handle04_2f_0d_dasm(DASM_PARAMS); break; // illegal
899      case 0x0e: size = arcompact_handle04_2f_0e_dasm(DASM_PARAMS); break; // illegal
900      case 0x0f: size = arcompact_handle04_2f_0f_dasm(DASM_PARAMS); break; // illegal
901      case 0x10: size = arcompact_handle04_2f_10_dasm(DASM_PARAMS); break; // illegal
902      case 0x11: size = arcompact_handle04_2f_11_dasm(DASM_PARAMS); break; // illegal
903      case 0x12: size = arcompact_handle04_2f_12_dasm(DASM_PARAMS); break; // illegal
904      case 0x13: size = arcompact_handle04_2f_13_dasm(DASM_PARAMS); break; // illegal
905      case 0x14: size = arcompact_handle04_2f_14_dasm(DASM_PARAMS); break; // illegal
906      case 0x15: size = arcompact_handle04_2f_15_dasm(DASM_PARAMS); break; // illegal
907      case 0x16: size = arcompact_handle04_2f_16_dasm(DASM_PARAMS); break; // illegal
908      case 0x17: size = arcompact_handle04_2f_17_dasm(DASM_PARAMS); break; // illegal
909      case 0x18: size = arcompact_handle04_2f_18_dasm(DASM_PARAMS); break; // illegal
910      case 0x19: size = arcompact_handle04_2f_19_dasm(DASM_PARAMS); break; // illegal
911      case 0x1a: size = arcompact_handle04_2f_1a_dasm(DASM_PARAMS); break; // illegal
912      case 0x1b: size = arcompact_handle04_2f_1b_dasm(DASM_PARAMS); break; // illegal
913      case 0x1c: size = arcompact_handle04_2f_1c_dasm(DASM_PARAMS); break; // illegal
914      case 0x1d: size = arcompact_handle04_2f_1d_dasm(DASM_PARAMS); break; // illegal
915      case 0x1e: size = arcompact_handle04_2f_1e_dasm(DASM_PARAMS); break; // illegal
916      case 0x1f: size = arcompact_handle04_2f_1f_dasm(DASM_PARAMS); break; // illegal
917      case 0x20: size = arcompact_handle04_2f_20_dasm(DASM_PARAMS); break; // illegal
918      case 0x21: size = arcompact_handle04_2f_21_dasm(DASM_PARAMS); break; // illegal
919      case 0x22: size = arcompact_handle04_2f_22_dasm(DASM_PARAMS); break; // illegal
920      case 0x23: size = arcompact_handle04_2f_23_dasm(DASM_PARAMS); break; // illegal
921      case 0x24: size = arcompact_handle04_2f_24_dasm(DASM_PARAMS); break; // illegal
922      case 0x25: size = arcompact_handle04_2f_25_dasm(DASM_PARAMS); break; // illegal
923      case 0x26: size = arcompact_handle04_2f_26_dasm(DASM_PARAMS); break; // illegal
924      case 0x27: size = arcompact_handle04_2f_27_dasm(DASM_PARAMS); break; // illegal
925      case 0x28: size = arcompact_handle04_2f_28_dasm(DASM_PARAMS); break; // illegal
926      case 0x29: size = arcompact_handle04_2f_29_dasm(DASM_PARAMS); break; // illegal
927      case 0x2a: size = arcompact_handle04_2f_2a_dasm(DASM_PARAMS); break; // illegal
928      case 0x2b: size = arcompact_handle04_2f_2b_dasm(DASM_PARAMS); break; // illegal
929      case 0x2c: size = arcompact_handle04_2f_2c_dasm(DASM_PARAMS); break; // illegal
930      case 0x2d: size = arcompact_handle04_2f_2d_dasm(DASM_PARAMS); break; // illegal
931      case 0x2e: size = arcompact_handle04_2f_2e_dasm(DASM_PARAMS); break; // illegal
932      case 0x2f: size = arcompact_handle04_2f_2f_dasm(DASM_PARAMS); break; // illegal
933      case 0x30: size = arcompact_handle04_2f_30_dasm(DASM_PARAMS); break; // illegal
934      case 0x31: size = arcompact_handle04_2f_31_dasm(DASM_PARAMS); break; // illegal
935      case 0x32: size = arcompact_handle04_2f_32_dasm(DASM_PARAMS); break; // illegal
936      case 0x33: size = arcompact_handle04_2f_33_dasm(DASM_PARAMS); break; // illegal
937      case 0x34: size = arcompact_handle04_2f_34_dasm(DASM_PARAMS); break; // illegal
938      case 0x35: size = arcompact_handle04_2f_35_dasm(DASM_PARAMS); break; // illegal
939      case 0x36: size = arcompact_handle04_2f_36_dasm(DASM_PARAMS); break; // illegal
940      case 0x37: size = arcompact_handle04_2f_37_dasm(DASM_PARAMS); break; // illegal
941      case 0x38: size = arcompact_handle04_2f_38_dasm(DASM_PARAMS); break; // illegal
942      case 0x39: size = arcompact_handle04_2f_39_dasm(DASM_PARAMS); break; // illegal
943      case 0x3a: size = arcompact_handle04_2f_3a_dasm(DASM_PARAMS); break; // illegal
944      case 0x3b: size = arcompact_handle04_2f_3b_dasm(DASM_PARAMS); break; // illegal
945      case 0x3c: size = arcompact_handle04_2f_3c_dasm(DASM_PARAMS); break; // illegal
946      case 0x3d: size = arcompact_handle04_2f_3d_dasm(DASM_PARAMS); break; // illegal
947      case 0x3e: size = arcompact_handle04_2f_3e_dasm(DASM_PARAMS); break; // illegal
948      case 0x3f: size = arcompact_handle04_2f_3f_dasm(DASM_PARAMS); break; // ZOPs (Zero Operand Opcodes)
949   }
950
951   return size;
952}
953
954
955int arcompact_handle04_2f_00_dasm(DASM_OPS_32)  { print("ASL (%08x)", op); return 4;} // ASL
956int arcompact_handle04_2f_01_dasm(DASM_OPS_32)  { print("ASR (%08x)", op); return 4;} // ASR
957int arcompact_handle04_2f_02_dasm(DASM_OPS_32)  { print("LSR (%08x)", op); return 4;} // LSR
958int arcompact_handle04_2f_03_dasm(DASM_OPS_32)  { print("ROR (%08x)", op); return 4;} // ROR
959int arcompact_handle04_2f_04_dasm(DASM_OPS_32)  { print("RCC (%08x)", op); return 4;} // RCC
960int arcompact_handle04_2f_05_dasm(DASM_OPS_32)  { print("SEXB (%08x)", op); return 4;} // SEXB
961int arcompact_handle04_2f_06_dasm(DASM_OPS_32)  { print("SEXW (%08x)", op); return 4;} // SEXW
962int arcompact_handle04_2f_07_dasm(DASM_OPS_32)  { print("EXTB (%08x)", op); return 4;} // EXTB
963int arcompact_handle04_2f_08_dasm(DASM_OPS_32)  { print("EXTW (%08x)", op); return 4;} // EXTW
964int arcompact_handle04_2f_09_dasm(DASM_OPS_32)  { print("ABS (%08x)", op); return 4;} // ABS
965int arcompact_handle04_2f_0a_dasm(DASM_OPS_32)  { print("NOT (%08x)", op); return 4;} // NOT
966int arcompact_handle04_2f_0b_dasm(DASM_OPS_32)  { print("RLC (%08x)", op); return 4;} // RLC
967int arcompact_handle04_2f_0c_dasm(DASM_OPS_32)  { print("EX (%08x)", op); return 4;} // EX
968int arcompact_handle04_2f_0d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0d> (%08x)", op); return 4;}
969int arcompact_handle04_2f_0e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0e> (%08x)", op); return 4;}
970int arcompact_handle04_2f_0f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0f> (%08x)", op); return 4;}
971int arcompact_handle04_2f_10_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_10> (%08x)", op); return 4;}
972int arcompact_handle04_2f_11_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_11> (%08x)", op); return 4;}
973int arcompact_handle04_2f_12_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_12> (%08x)", op); return 4;}
974int arcompact_handle04_2f_13_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_13> (%08x)", op); return 4;}
975int arcompact_handle04_2f_14_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_14> (%08x)", op); return 4;}
976int arcompact_handle04_2f_15_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_15> (%08x)", op); return 4;}
977int arcompact_handle04_2f_16_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_16> (%08x)", op); return 4;}
978int arcompact_handle04_2f_17_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_17> (%08x)", op); return 4;}
979int arcompact_handle04_2f_18_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_18> (%08x)", op); return 4;}
980int arcompact_handle04_2f_19_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_19> (%08x)", op); return 4;}
981int arcompact_handle04_2f_1a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1a> (%08x)", op); return 4;}
982int arcompact_handle04_2f_1b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1b> (%08x)", op); return 4;}
983int arcompact_handle04_2f_1c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1c> (%08x)", op); return 4;}
984int arcompact_handle04_2f_1d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1d> (%08x)", op); return 4;}
985int arcompact_handle04_2f_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1e> (%08x)", op); return 4;}
986int arcompact_handle04_2f_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1f> (%08x)", op); return 4;}
987int arcompact_handle04_2f_20_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_20> (%08x)", op); return 4;}
988int arcompact_handle04_2f_21_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_21> (%08x)", op); return 4;}
989int arcompact_handle04_2f_22_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_22> (%08x)", op); return 4;}
990int arcompact_handle04_2f_23_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_23> (%08x)", op); return 4;}
991int arcompact_handle04_2f_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_24> (%08x)", op); return 4;}
992int arcompact_handle04_2f_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_25> (%08x)", op); return 4;}
993int arcompact_handle04_2f_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_26> (%08x)", op); return 4;}
994int arcompact_handle04_2f_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_27> (%08x)", op); return 4;}
995int arcompact_handle04_2f_28_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_28> (%08x)", op); return 4;}
996int arcompact_handle04_2f_29_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_29> (%08x)", op); return 4;}
997int arcompact_handle04_2f_2a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2a> (%08x)", op); return 4;}
998int arcompact_handle04_2f_2b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2b> (%08x)", op); return 4;}
999int arcompact_handle04_2f_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2c> (%08x)", op); return 4;}
1000int arcompact_handle04_2f_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2d> (%08x)", op); return 4;}
1001int arcompact_handle04_2f_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2e> (%08x)", op); return 4;}
1002int arcompact_handle04_2f_2f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2f> (%08x)", op); return 4;}
1003int arcompact_handle04_2f_30_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_30> (%08x)", op); return 4;}
1004int arcompact_handle04_2f_31_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_31> (%08x)", op); return 4;}
1005int arcompact_handle04_2f_32_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_32> (%08x)", op); return 4;}
1006int arcompact_handle04_2f_33_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_33> (%08x)", op); return 4;}
1007int arcompact_handle04_2f_34_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_34> (%08x)", op); return 4;}
1008int arcompact_handle04_2f_35_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_35> (%08x)", op); return 4;}
1009int arcompact_handle04_2f_36_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_36> (%08x)", op); return 4;}
1010int arcompact_handle04_2f_37_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_37> (%08x)", op); return 4;}
1011int arcompact_handle04_2f_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_38> (%08x)", op); return 4;}
1012int arcompact_handle04_2f_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_39> (%08x)", op); return 4;}
1013int arcompact_handle04_2f_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3a> (%08x)", op); return 4;}
1014int arcompact_handle04_2f_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3b> (%08x)", op); return 4;}
1015int arcompact_handle04_2f_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3c> (%08x)", op); return 4;}
1016int arcompact_handle04_2f_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3d> (%08x)", op); return 4;}
1017int arcompact_handle04_2f_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3e> (%08x)", op); return 4;}
1018
1019int arcompact_handle04_2f_3f_dasm(DASM_OPS_32)
1020{
1021   int size = 4;
1022   UINT8 subinstr3 = (op & 0x07000000) >> 24;
1023   subinstr3 |= ((op & 0x00007000) >> 12) << 3;
1024
1025   op &= ~0x07007000;
1026
1027   switch (subinstr3)
1028   {
1029      case 0x00: size = arcompact_handle04_2f_3f_00_dasm(DASM_PARAMS); break; // illegal
1030      case 0x01: size = arcompact_handle04_2f_3f_01_dasm(DASM_PARAMS); break; // SLEEP
1031      case 0x02: size = arcompact_handle04_2f_3f_02_dasm(DASM_PARAMS); break; // SWI / TRAP9
1032      case 0x03: size = arcompact_handle04_2f_3f_03_dasm(DASM_PARAMS); break; // SYNC
1033      case 0x04: size = arcompact_handle04_2f_3f_04_dasm(DASM_PARAMS); break; // RTIE
1034      case 0x05: size = arcompact_handle04_2f_3f_05_dasm(DASM_PARAMS); break; // BRK
1035      case 0x06: size = arcompact_handle04_2f_3f_06_dasm(DASM_PARAMS); break; // illegal
1036      case 0x07: size = arcompact_handle04_2f_3f_07_dasm(DASM_PARAMS); break; // illegal
1037      case 0x08: size = arcompact_handle04_2f_3f_08_dasm(DASM_PARAMS); break; // illegal
1038      case 0x09: size = arcompact_handle04_2f_3f_09_dasm(DASM_PARAMS); break; // illegal
1039      case 0x0a: size = arcompact_handle04_2f_3f_0a_dasm(DASM_PARAMS); break; // illegal
1040      case 0x0b: size = arcompact_handle04_2f_3f_0b_dasm(DASM_PARAMS); break; // illegal
1041      case 0x0c: size = arcompact_handle04_2f_3f_0c_dasm(DASM_PARAMS); break; // illegal
1042      case 0x0d: size = arcompact_handle04_2f_3f_0d_dasm(DASM_PARAMS); break; // illegal
1043      case 0x0e: size = arcompact_handle04_2f_3f_0e_dasm(DASM_PARAMS); break; // illegal
1044      case 0x0f: size = arcompact_handle04_2f_3f_0f_dasm(DASM_PARAMS); break; // illegal
1045      case 0x10: size = arcompact_handle04_2f_3f_10_dasm(DASM_PARAMS); break; // illegal
1046      case 0x11: size = arcompact_handle04_2f_3f_11_dasm(DASM_PARAMS); break; // illegal
1047      case 0x12: size = arcompact_handle04_2f_3f_12_dasm(DASM_PARAMS); break; // illegal
1048      case 0x13: size = arcompact_handle04_2f_3f_13_dasm(DASM_PARAMS); break; // illegal
1049      case 0x14: size = arcompact_handle04_2f_3f_14_dasm(DASM_PARAMS); break; // illegal
1050      case 0x15: size = arcompact_handle04_2f_3f_15_dasm(DASM_PARAMS); break; // illegal
1051      case 0x16: size = arcompact_handle04_2f_3f_16_dasm(DASM_PARAMS); break; // illegal
1052      case 0x17: size = arcompact_handle04_2f_3f_17_dasm(DASM_PARAMS); break; // illegal
1053      case 0x18: size = arcompact_handle04_2f_3f_18_dasm(DASM_PARAMS); break; // illegal
1054      case 0x19: size = arcompact_handle04_2f_3f_19_dasm(DASM_PARAMS); break; // illegal
1055      case 0x1a: size = arcompact_handle04_2f_3f_1a_dasm(DASM_PARAMS); break; // illegal
1056      case 0x1b: size = arcompact_handle04_2f_3f_1b_dasm(DASM_PARAMS); break; // illegal
1057      case 0x1c: size = arcompact_handle04_2f_3f_1c_dasm(DASM_PARAMS); break; // illegal
1058      case 0x1d: size = arcompact_handle04_2f_3f_1d_dasm(DASM_PARAMS); break; // illegal
1059      case 0x1e: size = arcompact_handle04_2f_3f_1e_dasm(DASM_PARAMS); break; // illegal
1060      case 0x1f: size = arcompact_handle04_2f_3f_1f_dasm(DASM_PARAMS); break; // illegal
1061      case 0x20: size = arcompact_handle04_2f_3f_20_dasm(DASM_PARAMS); break; // illegal
1062      case 0x21: size = arcompact_handle04_2f_3f_21_dasm(DASM_PARAMS); break; // illegal
1063      case 0x22: size = arcompact_handle04_2f_3f_22_dasm(DASM_PARAMS); break; // illegal
1064      case 0x23: size = arcompact_handle04_2f_3f_23_dasm(DASM_PARAMS); break; // illegal
1065      case 0x24: size = arcompact_handle04_2f_3f_24_dasm(DASM_PARAMS); break; // illegal
1066      case 0x25: size = arcompact_handle04_2f_3f_25_dasm(DASM_PARAMS); break; // illegal
1067      case 0x26: size = arcompact_handle04_2f_3f_26_dasm(DASM_PARAMS); break; // illegal
1068      case 0x27: size = arcompact_handle04_2f_3f_27_dasm(DASM_PARAMS); break; // illegal
1069      case 0x28: size = arcompact_handle04_2f_3f_28_dasm(DASM_PARAMS); break; // illegal
1070      case 0x29: size = arcompact_handle04_2f_3f_29_dasm(DASM_PARAMS); break; // illegal
1071      case 0x2a: size = arcompact_handle04_2f_3f_2a_dasm(DASM_PARAMS); break; // illegal
1072      case 0x2b: size = arcompact_handle04_2f_3f_2b_dasm(DASM_PARAMS); break; // illegal
1073      case 0x2c: size = arcompact_handle04_2f_3f_2c_dasm(DASM_PARAMS); break; // illegal
1074      case 0x2d: size = arcompact_handle04_2f_3f_2d_dasm(DASM_PARAMS); break; // illegal
1075      case 0x2e: size = arcompact_handle04_2f_3f_2e_dasm(DASM_PARAMS); break; // illegal
1076      case 0x2f: size = arcompact_handle04_2f_3f_2f_dasm(DASM_PARAMS); break; // illegal
1077      case 0x30: size = arcompact_handle04_2f_3f_30_dasm(DASM_PARAMS); break; // illegal
1078      case 0x31: size = arcompact_handle04_2f_3f_31_dasm(DASM_PARAMS); break; // illegal
1079      case 0x32: size = arcompact_handle04_2f_3f_32_dasm(DASM_PARAMS); break; // illegal
1080      case 0x33: size = arcompact_handle04_2f_3f_33_dasm(DASM_PARAMS); break; // illegal
1081      case 0x34: size = arcompact_handle04_2f_3f_34_dasm(DASM_PARAMS); break; // illegal
1082      case 0x35: size = arcompact_handle04_2f_3f_35_dasm(DASM_PARAMS); break; // illegal
1083      case 0x36: size = arcompact_handle04_2f_3f_36_dasm(DASM_PARAMS); break; // illegal
1084      case 0x37: size = arcompact_handle04_2f_3f_37_dasm(DASM_PARAMS); break; // illegal
1085      case 0x38: size = arcompact_handle04_2f_3f_38_dasm(DASM_PARAMS); break; // illegal
1086      case 0x39: size = arcompact_handle04_2f_3f_39_dasm(DASM_PARAMS); break; // illegal
1087      case 0x3a: size = arcompact_handle04_2f_3f_3a_dasm(DASM_PARAMS); break; // illegal
1088      case 0x3b: size = arcompact_handle04_2f_3f_3b_dasm(DASM_PARAMS); break; // illegal
1089      case 0x3c: size = arcompact_handle04_2f_3f_3c_dasm(DASM_PARAMS); break; // illegal
1090      case 0x3d: size = arcompact_handle04_2f_3f_3d_dasm(DASM_PARAMS); break; // illegal
1091      case 0x3e: size = arcompact_handle04_2f_3f_3e_dasm(DASM_PARAMS); break; // illegal
1092      case 0x3f: size = arcompact_handle04_2f_3f_3f_dasm(DASM_PARAMS); break; // illegal
1093   }
1094
1095   return size;
1096}
1097
1098int arcompact_handle04_2f_3f_00_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_00> (%08x)", op); return 4;}
1099int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32)  { print("SLEEP (%08x)", op); return 4;}
1100int arcompact_handle04_2f_3f_02_dasm(DASM_OPS_32)  { print("SWI / TRAP0 (%08x)", op); return 4;}
1101int arcompact_handle04_2f_3f_03_dasm(DASM_OPS_32)  { print("SYNC (%08x)", op); return 4;}
1102int arcompact_handle04_2f_3f_04_dasm(DASM_OPS_32)  { print("RTIE (%08x)", op); return 4;}
1103int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32)  { print("BRK (%08x)", op); return 4;}
1104int arcompact_handle04_2f_3f_06_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_06> (%08x)", op); return 4;}
1105int arcompact_handle04_2f_3f_07_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_07> (%08x)", op); return 4;}
1106int arcompact_handle04_2f_3f_08_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_08> (%08x)", op); return 4;}
1107int arcompact_handle04_2f_3f_09_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_09> (%08x)", op); return 4;}
1108int arcompact_handle04_2f_3f_0a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0a> (%08x)", op); return 4;}
1109int arcompact_handle04_2f_3f_0b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0b> (%08x)", op); return 4;}
1110int arcompact_handle04_2f_3f_0c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0c> (%08x)", op); return 4;}
1111int arcompact_handle04_2f_3f_0d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0d> (%08x)", op); return 4;}
1112int arcompact_handle04_2f_3f_0e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0e> (%08x)", op); return 4;}
1113int arcompact_handle04_2f_3f_0f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0f> (%08x)", op); return 4;}
1114int arcompact_handle04_2f_3f_10_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_10> (%08x)", op); return 4;}
1115int arcompact_handle04_2f_3f_11_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_11> (%08x)", op); return 4;}
1116int arcompact_handle04_2f_3f_12_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_12> (%08x)", op); return 4;}
1117int arcompact_handle04_2f_3f_13_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_13> (%08x)", op); return 4;}
1118int arcompact_handle04_2f_3f_14_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_14> (%08x)", op); return 4;}
1119int arcompact_handle04_2f_3f_15_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_15> (%08x)", op); return 4;}
1120int arcompact_handle04_2f_3f_16_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_16> (%08x)", op); return 4;}
1121int arcompact_handle04_2f_3f_17_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_17> (%08x)", op); return 4;}
1122int arcompact_handle04_2f_3f_18_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_18> (%08x)", op); return 4;}
1123int arcompact_handle04_2f_3f_19_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_19> (%08x)", op); return 4;}
1124int arcompact_handle04_2f_3f_1a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1a> (%08x)", op); return 4;}
1125int arcompact_handle04_2f_3f_1b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1b> (%08x)", op); return 4;}
1126int arcompact_handle04_2f_3f_1c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1c> (%08x)", op); return 4;}
1127int arcompact_handle04_2f_3f_1d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1d> (%08x)", op); return 4;}
1128int arcompact_handle04_2f_3f_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1e> (%08x)", op); return 4;}
1129int arcompact_handle04_2f_3f_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1f> (%08x)", op); return 4;}
1130int arcompact_handle04_2f_3f_20_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_20> (%08x)", op); return 4;}
1131int arcompact_handle04_2f_3f_21_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_21> (%08x)", op); return 4;}
1132int arcompact_handle04_2f_3f_22_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_22> (%08x)", op); return 4;}
1133int arcompact_handle04_2f_3f_23_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_23> (%08x)", op); return 4;}
1134int arcompact_handle04_2f_3f_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_24> (%08x)", op); return 4;}
1135int arcompact_handle04_2f_3f_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_25> (%08x)", op); return 4;}
1136int arcompact_handle04_2f_3f_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_26> (%08x)", op); return 4;}
1137int arcompact_handle04_2f_3f_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_27> (%08x)", op); return 4;}
1138int arcompact_handle04_2f_3f_28_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_28> (%08x)", op); return 4;}
1139int arcompact_handle04_2f_3f_29_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_29> (%08x)", op); return 4;}
1140int arcompact_handle04_2f_3f_2a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2a> (%08x)", op); return 4;}
1141int arcompact_handle04_2f_3f_2b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2b> (%08x)", op); return 4;}
1142int arcompact_handle04_2f_3f_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2c> (%08x)", op); return 4;}
1143int arcompact_handle04_2f_3f_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2d> (%08x)", op); return 4;}
1144int arcompact_handle04_2f_3f_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2e> (%08x)", op); return 4;}
1145int arcompact_handle04_2f_3f_2f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2f> (%08x)", op); return 4;}
1146int arcompact_handle04_2f_3f_30_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_30> (%08x)", op); return 4;}
1147int arcompact_handle04_2f_3f_31_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_31> (%08x)", op); return 4;}
1148int arcompact_handle04_2f_3f_32_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_32> (%08x)", op); return 4;}
1149int arcompact_handle04_2f_3f_33_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_33> (%08x)", op); return 4;}
1150int arcompact_handle04_2f_3f_34_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_34> (%08x)", op); return 4;}
1151int arcompact_handle04_2f_3f_35_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_35> (%08x)", op); return 4;}
1152int arcompact_handle04_2f_3f_36_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_36> (%08x)", op); return 4;}
1153int arcompact_handle04_2f_3f_37_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_37> (%08x)", op); return 4;}
1154int arcompact_handle04_2f_3f_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_38> (%08x)", op); return 4;}
1155int arcompact_handle04_2f_3f_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_39> (%08x)", op); return 4;}
1156int arcompact_handle04_2f_3f_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3a> (%08x)", op); return 4;}
1157int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3b> (%08x)", op); return 4;}
1158int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3c> (%08x)", op); return 4;}
1159int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3d> (%08x)", op); return 4;}
1160int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3e> (%08x)", op); return 4;}
1161int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3f> (%08x)", op); return 4;}
1162
1163
1164
1165
1166
1167
1168
1169
1170int arcompact_handle04_30_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x30) (%08x)", op); return 4;}
1171int arcompact_handle04_31_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x31) (%08x)", op); return 4;}
1172int arcompact_handle04_32_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x32) (%08x)", op); return 4;}
1173int arcompact_handle04_33_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x33) (%08x)", op); return 4;}
1174int arcompact_handle04_34_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x34) (%08x)", op); return 4;}
1175int arcompact_handle04_35_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x35) (%08x)", op); return 4;}
1176int arcompact_handle04_36_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x36) (%08x)", op); return 4;}
1177int arcompact_handle04_37_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x37) (%08x)", op); return 4;}
1178int arcompact_handle04_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_38> (%08x)", op); return 4;}
1179int arcompact_handle04_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_39> (%08x)", op); return 4;}
1180int arcompact_handle04_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_3a> (%08x)", op); return 4;}
1181int arcompact_handle04_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_3b> (%08x)", op); return 4;}
1182int arcompact_handle04_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_3c> (%08x)", op); return 4;}
1183int arcompact_handle04_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_3d> (%08x)", op); return 4;}
1184int arcompact_handle04_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_3e> (%08x)", op); return 4;}
1185int arcompact_handle04_3f_dasm(DASM_OPS_32)  { print("<illegal 0x04_3f> (%08x)", op); return 4;}
1186
1187
1188
1189
1190
1191// this is an Extension ALU group, maybe optional on some CPUs?
1192int arcompact_handle05_dasm(DASM_OPS_32)
1193{
1194   int size = 4;
1195   UINT8 subinstr = (op & 0x003f0000) >> 16;
1196   op &= ~0x003f0000;
1197
1198   switch (subinstr)
1199   {
1200      case 0x00: size = arcompact_handle05_00_dasm(DASM_PARAMS); break; // ASL
1201      case 0x01: size = arcompact_handle05_01_dasm(DASM_PARAMS); break; // LSR
1202      case 0x02: size = arcompact_handle05_02_dasm(DASM_PARAMS); break; // ASR
1203      case 0x03: size = arcompact_handle05_03_dasm(DASM_PARAMS); break; // ROR
1204      case 0x04: size = arcompact_handle05_04_dasm(DASM_PARAMS); break; // MUL64
1205      case 0x05: size = arcompact_handle05_05_dasm(DASM_PARAMS); break; // MULU64
1206      case 0x06: size = arcompact_handle05_06_dasm(DASM_PARAMS); break; // ADDS
1207      case 0x07: size = arcompact_handle05_07_dasm(DASM_PARAMS); break; // SUBS
1208      case 0x08: size = arcompact_handle05_08_dasm(DASM_PARAMS); break; // DIVAW
1209      case 0x09: size = arcompact_handle05_09_dasm(DASM_PARAMS); break; // illegal
1210      case 0x0a: size = arcompact_handle05_0a_dasm(DASM_PARAMS); break; // ASLS
1211      case 0x0b: size = arcompact_handle05_0b_dasm(DASM_PARAMS); break; // ASRS
1212      case 0x0c: size = arcompact_handle05_0c_dasm(DASM_PARAMS); break; // illegal
1213      case 0x0d: size = arcompact_handle05_0d_dasm(DASM_PARAMS); break; // illegal
1214      case 0x0e: size = arcompact_handle05_0e_dasm(DASM_PARAMS); break; // illegal
1215      case 0x0f: size = arcompact_handle05_0f_dasm(DASM_PARAMS); break; // illegal
1216      case 0x10: size = arcompact_handle05_10_dasm(DASM_PARAMS); break; // illegal
1217      case 0x11: size = arcompact_handle05_11_dasm(DASM_PARAMS); break; // illegal
1218      case 0x12: size = arcompact_handle05_12_dasm(DASM_PARAMS); break; // illegal
1219      case 0x13: size = arcompact_handle05_13_dasm(DASM_PARAMS); break; // illegal
1220      case 0x14: size = arcompact_handle05_14_dasm(DASM_PARAMS); break; // illegal
1221      case 0x15: size = arcompact_handle05_15_dasm(DASM_PARAMS); break; // illegal
1222      case 0x16: size = arcompact_handle05_16_dasm(DASM_PARAMS); break; // illegal
1223      case 0x17: size = arcompact_handle05_17_dasm(DASM_PARAMS); break; // illegal
1224      case 0x18: size = arcompact_handle05_18_dasm(DASM_PARAMS); break; // illegal
1225      case 0x19: size = arcompact_handle05_19_dasm(DASM_PARAMS); break; // illegal
1226      case 0x1a: size = arcompact_handle05_1a_dasm(DASM_PARAMS); break; // illegal
1227      case 0x1b: size = arcompact_handle05_1b_dasm(DASM_PARAMS); break; // illegal
1228      case 0x1c: size = arcompact_handle05_1c_dasm(DASM_PARAMS); break; // illegal
1229      case 0x1d: size = arcompact_handle05_1d_dasm(DASM_PARAMS); break; // illegal
1230      case 0x1e: size = arcompact_handle05_1e_dasm(DASM_PARAMS); break; // illegal
1231      case 0x1f: size = arcompact_handle05_1f_dasm(DASM_PARAMS); break; // illegal
1232      case 0x20: size = arcompact_handle05_20_dasm(DASM_PARAMS); break; // illegal
1233      case 0x21: size = arcompact_handle05_21_dasm(DASM_PARAMS); break; // illegal
1234      case 0x22: size = arcompact_handle05_22_dasm(DASM_PARAMS); break; // illegal
1235      case 0x23: size = arcompact_handle05_23_dasm(DASM_PARAMS); break; // illegal
1236      case 0x24: size = arcompact_handle05_24_dasm(DASM_PARAMS); break; // illegal
1237      case 0x25: size = arcompact_handle05_25_dasm(DASM_PARAMS); break; // illegal
1238      case 0x26: size = arcompact_handle05_26_dasm(DASM_PARAMS); break; // illegal
1239      case 0x27: size = arcompact_handle05_27_dasm(DASM_PARAMS); break; // illegal
1240      case 0x28: size = arcompact_handle05_28_dasm(DASM_PARAMS); break; // ADDSDW
1241      case 0x29: size = arcompact_handle05_29_dasm(DASM_PARAMS); break; // SUBSDW
1242      case 0x2a: size = arcompact_handle05_2a_dasm(DASM_PARAMS); break; // illegal
1243      case 0x2b: size = arcompact_handle05_2b_dasm(DASM_PARAMS); break; // illegal
1244      case 0x2c: size = arcompact_handle05_2c_dasm(DASM_PARAMS); break; // illegal
1245      case 0x2d: size = arcompact_handle05_2d_dasm(DASM_PARAMS); break; // illegal
1246      case 0x2e: size = arcompact_handle05_2e_dasm(DASM_PARAMS); break; // illegal
1247      case 0x2f: size = arcompact_handle05_2f_dasm(DASM_PARAMS); break; // SOPs
1248      case 0x30: size = arcompact_handle05_30_dasm(DASM_PARAMS); break; // illegal
1249      case 0x31: size = arcompact_handle05_31_dasm(DASM_PARAMS); break; // illegal
1250      case 0x32: size = arcompact_handle05_32_dasm(DASM_PARAMS); break; // illegal
1251      case 0x33: size = arcompact_handle05_33_dasm(DASM_PARAMS); break; // illegal
1252      case 0x34: size = arcompact_handle05_34_dasm(DASM_PARAMS); break; // illegal
1253      case 0x35: size = arcompact_handle05_35_dasm(DASM_PARAMS); break; // illegal
1254      case 0x36: size = arcompact_handle05_36_dasm(DASM_PARAMS); break; // illegal
1255      case 0x37: size = arcompact_handle05_37_dasm(DASM_PARAMS); break; // illegal
1256      case 0x38: size = arcompact_handle05_38_dasm(DASM_PARAMS); break; // illegal
1257      case 0x39: size = arcompact_handle05_39_dasm(DASM_PARAMS); break; // illegal
1258      case 0x3a: size = arcompact_handle05_3a_dasm(DASM_PARAMS); break; // illegal
1259      case 0x3b: size = arcompact_handle05_3b_dasm(DASM_PARAMS); break; // illegal
1260      case 0x3c: size = arcompact_handle05_3c_dasm(DASM_PARAMS); break; // illegal
1261      case 0x3d: size = arcompact_handle05_3d_dasm(DASM_PARAMS); break; // illegal
1262      case 0x3e: size = arcompact_handle05_3e_dasm(DASM_PARAMS); break; // illegal
1263      case 0x3f: size = arcompact_handle05_3f_dasm(DASM_PARAMS); break; // illegal
1264   }
1265
1266   return size;
1267}
1268
1269int arcompact_handle05_00_dasm(DASM_OPS_32)  { print("ASL a <- b asl c (%08x)", op); return 4;}
1270int arcompact_handle05_01_dasm(DASM_OPS_32)  { print("LSR a <- b lsr c (%08x)", op); return 4;}
1271int arcompact_handle05_02_dasm(DASM_OPS_32)  { print("ASR a <- b asr c (%08x)", op); return 4;}
1272int arcompact_handle05_03_dasm(DASM_OPS_32)  { print("ROR a <- b ror c (%08x)", op); return 4;}
1273int arcompact_handle05_04_dasm(DASM_OPS_32)  { print("MUL64 mulres <- b * c (%08x)", op); return 4;}
1274int arcompact_handle05_05_dasm(DASM_OPS_32)  { print("MULU64 mulres <- b * c (%08x)", op); return 4;}
1275int arcompact_handle05_06_dasm(DASM_OPS_32)  { print("ADDS a <- sat32 (b + c) (%08x)", op); return 4;}
1276int arcompact_handle05_07_dasm(DASM_OPS_32)  { print("SUBS a <- sat32 (b + c) (%08x)", op); return 4;}
1277int arcompact_handle05_08_dasm(DASM_OPS_32)  { print("DIVAW (%08x)", op); return 4;}
1278int arcompact_handle05_09_dasm(DASM_OPS_32)  { print("<illegal 0x05_09> (%08x)", op); return 4;}
1279int arcompact_handle05_0a_dasm(DASM_OPS_32)  { print("ASLS a <- sat32 (b << c) (%08x)", op); return 4;}
1280int arcompact_handle05_0b_dasm(DASM_OPS_32)  { print("ASRS a ,- sat32 (b >> c) (%08x)", op); return 4;}
1281int arcompact_handle05_0c_dasm(DASM_OPS_32)  { print("<illegal 0x05_0c> (%08x)", op); return 4;}
1282int arcompact_handle05_0d_dasm(DASM_OPS_32)  { print("<illegal 0x05_0d> (%08x)", op); return 4;}
1283int arcompact_handle05_0e_dasm(DASM_OPS_32)  { print("<illegal 0x05_0e> (%08x)", op); return 4;}
1284int arcompact_handle05_0f_dasm(DASM_OPS_32)  { print("<illegal 0x05_0f> (%08x)", op); return 4;}
1285int arcompact_handle05_10_dasm(DASM_OPS_32)  { print("<illegal 0x05_10> (%08x)", op); return 4;}
1286int arcompact_handle05_11_dasm(DASM_OPS_32)  { print("<illegal 0x05_11> (%08x)", op); return 4;}
1287int arcompact_handle05_12_dasm(DASM_OPS_32)  { print("<illegal 0x05_12> (%08x)", op); return 4;}
1288int arcompact_handle05_13_dasm(DASM_OPS_32)  { print("<illegal 0x05_13> (%08x)", op); return 4;}
1289int arcompact_handle05_14_dasm(DASM_OPS_32)  { print("<illegal 0x05_14> (%08x)", op); return 4;}
1290int arcompact_handle05_15_dasm(DASM_OPS_32)  { print("<illegal 0x05_15> (%08x)", op); return 4;}
1291int arcompact_handle05_16_dasm(DASM_OPS_32)  { print("<illegal 0x05_16> (%08x)", op); return 4;}
1292int arcompact_handle05_17_dasm(DASM_OPS_32)  { print("<illegal 0x05_17> (%08x)", op); return 4;}
1293int arcompact_handle05_18_dasm(DASM_OPS_32)  { print("<illegal 0x05_18> (%08x)", op); return 4;}
1294int arcompact_handle05_19_dasm(DASM_OPS_32)  { print("<illegal 0x05_19> (%08x)", op); return 4;}
1295int arcompact_handle05_1a_dasm(DASM_OPS_32)  { print("<illegal 0x05_1a> (%08x)", op); return 4;}
1296int arcompact_handle05_1b_dasm(DASM_OPS_32)  { print("<illegal 0x05_1b> (%08x)", op); return 4;}
1297int arcompact_handle05_1c_dasm(DASM_OPS_32)  { print("<illegal 0x05_1c> (%08x)", op); return 4;}
1298int arcompact_handle05_1d_dasm(DASM_OPS_32)  { print("<illegal 0x05_1d> (%08x)", op); return 4;}
1299int arcompact_handle05_1e_dasm(DASM_OPS_32)  { print("<illegal 0x05_1e> (%08x)", op); return 4;}
1300int arcompact_handle05_1f_dasm(DASM_OPS_32)  { print("<illegal 0x05_1f> (%08x)", op); return 4;}
1301int arcompact_handle05_20_dasm(DASM_OPS_32)  { print("<illegal 0x05_20> (%08x)", op); return 4;}
1302int arcompact_handle05_21_dasm(DASM_OPS_32)  { print("<illegal 0x05_21> (%08x)", op); return 4;}
1303int arcompact_handle05_22_dasm(DASM_OPS_32)  { print("<illegal 0x05_22> (%08x)", op); return 4;}
1304int arcompact_handle05_23_dasm(DASM_OPS_32)  { print("<illegal 0x05_23> (%08x)", op); return 4;}
1305int arcompact_handle05_24_dasm(DASM_OPS_32)  { print("<illegal 0x05_24> (%08x)", op); return 4;}
1306int arcompact_handle05_25_dasm(DASM_OPS_32)  { print("<illegal 0x05_25> (%08x)", op); return 4;}
1307int arcompact_handle05_26_dasm(DASM_OPS_32)  { print("<illegal 0x05_26> (%08x)", op); return 4;}
1308int arcompact_handle05_27_dasm(DASM_OPS_32)  { print("<illegal 0x05_27> (%08x)", op); return 4;}
1309int arcompact_handle05_28_dasm(DASM_OPS_32)  { print("ADDSDW (%08x)", op); return 4;}
1310int arcompact_handle05_29_dasm(DASM_OPS_32)  { print("SUBSDW (%08x)", op); return 4;}
1311int arcompact_handle05_2a_dasm(DASM_OPS_32)  { print("<illegal 0x05_2a> (%08x)", op); return 4;}
1312int arcompact_handle05_2b_dasm(DASM_OPS_32)  { print("<illegal 0x05_2b> (%08x)", op); return 4;}
1313int arcompact_handle05_2c_dasm(DASM_OPS_32)  { print("<illegal 0x05_2c> (%08x)", op); return 4;}
1314int arcompact_handle05_2d_dasm(DASM_OPS_32)  { print("<illegal 0x05_2d> (%08x)", op); return 4;}
1315int arcompact_handle05_2e_dasm(DASM_OPS_32)  { print("<illegal 0x05_2e> (%08x)", op); return 4;}
1316int arcompact_handle05_2f_dasm(DASM_OPS_32)  { print("SOP (another table) (%08x)", op); return 4;}
1317int arcompact_handle05_30_dasm(DASM_OPS_32)  { print("<illegal 0x05_30> (%08x)", op); return 4;}
1318int arcompact_handle05_31_dasm(DASM_OPS_32)  { print("<illegal 0x05_31> (%08x)", op); return 4;}
1319int arcompact_handle05_32_dasm(DASM_OPS_32)  { print("<illegal 0x05_32> (%08x)", op); return 4;}
1320int arcompact_handle05_33_dasm(DASM_OPS_32)  { print("<illegal 0x05_33> (%08x)", op); return 4;}
1321int arcompact_handle05_34_dasm(DASM_OPS_32)  { print("<illegal 0x05_34> (%08x)", op); return 4;}
1322int arcompact_handle05_35_dasm(DASM_OPS_32)  { print("<illegal 0x05_35> (%08x)", op); return 4;}
1323int arcompact_handle05_36_dasm(DASM_OPS_32)  { print("<illegal 0x05_36> (%08x)", op); return 4;}
1324int arcompact_handle05_37_dasm(DASM_OPS_32)  { print("<illegal 0x05_37> (%08x)", op); return 4;}
1325int arcompact_handle05_38_dasm(DASM_OPS_32)  { print("<illegal 0x05_38> (%08x)", op); return 4;}
1326int arcompact_handle05_39_dasm(DASM_OPS_32)  { print("<illegal 0x05_39> (%08x)", op); return 4;}
1327int arcompact_handle05_3a_dasm(DASM_OPS_32)  { print("<illegal 0x05_3a> (%08x)", op); return 4;}
1328int arcompact_handle05_3b_dasm(DASM_OPS_32)  { print("<illegal 0x05_3b> (%08x)", op); return 4;}
1329int arcompact_handle05_3c_dasm(DASM_OPS_32)  { print("<illegal 0x05_3c> (%08x)", op); return 4;}
1330int arcompact_handle05_3d_dasm(DASM_OPS_32)  { print("<illegal 0x05_3d> (%08x)", op); return 4;}
1331int arcompact_handle05_3e_dasm(DASM_OPS_32)  { print("<illegal 0x05_3e> (%08x)", op); return 4;}
1332int arcompact_handle05_3f_dasm(DASM_OPS_32)  { print("<illegal 0x05_3f> (%08x)", op); return 4;}
1333
1334
1335
1336int arcompact_handle06_dasm(DASM_OPS_32)
1337{
1338   print("op a,b,c (06 ARC ext) (%08x)", op );
1339   return 4;
1340}
1341
1342int arcompact_handle07_dasm(DASM_OPS_32)
1343{
1344   print("op a,b,c (07 User ext) (%08x)", op );
1345   return 4;
1346}
1347
1348int arcompact_handle08_dasm(DASM_OPS_32)
1349{
1350   print("op a,b,c (08 User ext) (%08x)", op );
1351   return 4;
1352}
1353
1354int arcompact_handle09_dasm(DASM_OPS_32)
1355{
1356   print("op a,b,c (09 Market ext) (%08x)", op );
1357   return 4;
1358}
1359
1360int arcompact_handle0a_dasm(DASM_OPS_32)
1361{
1362   print("op a,b,c (0a Market ext) (%08x)",  op );
1363   return 4;
1364}
1365
1366int arcompact_handle0b_dasm(DASM_OPS_32)
1367{
1368   print("op a,b,c (0b Market ext) (%08x)",  op );
1369   return 4;
1370}
1371
1372
1373
1374
1375int arcompact_handle0c_dasm(DASM_OPS_16)
1376{
1377   int size = 2;
1378   UINT8 subinstr = (op & 0x0018) >> 3;
1379   op &= ~0x0018;
1380
1381   switch (subinstr)
1382   {
1383      case 0x00: size = arcompact_handle0c_00_dasm(DASM_PARAMS); break; // LD_S
1384      case 0x01: size = arcompact_handle0c_01_dasm(DASM_PARAMS); break; // LDB_S
1385      case 0x02: size = arcompact_handle0c_02_dasm(DASM_PARAMS); break; // LDW_S
1386      case 0x03: size = arcompact_handle0c_03_dasm(DASM_PARAMS); break; // ADD_S
1387   }
1388   return size;
1389}
1390
1391
1392int arcompact_handle0c_00_dasm(DASM_OPS_16)
1393{
1394   int size = 2;
1395   print("LD_S a <- m[b + c].long (%04x)", op);
1396   return size;
1397}
1398
1399int arcompact_handle0c_01_dasm(DASM_OPS_16)
1400{
1401   int size = 2;
1402   print("LDB_S a <- m[b + c].byte (%04x)", op);
1403   return size;
1404}
1405
1406int arcompact_handle0c_02_dasm(DASM_OPS_16)
1407{
1408   int size = 2;
1409   print("LDW_S a <- m[b + c].word (%04x)", op);
1410   return size;
1411}
1412
1413int arcompact_handle0c_03_dasm(DASM_OPS_16)
1414{
1415   int size = 2;
1416   print("ADD_S a <- b + c (%04x)", op);
1417   return size;
1418}
1419
1420
1421int arcompact_handle0d_dasm(DASM_OPS_16)
1422{
1423   int size = 2;
1424   UINT8 subinstr = (op & 0x0018) >> 3;
1425   op &= ~0x0018;
1426
1427   switch (subinstr)
1428   {
1429      case 0x00: size = arcompact_handle0d_00_dasm(DASM_PARAMS); break; // ADD_S
1430      case 0x01: size = arcompact_handle0d_01_dasm(DASM_PARAMS); break; // SUB_S
1431      case 0x02: size = arcompact_handle0d_02_dasm(DASM_PARAMS); break; // ASL_S
1432      case 0x03: size = arcompact_handle0d_03_dasm(DASM_PARAMS); break; // ASR_S
1433   }
1434   return size;
1435}
1436
1437int arcompact_handle0d_00_dasm(DASM_OPS_16)
1438{
1439   int size = 2;
1440   print("ADD_S c <- b + u3 (%04x)", op);
1441   return size;
1442}
1443
1444int arcompact_handle0d_01_dasm(DASM_OPS_16)
1445{
1446   int size = 2;
1447   print("SUB_S c <- b - u3 (%04x)", op);
1448   return size;
1449}
1450
1451int arcompact_handle0d_02_dasm(DASM_OPS_16)
1452{
1453   int size = 2;
1454   print("ASL_S c <- b asl u3 (%04x)", op);
1455   return size;
1456}
1457
1458int arcompact_handle0d_03_dasm(DASM_OPS_16)
1459{
1460   int size = 2;
1461   print("ASL_S c <- b asr u3 (%04x)", op);
1462   return size;
1463}
1464
1465
1466int arcompact_handle0e_dasm(DASM_OPS_16)
1467{
1468   int size = 2;
1469   UINT8 subinstr = (op & 0x0018) >> 3;
1470   op &= ~0x0018;
1471
1472   switch (subinstr)
1473   {
1474      case 0x00: size = arcompact_handle0e_00_dasm(DASM_PARAMS); break; // ADD_S
1475      case 0x01: size = arcompact_handle0e_01_dasm(DASM_PARAMS); break; // MOV_S
1476      case 0x02: size = arcompact_handle0e_02_dasm(DASM_PARAMS); break; // CMP_S
1477      case 0x03: size = arcompact_handle0e_03_dasm(DASM_PARAMS); break; // MOV_S
1478   }
1479   return size;
1480}
1481
1482
1483
1484
1485#define GROUP_0e_GET_h \
1486   h =  ((op & 0x0007) << 3); \
1487    h |= ((op & 0x00e0) >> 5); \
1488
1489// this is as messed up as the rest of the 16-bit alignment in LE mode...
1490
1491#define GET_LIMM \
1492   limm = oprom[4] | (oprom[5] << 8); \
1493   limm |= (oprom[2] << 16) | (oprom[3] << 24); \
1494
1495
1496int arcompact_handle0e_00_dasm(DASM_OPS_16)
1497{
1498   int h;
1499   int size = 2;
1500
1501   GROUP_0e_GET_h;
1502
1503   if (h == LIMM_REG)
1504   {
1505      UINT32 limm;
1506      GET_LIMM;
1507      size = 6;
1508      print("ADD_S b <- b + (%08x) (%04x)", limm, op);
1509   }
1510   else
1511   {
1512
1513      print("ADD_S b <- b + (r%d) (%04x)", h, op);
1514   }
1515
1516   return size;
1517}
1518
1519int arcompact_handle0e_01_dasm(DASM_OPS_16)
1520{
1521   int h;
1522   int size = 2;
1523   GROUP_0e_GET_h;
1524
1525   if (h == LIMM_REG)
1526   {
1527      UINT32 limm;
1528      GET_LIMM;
1529      size = 6;
1530      print("MOV_S b <- (%08x)  (%04x)", limm, op);
1531   }
1532   else
1533   {
1534      print("MOV_S b <- (r%d)  (%04x)", h, op);
1535   }
1536   return size;
1537}
1538
1539int arcompact_handle0e_02_dasm(DASM_OPS_16)
1540{
1541   int h;
1542   int size = 2;
1543   GROUP_0e_GET_h;
1544
1545   if (h == LIMM_REG)
1546   {
1547      UINT32 limm;
1548      GET_LIMM;
1549      size = 6;
1550      print("CMP_S b - (%08x) (%04x)", limm, op);
1551   }
1552   else
1553   {
1554      print("CMP_S b - (r%d) (%04x)", h, op);
1555   }
1556   return size;
1557}
1558
1559int arcompact_handle0e_03_dasm(DASM_OPS_16)
1560{
1561   int h;
1562   int size = 2;
1563   GROUP_0e_GET_h;
1564
1565   if (h == LIMM_REG)
1566   {
1567      UINT32 limm;
1568      GET_LIMM;
1569      size = 6;
1570      print("MOV_S (%08x) <- b (%04x)", limm, op);
1571   }
1572   else
1573   {
1574      print("MOV_S (r%d) <- b (%04x)", h, op);
1575   }
1576
1577   return size;
1578}
1579
1580
1581
1582int arcompact_handle0f_dasm(DASM_OPS_16)
1583{
1584   // General Register Instructions (16-bit)
1585   // 01111 bbb ccc iiiii
1586   UINT8 subinstr = (op & 0x01f) >> 0;
1587   //print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
1588     
1589   switch (subinstr)
1590   {
1591   
1592      default:
1593         print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
1594         break;
1595
1596      case 0x00:
1597      {
1598         // General Operations w/ Register
1599         // 01111 bbb iii 00000
1600         UINT8 subinstr2 = (op & 0x00e0) >> 5;
1601
1602         switch (subinstr2)
1603         {
1604            default:
1605               print("%s (%04x)", table0f_00[subinstr2], op & ~0xf8ff);
1606               return 2;
1607
1608            case 0x7:
1609            {
1610               // General Operations w/o Register
1611               // 01111 iii 111 00000
1612               UINT8 subinstr3 = (op & 0x0700) >> 8;
1613
1614               print("%s (%04x)", table0f_00_07[subinstr3], op & ~0xffff);
1615
1616               return 2;
1617            }
1618         }
1619      }
1620   }
1621   
1622   return 2;
1623}
1624
1625int arcompact_handle10_dasm(DASM_OPS_16)
1626{
1627   print("LD_S (%04x)",  op);
1628   return 2;
1629}
1630
1631int arcompact_handle11_dasm(DASM_OPS_16)
1632{
1633   print("LDB_S (%04x)", op);
1634   return 2;
1635}
1636
1637int arcompact_handle12_dasm(DASM_OPS_16)
1638{
1639   print("LDW_S (%04x)", op);
1640   return 2;
1641}
1642
1643int arcompact_handle13_dasm(DASM_OPS_16)
1644{
1645   print("LSW_S.X (%04x)", op);
1646   return 2;
1647}
1648
1649int arcompact_handle14_dasm(DASM_OPS_16)
1650{
1651   print("ST_S (%04x)", op);
1652   return 2;
1653}
1654
1655int arcompact_handle15_dasm(DASM_OPS_16)
1656{
1657   print("STB_S (%04x)", op);
1658   return 2;
1659}
1660
1661int arcompact_handle16_dasm(DASM_OPS_16)
1662{
1663   print("STW_S (%04x)",  op);
1664   return 2;
1665}
1666
1667int arcompact_handle17_dasm(DASM_OPS_16)
1668{
1669   int size = 2;
1670   UINT8 subinstr = (op & 0x00e0) >> 5;
1671   op &= ~0x00e0;
1672
1673   switch (subinstr)
1674   {
1675      case 0x00: size = arcompact_handle17_00_dasm(DASM_PARAMS); break; // ASL_S
1676      case 0x01: size = arcompact_handle17_01_dasm(DASM_PARAMS); break; // LSR_S
1677      case 0x02: size = arcompact_handle17_02_dasm(DASM_PARAMS); break; // ASR_S
1678      case 0x03: size = arcompact_handle17_03_dasm(DASM_PARAMS); break; // SUB_S
1679      case 0x04: size = arcompact_handle17_04_dasm(DASM_PARAMS); break; // BSET_S
1680      case 0x05: size = arcompact_handle17_05_dasm(DASM_PARAMS); break; // BCLR_S
1681      case 0x06: size = arcompact_handle17_06_dasm(DASM_PARAMS); break; // BMSK_S
1682      case 0x07: size = arcompact_handle17_07_dasm(DASM_PARAMS); break; // BTST_S
1683   }
1684
1685   return size;
1686}
1687
1688int arcompact_handle17_00_dasm(DASM_OPS_16)
1689{
1690   int size = 2;
1691   print("ASL_S b <- b asl u5 (%04x)",  op);
1692   return size;
1693}
1694
1695int arcompact_handle17_01_dasm(DASM_OPS_16)
1696{
1697   int size = 2;
1698   print("LSR_S b <- b lsr u5 (%04x)",  op);
1699   return size;
1700}
1701
1702int arcompact_handle17_02_dasm(DASM_OPS_16)
1703{
1704   int size = 2;
1705   print("ASR_S b <- b asr u5 (%04x)",  op);
1706   return size;
1707}
1708
1709int arcompact_handle17_03_dasm(DASM_OPS_16)
1710{
1711   int size = 2;
1712   print("SUB_S b <- b - u5 (%04x)",  op);
1713   return size;
1714}
1715
1716int arcompact_handle17_04_dasm(DASM_OPS_16)
1717{
1718   int size = 2;
1719   print("BSET_S b <- b | (1 << u5) (%04x)",  op);
1720   return size;
1721}
1722
1723int arcompact_handle17_05_dasm(DASM_OPS_16)
1724{
1725   int size = 2;
1726   print("BCLR_S b <- b & !(1 << u5) (%04x)",  op);
1727   return size;
1728}
1729
1730int arcompact_handle17_06_dasm(DASM_OPS_16)
1731{
1732   int size = 2;
1733   print("BMSK_S (%04x)",  op);
1734   return size;
1735}
1736
1737int arcompact_handle17_07_dasm(DASM_OPS_16)
1738{
1739   int size = 2;
1740   print("BTST_S (%04x)",  op);
1741   return size;
1742}
1743
1744int arcompact_handle18_dasm(DASM_OPS_16)
1745{
1746   int size = 2;
1747   // Stack Pointer Based Instructions (16-bit)
1748   // 11000 bbb iii uuuuu
1749   UINT8 subinstr = (op & 0x00e0) >> 5;
1750   op &= ~0x00e0;
1751
1752   switch (subinstr)
1753   {
1754      case 0x00: size = arcompact_handle18_00_dasm(DASM_PARAMS); break; // LD_S (SP)
1755      case 0x01: size = arcompact_handle18_01_dasm(DASM_PARAMS); break; // LDB_S (SP)
1756      case 0x02: size = arcompact_handle18_02_dasm(DASM_PARAMS); break; // ST_S (SP)
1757      case 0x03: size = arcompact_handle18_03_dasm(DASM_PARAMS); break; // STB_S (SP)
1758      case 0x04: size = arcompact_handle18_04_dasm(DASM_PARAMS); break; // ADD_S (SP)
1759      case 0x05: size = arcompact_handle18_05_dasm(DASM_PARAMS); break; // subtable 18_05
1760      case 0x06: size = arcompact_handle18_06_dasm(DASM_PARAMS); break; // subtable 18_06
1761      case 0x07: size = arcompact_handle18_07_dasm(DASM_PARAMS); break; // subtable 18_07
1762   }
1763
1764   return size;
1765}
1766
1767// op bits remaining for 0x18_xx subgroups 0x071f
1768
1769int arcompact_handle18_00_dasm(DASM_OPS_16)
1770{
1771   print("LD_S (SP) (%04x)",  op);
1772   return 2;
1773}
1774
1775int arcompact_handle18_01_dasm(DASM_OPS_16)
1776{
1777   print("LDB_S (SP) (%04x)",  op);
1778   return 2;
1779}
1780
1781int arcompact_handle18_02_dasm(DASM_OPS_16)
1782{
1783   print("ST_S (SP) (%04x)",  op);
1784   return 2;
1785}
1786
1787int arcompact_handle18_03_dasm(DASM_OPS_16)
1788{
1789   print("STB_S (SP) (%04x)",  op);
1790   return 2;
1791}
1792
1793int arcompact_handle18_04_dasm(DASM_OPS_16)
1794{
1795   print("ADD_S (SP) (%04x)",  op);
1796   return 2;
1797}
1798
1799
1800
1801
1802
1803int arcompact_handle18_05_dasm(DASM_OPS_16)
1804{
1805   int size = 2;
1806   UINT8 subinstr2 = (op & 0x0700) >> 8;
1807   op &= ~0x001f;
1808
1809   switch (subinstr2)
1810   {
1811      case 0x00: size = arcompact_handle18_05_00_dasm(DASM_PARAMS); break; // ADD_S (SP)
1812      case 0x01: size = arcompact_handle18_05_01_dasm(DASM_PARAMS); break; // SUB_S (SP)
1813      case 0x02: size = arcompact_handle18_05_02_dasm(DASM_PARAMS); break; // <illegal 0x18_05_02>
1814      case 0x03: size = arcompact_handle18_05_03_dasm(DASM_PARAMS); break; // <illegal 0x18_05_03>
1815      case 0x04: size = arcompact_handle18_05_04_dasm(DASM_PARAMS); break; // <illegal 0x18_05_04>
1816      case 0x05: size = arcompact_handle18_05_05_dasm(DASM_PARAMS); break; // <illegal 0x18_05_05>
1817      case 0x06: size = arcompact_handle18_05_06_dasm(DASM_PARAMS); break; // <illegal 0x18_05_06>
1818      case 0x07: size = arcompact_handle18_05_07_dasm(DASM_PARAMS); break; // <illegal 0x18_05_07>
1819   }
1820
1821   return size;
1822}
1823// op bits remaining for 0x18_05_xx subgroups 0x001f
1824int arcompact_handle18_05_00_dasm(DASM_OPS_16)
1825{
1826   int u = op & 0x001f;
1827   op &= ~0x001f; // all bits now used
1828
1829   print("ADD_S %02x (SP)", u);
1830   return 2;
1831
1832}
1833
1834int arcompact_handle18_05_01_dasm(DASM_OPS_16)
1835{
1836   int u = op & 0x001f;
1837   op &= ~0x001f; // all bits now used
1838
1839   print("SUB_S %02x (SP)", u);
1840   return 2;
1841}
1842
1843
1844int arcompact_handle18_05_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_02> (%04x)", op); return 2;}
1845int arcompact_handle18_05_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_03> (%04x)", op); return 2;}
1846int arcompact_handle18_05_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_04> (%04x)", op); return 2;}
1847int arcompact_handle18_05_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_05> (%04x)", op); return 2;}
1848int arcompact_handle18_05_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_06> (%04x)", op); return 2;}
1849int arcompact_handle18_05_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_07> (%04x)", op); return 2;}
1850
1851
1852int arcompact_handle18_06_dasm(DASM_OPS_16)
1853{
1854   int size = 2;
1855   UINT8 subinstr2 = (op & 0x001f) >> 0;
1856   op &= ~0x001f;
1857
1858   switch (subinstr2)
1859   {
1860      case 0x00: size = arcompact_handle18_06_00_dasm(DASM_PARAMS); break; // <illegal 0x18_06_00>
1861      case 0x01: size = arcompact_handle18_06_01_dasm(DASM_PARAMS); break; // POP_S b
1862      case 0x02: size = arcompact_handle18_06_02_dasm(DASM_PARAMS); break; // <illegal 0x18_06_02>
1863      case 0x03: size = arcompact_handle18_06_03_dasm(DASM_PARAMS); break; // <illegal 0x18_06_03>
1864      case 0x04: size = arcompact_handle18_06_04_dasm(DASM_PARAMS); break; // <illegal 0x18_06_04>
1865      case 0x05: size = arcompact_handle18_06_05_dasm(DASM_PARAMS); break; // <illegal 0x18_06_05>
1866      case 0x06: size = arcompact_handle18_06_06_dasm(DASM_PARAMS); break; // <illegal 0x18_06_06>
1867      case 0x07: size = arcompact_handle18_06_07_dasm(DASM_PARAMS); break; // <illegal 0x18_06_07>
1868      case 0x08: size = arcompact_handle18_06_08_dasm(DASM_PARAMS); break; // <illegal 0x18_06_08>
1869      case 0x09: size = arcompact_handle18_06_09_dasm(DASM_PARAMS); break; // <illegal 0x18_06_09>
1870      case 0x0a: size = arcompact_handle18_06_0a_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0a>
1871      case 0x0b: size = arcompact_handle18_06_0b_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0b>
1872      case 0x0c: size = arcompact_handle18_06_0c_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0c>
1873      case 0x0d: size = arcompact_handle18_06_0d_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0d>
1874      case 0x0e: size = arcompact_handle18_06_0e_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0e>
1875      case 0x0f: size = arcompact_handle18_06_0f_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0f>
1876      case 0x10: size = arcompact_handle18_06_10_dasm(DASM_PARAMS); break; // <illegal 0x18_06_10>
1877      case 0x11: size = arcompact_handle18_06_11_dasm(DASM_PARAMS); break; // POP_S blink
1878      case 0x12: size = arcompact_handle18_06_12_dasm(DASM_PARAMS); break; // <illegal 0x18_06_12>
1879      case 0x13: size = arcompact_handle18_06_13_dasm(DASM_PARAMS); break; // <illegal 0x18_06_13>
1880      case 0x14: size = arcompact_handle18_06_14_dasm(DASM_PARAMS); break; // <illegal 0x18_06_14>
1881      case 0x15: size = arcompact_handle18_06_15_dasm(DASM_PARAMS); break; // <illegal 0x18_06_15>
1882      case 0x16: size = arcompact_handle18_06_16_dasm(DASM_PARAMS); break; // <illegal 0x18_06_16>
1883      case 0x17: size = arcompact_handle18_06_17_dasm(DASM_PARAMS); break; // <illegal 0x18_06_17>
1884      case 0x18: size = arcompact_handle18_06_18_dasm(DASM_PARAMS); break; // <illegal 0x18_06_18>
1885      case 0x19: size = arcompact_handle18_06_19_dasm(DASM_PARAMS); break; // <illegal 0x18_06_19>
1886      case 0x1a: size = arcompact_handle18_06_1a_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1a>
1887      case 0x1b: size = arcompact_handle18_06_1b_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1b>
1888      case 0x1c: size = arcompact_handle18_06_1c_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1c>
1889      case 0x1d: size = arcompact_handle18_06_1d_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1d>
1890      case 0x1e: size = arcompact_handle18_06_1e_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1e>
1891      case 0x1f: size = arcompact_handle18_06_1f_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1f>
1892   }
1893
1894   return size;
1895}
1896
1897
1898// op bits remaining for 0x18_06_xx subgroups 0x0700
1899int arcompact_handle18_06_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_00> (%04x)",  op); return 2;}
1900
1901int arcompact_handle18_06_01_dasm(DASM_OPS_16)
1902{
1903   int b = (op & 0x0700) >> 8;
1904   op &= ~0x0700; // all bits now used
1905
1906   print("POP_S [%02x]", b);
1907
1908   return 2;
1909}
1910
1911int arcompact_handle18_06_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_02> (%04x)", op); return 2;}
1912int arcompact_handle18_06_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_03> (%04x)", op); return 2;}
1913int arcompact_handle18_06_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_04> (%04x)", op); return 2;}
1914int arcompact_handle18_06_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_05> (%04x)", op); return 2;}
1915int arcompact_handle18_06_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_06> (%04x)", op); return 2;}
1916int arcompact_handle18_06_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_07> (%04x)", op); return 2;}
1917int arcompact_handle18_06_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_08> (%04x)", op); return 2;}
1918int arcompact_handle18_06_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_09> (%04x)", op); return 2;}
1919int arcompact_handle18_06_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0a> (%04x)", op); return 2;}
1920int arcompact_handle18_06_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0b> (%04x)", op); return 2;}
1921int arcompact_handle18_06_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0c> (%04x)", op); return 2;}
1922int arcompact_handle18_06_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0d> (%04x)", op); return 2;}
1923int arcompact_handle18_06_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0e> (%04x)", op); return 2;}
1924int arcompact_handle18_06_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0f> (%04x)", op); return 2;}
1925int arcompact_handle18_06_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_10> (%04x)", op); return 2;}
1926
1927int arcompact_handle18_06_11_dasm(DASM_OPS_16)
1928{
1929   int res = (op & 0x0700) >> 8;
1930   op &= ~0x0700; // all bits now used
1931
1932   if (res)
1933      print("POP_S [BLINK] (Reserved Bits set %04x)", op);
1934   else
1935      print("POP_S [BLINK]");
1936
1937   return 2;
1938}
1939
1940int arcompact_handle18_06_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_12> (%04x)",  op); return 2;}
1941int arcompact_handle18_06_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_13> (%04x)",  op); return 2;}
1942int arcompact_handle18_06_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_14> (%04x)",  op); return 2;}
1943int arcompact_handle18_06_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_15> (%04x)",  op); return 2;}
1944int arcompact_handle18_06_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_16> (%04x)",  op); return 2;}
1945int arcompact_handle18_06_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_17> (%04x)",  op); return 2;}
1946int arcompact_handle18_06_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_18> (%04x)",  op); return 2;}
1947int arcompact_handle18_06_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_19> (%04x)",  op); return 2;}
1948int arcompact_handle18_06_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1a> (%04x)",  op); return 2;}
1949int arcompact_handle18_06_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1b> (%04x)",  op); return 2;}
1950int arcompact_handle18_06_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1c> (%04x)",  op); return 2;}
1951int arcompact_handle18_06_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1d> (%04x)",  op); return 2;}
1952int arcompact_handle18_06_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1e> (%04x)",  op); return 2;}
1953int arcompact_handle18_06_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1f> (%04x)",  op); return 2;}
1954
1955
1956
1957
1958int arcompact_handle18_07_dasm(DASM_OPS_16)
1959{
1960   int size = 2;
1961   UINT8 subinstr2 = (op & 0x001f) >> 0;
1962   op &= ~0x001f;
1963
1964   switch (subinstr2)
1965   {
1966      case 0x00: size = arcompact_handle18_07_00_dasm(DASM_PARAMS); break; // <illegal 0x18_07_00>
1967      case 0x01: size = arcompact_handle18_07_01_dasm(DASM_PARAMS); break; // PUSH_S b
1968      case 0x02: size = arcompact_handle18_07_02_dasm(DASM_PARAMS); break; // <illegal 0x18_07_02>
1969      case 0x03: size = arcompact_handle18_07_03_dasm(DASM_PARAMS); break; // <illegal 0x18_07_03>
1970      case 0x04: size = arcompact_handle18_07_04_dasm(DASM_PARAMS); break; // <illegal 0x18_07_04>
1971      case 0x05: size = arcompact_handle18_07_05_dasm(DASM_PARAMS); break; // <illegal 0x18_07_05>
1972      case 0x06: size = arcompact_handle18_07_06_dasm(DASM_PARAMS); break; // <illegal 0x18_07_06>
1973      case 0x07: size = arcompact_handle18_07_07_dasm(DASM_PARAMS); break; // <illegal 0x18_07_07>
1974      case 0x08: size = arcompact_handle18_07_08_dasm(DASM_PARAMS); break; // <illegal 0x18_07_08>
1975      case 0x09: size = arcompact_handle18_07_09_dasm(DASM_PARAMS); break; // <illegal 0x18_07_09>
1976      case 0x0a: size = arcompact_handle18_07_0a_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0a>
1977      case 0x0b: size = arcompact_handle18_07_0b_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0b>
1978      case 0x0c: size = arcompact_handle18_07_0c_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0c>
1979      case 0x0d: size = arcompact_handle18_07_0d_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0d>
1980      case 0x0e: size = arcompact_handle18_07_0e_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0e>
1981      case 0x0f: size = arcompact_handle18_07_0f_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0f>
1982      case 0x10: size = arcompact_handle18_07_10_dasm(DASM_PARAMS); break; // <illegal 0x18_07_10>
1983      case 0x11: size = arcompact_handle18_07_11_dasm(DASM_PARAMS); break; // PUSH_S blink
1984      case 0x12: size = arcompact_handle18_07_12_dasm(DASM_PARAMS); break; // <illegal 0x18_07_12>
1985      case 0x13: size = arcompact_handle18_07_13_dasm(DASM_PARAMS); break; // <illegal 0x18_07_13>
1986      case 0x14: size = arcompact_handle18_07_14_dasm(DASM_PARAMS); break; // <illegal 0x18_07_14>
1987      case 0x15: size = arcompact_handle18_07_15_dasm(DASM_PARAMS); break; // <illegal 0x18_07_15>
1988      case 0x16: size = arcompact_handle18_07_16_dasm(DASM_PARAMS); break; // <illegal 0x18_07_16>
1989      case 0x17: size = arcompact_handle18_07_17_dasm(DASM_PARAMS); break; // <illegal 0x18_07_17>
1990      case 0x18: size = arcompact_handle18_07_18_dasm(DASM_PARAMS); break; // <illegal 0x18_07_18>
1991      case 0x19: size = arcompact_handle18_07_19_dasm(DASM_PARAMS); break; // <illegal 0x18_07_19>
1992      case 0x1a: size = arcompact_handle18_07_1a_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1a>
1993      case 0x1b: size = arcompact_handle18_07_1b_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1b>
1994      case 0x1c: size = arcompact_handle18_07_1c_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1c>
1995      case 0x1d: size = arcompact_handle18_07_1d_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1d>
1996      case 0x1e: size = arcompact_handle18_07_1e_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1e>
1997      case 0x1f: size = arcompact_handle18_07_1f_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1f>
1998   }
1999
2000   return size;
2001}
2002
2003
2004// op bits remaining for 0x18_07_xx subgroups 0x0700
2005int arcompact_handle18_07_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_00> (%04x)",  op); return 2;}
2006
2007int arcompact_handle18_07_01_dasm(DASM_OPS_16)
2008{
2009   int b = (op & 0x0700) >> 8;
2010   op &= ~0x0700; // all bits now used
2011
2012   print("PUSH_S [%02x]", b);
2013
2014   return 2;
2015}
2016
2017int arcompact_handle18_07_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_02> (%04x)", op); return 2;}
2018int arcompact_handle18_07_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_03> (%04x)", op); return 2;}
2019int arcompact_handle18_07_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_04> (%04x)", op); return 2;}
2020int arcompact_handle18_07_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_05> (%04x)", op); return 2;}
2021int arcompact_handle18_07_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_06> (%04x)", op); return 2;}
2022int arcompact_handle18_07_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_07> (%04x)", op); return 2;}
2023int arcompact_handle18_07_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_08> (%04x)", op); return 2;}
2024int arcompact_handle18_07_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_09> (%04x)", op); return 2;}
2025int arcompact_handle18_07_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0a> (%04x)", op); return 2;}
2026int arcompact_handle18_07_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0b> (%04x)", op); return 2;}
2027int arcompact_handle18_07_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0c> (%04x)", op); return 2;}
2028int arcompact_handle18_07_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0d> (%04x)", op); return 2;}
2029int arcompact_handle18_07_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0e> (%04x)", op); return 2;}
2030int arcompact_handle18_07_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0f> (%04x)", op); return 2;}
2031int arcompact_handle18_07_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_10> (%04x)", op); return 2;}
2032
2033int arcompact_handle18_07_11_dasm(DASM_OPS_16)
2034{
2035   int res = (op & 0x0700) >> 8;
2036   op &= ~0x0700; // all bits now used
2037
2038   if (res)
2039      print("PUSH_S [BLINK] (Reserved Bits set %04x)", op);
2040   else
2041      print("PUSH_S [BLINK]");
2042
2043   return 2;
2044}
2045
2046int arcompact_handle18_07_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_12> (%04x)",  op); return 2;}
2047int arcompact_handle18_07_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_13> (%04x)",  op); return 2;}
2048int arcompact_handle18_07_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_14> (%04x)",  op); return 2;}
2049int arcompact_handle18_07_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_15> (%04x)",  op); return 2;}
2050int arcompact_handle18_07_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_16> (%04x)",  op); return 2;}
2051int arcompact_handle18_07_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_17> (%04x)",  op); return 2;}
2052int arcompact_handle18_07_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_18> (%04x)",  op); return 2;}
2053int arcompact_handle18_07_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_19> (%04x)",  op); return 2;}
2054int arcompact_handle18_07_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1a> (%04x)",  op); return 2;}
2055int arcompact_handle18_07_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1b> (%04x)",  op); return 2;}
2056int arcompact_handle18_07_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1c> (%04x)",  op); return 2;}
2057int arcompact_handle18_07_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1d> (%04x)",  op); return 2;}
2058int arcompact_handle18_07_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1e> (%04x)",  op); return 2;}
2059int arcompact_handle18_07_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1f> (%04x)",  op); return 2;}
2060
2061
2062int arcompact_handle19_dasm(DASM_OPS_16)
2063{
2064   int size = 2;
2065   UINT8 subinstr = (op & 0x0600) >> 9;
2066   op &= ~0x0600;
2067
2068   switch (subinstr)
2069   {
2070      case 0x00: size = arcompact_handle19_00_dasm(DASM_PARAMS); break; // LD_S (GP)
2071      case 0x01: size = arcompact_handle19_01_dasm(DASM_PARAMS); break; // LDB_S (GP)
2072      case 0x02: size = arcompact_handle19_02_dasm(DASM_PARAMS); break; // LDW_S (GP)
2073      case 0x03: size = arcompact_handle19_03_dasm(DASM_PARAMS); break; // ADD_S (GP)
2074   }
2075   return size;
2076}
2077
2078int arcompact_handle19_00_dasm(DASM_OPS_16)  { print("LD_S r0 <- m[GP + s11].long (%04x)",  op); return 2;}
2079int arcompact_handle19_01_dasm(DASM_OPS_16)  { print("LDB_S r0 <- m[GP + s9].byte (%04x)",  op); return 2;}
2080int arcompact_handle19_02_dasm(DASM_OPS_16)  { print("LDW_S r0 <- m[GP + s10].word (%04x)",  op); return 2;}
2081int arcompact_handle19_03_dasm(DASM_OPS_16)  { print("ADD_S r0 <- GP + s11 (%04x)",  op); return 2;}
2082
2083
2084
2085int arcompact_handle1a_dasm(DASM_OPS_16)
2086{
2087   print("PCL Instr (%04x)", op);
2088   return 2;
2089}
2090
2091int arcompact_handle1b_dasm(DASM_OPS_16)
2092{
2093   print("MOV_S (%04x)", op);
2094   return 2;
2095}
2096
2097int arcompact_handle1c_dasm(DASM_OPS_16)
2098{
2099   int size = 2;
2100   UINT8 subinstr = (op & 0x0080) >> 7;
2101   op &= ~0x0080;
2102
2103   switch (subinstr)
2104   {
2105      case 0x00: size = arcompact_handle1c_00_dasm(DASM_PARAMS); break; // ADD_S
2106      case 0x01: size = arcompact_handle1c_01_dasm(DASM_PARAMS); break; // CMP_S
2107   }
2108   return size;
2109}
2110
2111int arcompact_handle1c_00_dasm(DASM_OPS_16)  { print("ADD_S b <- b + u7 (%04x)",  op); return 2;}
2112int arcompact_handle1c_01_dasm(DASM_OPS_16)  { print("CMP_S b - u7 (%04x)",  op); return 2;}
2113
2114
2115int arcompact_handle1d_dasm(DASM_OPS_16)
2116{
2117   int size = 2;
2118   UINT8 subinstr = (op & 0x0080) >> 7;
2119   op &= ~0x0080;
2120
2121   switch (subinstr)
2122   {
2123      case 0x00: size = arcompact_handle1d_00_dasm(DASM_PARAMS); break; // BREQ_S
2124      case 0x01: size = arcompact_handle1d_01_dasm(DASM_PARAMS); break; // BRNE_S
2125   }
2126   return size;
2127}
2128
2129int arcompact_handle1d_00_dasm(DASM_OPS_16)  { print("BREQ_S (%04x)",  op); return 2;}
2130int arcompact_handle1d_01_dasm(DASM_OPS_16)  { print("BRNE_S (%04x)",  op); return 2;}
2131
2132
2133int arcompact_handle1e_dasm(DASM_OPS_16)
2134{
2135   int size = 2;
2136   UINT8 subinstr = (op & 0x0600) >> 9;
2137   op &= ~0x0600;
2138
2139   switch (subinstr)
2140   {
2141      case 0x00: size = arcompact_handle1e_00_dasm(DASM_PARAMS); break; // B_S
2142      case 0x01: size = arcompact_handle1e_01_dasm(DASM_PARAMS); break; // BEQ_S
2143      case 0x02: size = arcompact_handle1e_02_dasm(DASM_PARAMS); break; // BNE_S
2144      case 0x03: size = arcompact_handle1e_03_dasm(DASM_PARAMS); break; // Bcc_S
2145   }
2146   return size;
2147}
2148
2149int arcompact_handle1e_00_dasm(DASM_OPS_16)  { print("B_S (%04x)",  op); return 2;}
2150int arcompact_handle1e_01_dasm(DASM_OPS_16)  { print("BEQ_S (%04x)",  op); return 2;}
2151int arcompact_handle1e_02_dasm(DASM_OPS_16)  { print("BNE_S (%04x)",  op); return 2;}
2152
2153
2154int arcompact_handle1e_03_dasm(DASM_OPS_16)
2155{
2156   
2157   int size = 2;
2158   UINT8 subinstr2 = (op & 0x01c0) >> 6;
2159   op &= ~0x01c0;
2160
2161   switch (subinstr2)
2162   {
2163      case 0x00: size = arcompact_handle1e_03_00_dasm(DASM_PARAMS); break; // BGT_S
2164      case 0x01: size = arcompact_handle1e_03_01_dasm(DASM_PARAMS); break; // BGE_S
2165      case 0x02: size = arcompact_handle1e_03_02_dasm(DASM_PARAMS); break; // BLT_S
2166      case 0x03: size = arcompact_handle1e_03_03_dasm(DASM_PARAMS); break; // BLE_S
2167      case 0x04: size = arcompact_handle1e_03_04_dasm(DASM_PARAMS); break; // BHI_S
2168      case 0x05: size = arcompact_handle1e_03_05_dasm(DASM_PARAMS); break; // BHS_S
2169      case 0x06: size = arcompact_handle1e_03_06_dasm(DASM_PARAMS); break; // BLO_S
2170      case 0x07: size = arcompact_handle1e_03_07_dasm(DASM_PARAMS); break; // BLS_S
2171   }
2172   return size;
2173
2174}
2175
2176int arcompact_handle1e_03_00_dasm(DASM_OPS_16)  { print("BGT_S (%04x)",  op); return 2;}
2177int arcompact_handle1e_03_01_dasm(DASM_OPS_16)  { print("BGE_S (%04x)",  op); return 2;}
2178int arcompact_handle1e_03_02_dasm(DASM_OPS_16)  { print("BLT_S (%04x)",  op); return 2;}
2179int arcompact_handle1e_03_03_dasm(DASM_OPS_16)  { print("BLE_S (%04x)",  op); return 2;}
2180int arcompact_handle1e_03_04_dasm(DASM_OPS_16)  { print("BHI_S (%04x)",  op); return 2;}
2181int arcompact_handle1e_03_05_dasm(DASM_OPS_16)  { print("BHS_S (%04x)",  op); return 2;}
2182int arcompact_handle1e_03_06_dasm(DASM_OPS_16)  { print("BLO_S (%04x)",  op); return 2;}
2183int arcompact_handle1e_03_07_dasm(DASM_OPS_16)  { print("BLS_S (%04x)",  op); return 2;}
2184
2185
2186
2187int arcompact_handle1f_dasm(DASM_OPS_16)
2188{
2189   print("BL_S (%04x)", op);
2190   return 2;
2191}
2192
219325CPU_DISASSEMBLE(arcompact)
219426{
219527   int size = 2;
trunk/src/emu/cpu/arcompact/arcompactdasm_dispatch.c
r0r242320
1/*********************************\
2
3 ARCompact disassembler
4
5\*********************************/
6
7#include "emu.h"
8#include <stdarg.h>
9
10#include "arcompactdasm_dispatch.h"
11#include "arcompactdasm_ops.h"
12
13int arcompact_handle00_dasm(DASM_OPS_32)
14{
15   int size = 4;
16   UINT8 subinstr = (op & 0x00010000) >> 16;
17   op &= ~0x00010000;
18
19   switch (subinstr)
20   {
21      case 0x00: size = arcompact_handle00_00_dasm(DASM_PARAMS); break; // Branch Conditionally
22      case 0x01: size = arcompact_handle00_01_dasm(DASM_PARAMS); break; // Branch Unconditionally Far
23   }
24
25   return size;
26}
27
28int arcompact_handle01_dasm(DASM_OPS_32)
29{
30   int size = 4;
31   UINT8 subinstr = (op & 0x00010000) >> 16;
32   op &= ~0x00010000;
33
34   switch (subinstr)
35   {
36      case 0x00: size = arcompact_handle01_00_dasm(DASM_PARAMS); break; // Branh & Link
37      case 0x01: size = arcompact_handle01_01_dasm(DASM_PARAMS); break; // Branch on Compare
38   }
39
40   return size;
41}
42
43int arcompact_handle01_00_dasm(DASM_OPS_32)
44{
45   int size = 4;
46   UINT8 subinstr2 = (op & 0x00020000) >> 17;
47   op &= ~0x00020000;
48
49   switch (subinstr2)
50   {
51      case 0x00: size = arcompact_handle01_00_00dasm(DASM_PARAMS); break; // Branch and Link Conditionally
52      case 0x01: size = arcompact_handle01_00_01dasm(DASM_PARAMS); break; // Branch and Link Unconditional Far
53   }
54
55   return size;
56}
57
58int arcompact_handle01_01_dasm(DASM_OPS_32)
59{
60   int size = 4;
61
62   UINT8 subinstr2 = (op & 0x00000010) >> 4;
63   op &= ~0x00000010;
64
65   switch (subinstr2)
66   {
67      case 0x00: size = arcompact_handle01_01_00_dasm(DASM_PARAMS); break; // Branch on Compare Register-Register
68      case 0x01: size = arcompact_handle01_01_01_dasm(DASM_PARAMS); break; // Branch on Compare/Bit Test Register-Immediate
69   }
70
71   return size;
72}
73
74int arcompact_handle01_01_00_dasm(DASM_OPS_32)
75{
76   int size = 4;
77   UINT8 subinstr3 = (op & 0x0000000f) >> 0;
78   op &= ~0x0000000f;
79
80   switch (subinstr3)
81   {
82      case 0x00: size = arcompact_handle01_01_00_00_dasm(DASM_PARAMS); break; // BREQ (reg-reg)
83      case 0x01: size = arcompact_handle01_01_00_01_dasm(DASM_PARAMS); break; // BRNE (reg-reg)
84      case 0x02: size = arcompact_handle01_01_00_02_dasm(DASM_PARAMS); break; // BRLT (reg-reg)
85      case 0x03: size = arcompact_handle01_01_00_03_dasm(DASM_PARAMS); break; // BRGE (reg-reg)
86      case 0x04: size = arcompact_handle01_01_00_04_dasm(DASM_PARAMS); break; // BRLO (reg-reg)
87      case 0x05: size = arcompact_handle01_01_00_05_dasm(DASM_PARAMS); break; // BRHS (reg-reg)
88      case 0x06: size = arcompact_handle01_01_00_06_dasm(DASM_PARAMS); break; // reserved
89      case 0x07: size = arcompact_handle01_01_00_07_dasm(DASM_PARAMS); break; // reserved
90      case 0x08: size = arcompact_handle01_01_00_08_dasm(DASM_PARAMS); break; // reserved
91      case 0x09: size = arcompact_handle01_01_00_09_dasm(DASM_PARAMS); break; // reserved
92      case 0x0a: size = arcompact_handle01_01_00_0a_dasm(DASM_PARAMS); break; // reserved
93      case 0x0b: size = arcompact_handle01_01_00_0b_dasm(DASM_PARAMS); break; // reserved
94      case 0x0c: size = arcompact_handle01_01_00_0c_dasm(DASM_PARAMS); break; // reserved
95      case 0x0d: size = arcompact_handle01_01_00_0d_dasm(DASM_PARAMS); break; // reserved
96      case 0x0e: size = arcompact_handle01_01_00_0e_dasm(DASM_PARAMS); break; // BBIT0 (reg-reg)
97      case 0x0f: size = arcompact_handle01_01_00_0f_dasm(DASM_PARAMS); break; // BBIT1 (reg-reg)
98   }
99
100   return size;
101}
102
103int arcompact_handle01_01_01_dasm(DASM_OPS_32) //  Branch on Compare/Bit Test Register-Immediate
104{
105   int size = 4;
106   UINT8 subinstr3 = (op & 0x0000000f) >> 0;
107   op &= ~0x0000000f;
108
109   switch (subinstr3)
110   {
111      case 0x00: size = arcompact_handle01_01_01_00_dasm(DASM_PARAMS); break; // BREQ (reg-imm)
112      case 0x01: size = arcompact_handle01_01_01_01_dasm(DASM_PARAMS); break; // BRNE (reg-imm)
113      case 0x02: size = arcompact_handle01_01_01_02_dasm(DASM_PARAMS); break; // BRLT (reg-imm)
114      case 0x03: size = arcompact_handle01_01_01_03_dasm(DASM_PARAMS); break; // BRGE (reg-imm)
115      case 0x04: size = arcompact_handle01_01_01_04_dasm(DASM_PARAMS); break; // BRLO (reg-imm)
116      case 0x05: size = arcompact_handle01_01_01_05_dasm(DASM_PARAMS); break; // BRHS (reg-imm)
117      case 0x06: size = arcompact_handle01_01_01_06_dasm(DASM_PARAMS); break; // reserved
118      case 0x07: size = arcompact_handle01_01_01_07_dasm(DASM_PARAMS); break; // reserved
119      case 0x08: size = arcompact_handle01_01_01_08_dasm(DASM_PARAMS); break; // reserved
120      case 0x09: size = arcompact_handle01_01_01_09_dasm(DASM_PARAMS); break; // reserved
121      case 0x0a: size = arcompact_handle01_01_01_0a_dasm(DASM_PARAMS); break; // reserved
122      case 0x0b: size = arcompact_handle01_01_01_0b_dasm(DASM_PARAMS); break; // reserved
123      case 0x0c: size = arcompact_handle01_01_01_0c_dasm(DASM_PARAMS); break; // reserved
124      case 0x0d: size = arcompact_handle01_01_01_0d_dasm(DASM_PARAMS); break; // reserved
125      case 0x0e: size = arcompact_handle01_01_01_0e_dasm(DASM_PARAMS); break; // BBIT0 (reg-imm)
126      case 0x0f: size = arcompact_handle01_01_01_0f_dasm(DASM_PARAMS); break; // BBIT1 (reg-imm)
127   }
128
129   return size;
130}
131
132int arcompact_handle04_dasm(DASM_OPS_32)
133{
134   int size = 4;
135   // General Operations
136
137   // bitpos
138   // 11111 111 11 111111 0 000 000000 0 00000
139   // fedcb a98 76 543210 f edc ba9876 5 43210
140   //
141   // 00100 bbb 00 iiiiii F BBB CCCCCC A AAAAA   General Operations *UN*Conditional Register to Register
142   // 00100 bbb 01 iiiiii F BBB UUUUUU A AAAAA   General Operations *UN*Conditional Register (Unsigned 6-bit IMM)
143   // 00100 bbb 10 iiiiii F BBB ssssss S SSSSS   General Operations *UN*Conditional Register (Signed 12-bit IMM)
144   
145   // 00100 bbb 11 iiiiii F BBB CCCCCC 0 QQQQQ   General Operations Conditional Register
146   // 00100 bbb 11 iiiiii F BBB UUUUUU 1 QQQQQ   General Operations Conditional Register (Unsigned 6-bit IMM)
147   UINT8 subinstr = (op & 0x003f0000) >> 16;
148   op &= ~0x003f0000;
149
150   switch (subinstr)
151   {
152      case 0x00: size = arcompact_handle04_00_dasm(DASM_PARAMS); break; // ADD
153      case 0x01: size = arcompact_handle04_01_dasm(DASM_PARAMS); break; // ADC
154      case 0x02: size = arcompact_handle04_02_dasm(DASM_PARAMS); break; // SUB
155      case 0x03: size = arcompact_handle04_03_dasm(DASM_PARAMS); break; // SBC
156      case 0x04: size = arcompact_handle04_04_dasm(DASM_PARAMS); break; // AND
157      case 0x05: size = arcompact_handle04_05_dasm(DASM_PARAMS); break; // OR
158      case 0x06: size = arcompact_handle04_06_dasm(DASM_PARAMS); break; // BIC
159      case 0x07: size = arcompact_handle04_07_dasm(DASM_PARAMS); break; // XOR
160      case 0x08: size = arcompact_handle04_08_dasm(DASM_PARAMS); break; // MAX
161      case 0x09: size = arcompact_handle04_09_dasm(DASM_PARAMS); break; // MIN
162      case 0x0a: size = arcompact_handle04_0a_dasm(DASM_PARAMS); break; // MOV
163      case 0x0b: size = arcompact_handle04_0b_dasm(DASM_PARAMS); break; // TST
164      case 0x0c: size = arcompact_handle04_0c_dasm(DASM_PARAMS); break; // CMP
165      case 0x0d: size = arcompact_handle04_0d_dasm(DASM_PARAMS); break; // RCMP
166      case 0x0e: size = arcompact_handle04_0e_dasm(DASM_PARAMS); break; // RSUB
167      case 0x0f: size = arcompact_handle04_0f_dasm(DASM_PARAMS); break; // BSET
168      case 0x10: size = arcompact_handle04_10_dasm(DASM_PARAMS); break; // BCLR
169      case 0x11: size = arcompact_handle04_11_dasm(DASM_PARAMS); break; // BTST
170      case 0x12: size = arcompact_handle04_12_dasm(DASM_PARAMS); break; // BXOR
171      case 0x13: size = arcompact_handle04_13_dasm(DASM_PARAMS); break; // BMSK
172      case 0x14: size = arcompact_handle04_14_dasm(DASM_PARAMS); break; // ADD1
173      case 0x15: size = arcompact_handle04_15_dasm(DASM_PARAMS); break; // ADD2
174      case 0x16: size = arcompact_handle04_16_dasm(DASM_PARAMS); break; // ADD3
175      case 0x17: size = arcompact_handle04_17_dasm(DASM_PARAMS); break; // SUB1
176      case 0x18: size = arcompact_handle04_18_dasm(DASM_PARAMS); break; // SUB2
177      case 0x19: size = arcompact_handle04_19_dasm(DASM_PARAMS); break; // SUB3
178      case 0x1a: size = arcompact_handle04_1a_dasm(DASM_PARAMS); break; // MPY *
179      case 0x1b: size = arcompact_handle04_1b_dasm(DASM_PARAMS); break; // MPYH *
180      case 0x1c: size = arcompact_handle04_1c_dasm(DASM_PARAMS); break; // MPYHU *
181      case 0x1d: size = arcompact_handle04_1d_dasm(DASM_PARAMS); break; // MPYU *
182      case 0x1e: size = arcompact_handle04_1e_dasm(DASM_PARAMS); break; // illegal
183      case 0x1f: size = arcompact_handle04_1f_dasm(DASM_PARAMS); break; // illegal
184      case 0x20: size = arcompact_handle04_20_dasm(DASM_PARAMS); break; // Jcc
185      case 0x21: size = arcompact_handle04_21_dasm(DASM_PARAMS); break; // Jcc.D
186      case 0x22: size = arcompact_handle04_22_dasm(DASM_PARAMS); break; // JLcc
187      case 0x23: size = arcompact_handle04_23_dasm(DASM_PARAMS); break; // JLcc.D
188      case 0x24: size = arcompact_handle04_24_dasm(DASM_PARAMS); break; // illegal
189      case 0x25: size = arcompact_handle04_25_dasm(DASM_PARAMS); break; // illegal
190      case 0x26: size = arcompact_handle04_26_dasm(DASM_PARAMS); break; // illegal
191      case 0x27: size = arcompact_handle04_27_dasm(DASM_PARAMS); break; // illegal
192      case 0x28: size = arcompact_handle04_28_dasm(DASM_PARAMS); break; // LPcc
193      case 0x29: size = arcompact_handle04_29_dasm(DASM_PARAMS); break; // FLAG
194      case 0x2a: size = arcompact_handle04_2a_dasm(DASM_PARAMS); break; // LR
195      case 0x2b: size = arcompact_handle04_2b_dasm(DASM_PARAMS); break; // SR
196      case 0x2c: size = arcompact_handle04_2c_dasm(DASM_PARAMS); break; // illegal
197      case 0x2d: size = arcompact_handle04_2d_dasm(DASM_PARAMS); break; // illegal
198      case 0x2e: size = arcompact_handle04_2e_dasm(DASM_PARAMS); break; // illegal
199      case 0x2f: size = arcompact_handle04_2f_dasm(DASM_PARAMS); break; // Sub Opcode
200      case 0x30: size = arcompact_handle04_30_dasm(DASM_PARAMS); break; // LD r-r
201      case 0x31: size = arcompact_handle04_31_dasm(DASM_PARAMS); break; // LD r-r
202      case 0x32: size = arcompact_handle04_32_dasm(DASM_PARAMS); break; // LD r-r
203      case 0x33: size = arcompact_handle04_33_dasm(DASM_PARAMS); break; // LD r-r
204      case 0x34: size = arcompact_handle04_34_dasm(DASM_PARAMS); break; // LD r-r
205      case 0x35: size = arcompact_handle04_35_dasm(DASM_PARAMS); break; // LD r-r
206      case 0x36: size = arcompact_handle04_36_dasm(DASM_PARAMS); break; // LD r-r
207      case 0x37: size = arcompact_handle04_37_dasm(DASM_PARAMS); break; // LD r-r
208      case 0x38: size = arcompact_handle04_38_dasm(DASM_PARAMS); break; // illegal
209      case 0x39: size = arcompact_handle04_39_dasm(DASM_PARAMS); break; // illegal
210      case 0x3a: size = arcompact_handle04_3a_dasm(DASM_PARAMS); break; // illegal
211      case 0x3b: size = arcompact_handle04_3b_dasm(DASM_PARAMS); break; // illegal
212      case 0x3c: size = arcompact_handle04_3c_dasm(DASM_PARAMS); break; // illegal
213      case 0x3d: size = arcompact_handle04_3d_dasm(DASM_PARAMS); break; // illegal
214      case 0x3e: size = arcompact_handle04_3e_dasm(DASM_PARAMS); break; // illegal
215      case 0x3f: size = arcompact_handle04_3f_dasm(DASM_PARAMS); break; // illegal
216   }
217
218   return size;
219}
220
221int arcompact_handle04_2f_dasm(DASM_OPS_32)
222{
223   int size = 4;
224   UINT8 subinstr2 = (op & 0x0000003f) >> 0;
225   op &= ~0x0000003f;
226
227   switch (subinstr2)
228   {
229      case 0x00: size = arcompact_handle04_2f_00_dasm(DASM_PARAMS); break; // ASL
230      case 0x01: size = arcompact_handle04_2f_01_dasm(DASM_PARAMS); break; // ASR
231      case 0x02: size = arcompact_handle04_2f_02_dasm(DASM_PARAMS); break; // LSR
232      case 0x03: size = arcompact_handle04_2f_03_dasm(DASM_PARAMS); break; // ROR
233      case 0x04: size = arcompact_handle04_2f_04_dasm(DASM_PARAMS); break; // RCC
234      case 0x05: size = arcompact_handle04_2f_05_dasm(DASM_PARAMS); break; // SEXB
235      case 0x06: size = arcompact_handle04_2f_06_dasm(DASM_PARAMS); break; // SEXW
236      case 0x07: size = arcompact_handle04_2f_07_dasm(DASM_PARAMS); break; // EXTB
237      case 0x08: size = arcompact_handle04_2f_08_dasm(DASM_PARAMS); break; // EXTW
238      case 0x09: size = arcompact_handle04_2f_09_dasm(DASM_PARAMS); break; // ABS
239      case 0x0a: size = arcompact_handle04_2f_0a_dasm(DASM_PARAMS); break; // NOT
240      case 0x0b: size = arcompact_handle04_2f_0b_dasm(DASM_PARAMS); break; // RLC
241      case 0x0c: size = arcompact_handle04_2f_0c_dasm(DASM_PARAMS); break; // EX
242      case 0x0d: size = arcompact_handle04_2f_0d_dasm(DASM_PARAMS); break; // illegal
243      case 0x0e: size = arcompact_handle04_2f_0e_dasm(DASM_PARAMS); break; // illegal
244      case 0x0f: size = arcompact_handle04_2f_0f_dasm(DASM_PARAMS); break; // illegal
245      case 0x10: size = arcompact_handle04_2f_10_dasm(DASM_PARAMS); break; // illegal
246      case 0x11: size = arcompact_handle04_2f_11_dasm(DASM_PARAMS); break; // illegal
247      case 0x12: size = arcompact_handle04_2f_12_dasm(DASM_PARAMS); break; // illegal
248      case 0x13: size = arcompact_handle04_2f_13_dasm(DASM_PARAMS); break; // illegal
249      case 0x14: size = arcompact_handle04_2f_14_dasm(DASM_PARAMS); break; // illegal
250      case 0x15: size = arcompact_handle04_2f_15_dasm(DASM_PARAMS); break; // illegal
251      case 0x16: size = arcompact_handle04_2f_16_dasm(DASM_PARAMS); break; // illegal
252      case 0x17: size = arcompact_handle04_2f_17_dasm(DASM_PARAMS); break; // illegal
253      case 0x18: size = arcompact_handle04_2f_18_dasm(DASM_PARAMS); break; // illegal
254      case 0x19: size = arcompact_handle04_2f_19_dasm(DASM_PARAMS); break; // illegal
255      case 0x1a: size = arcompact_handle04_2f_1a_dasm(DASM_PARAMS); break; // illegal
256      case 0x1b: size = arcompact_handle04_2f_1b_dasm(DASM_PARAMS); break; // illegal
257      case 0x1c: size = arcompact_handle04_2f_1c_dasm(DASM_PARAMS); break; // illegal
258      case 0x1d: size = arcompact_handle04_2f_1d_dasm(DASM_PARAMS); break; // illegal
259      case 0x1e: size = arcompact_handle04_2f_1e_dasm(DASM_PARAMS); break; // illegal
260      case 0x1f: size = arcompact_handle04_2f_1f_dasm(DASM_PARAMS); break; // illegal
261      case 0x20: size = arcompact_handle04_2f_20_dasm(DASM_PARAMS); break; // illegal
262      case 0x21: size = arcompact_handle04_2f_21_dasm(DASM_PARAMS); break; // illegal
263      case 0x22: size = arcompact_handle04_2f_22_dasm(DASM_PARAMS); break; // illegal
264      case 0x23: size = arcompact_handle04_2f_23_dasm(DASM_PARAMS); break; // illegal
265      case 0x24: size = arcompact_handle04_2f_24_dasm(DASM_PARAMS); break; // illegal
266      case 0x25: size = arcompact_handle04_2f_25_dasm(DASM_PARAMS); break; // illegal
267      case 0x26: size = arcompact_handle04_2f_26_dasm(DASM_PARAMS); break; // illegal
268      case 0x27: size = arcompact_handle04_2f_27_dasm(DASM_PARAMS); break; // illegal
269      case 0x28: size = arcompact_handle04_2f_28_dasm(DASM_PARAMS); break; // illegal
270      case 0x29: size = arcompact_handle04_2f_29_dasm(DASM_PARAMS); break; // illegal
271      case 0x2a: size = arcompact_handle04_2f_2a_dasm(DASM_PARAMS); break; // illegal
272      case 0x2b: size = arcompact_handle04_2f_2b_dasm(DASM_PARAMS); break; // illegal
273      case 0x2c: size = arcompact_handle04_2f_2c_dasm(DASM_PARAMS); break; // illegal
274      case 0x2d: size = arcompact_handle04_2f_2d_dasm(DASM_PARAMS); break; // illegal
275      case 0x2e: size = arcompact_handle04_2f_2e_dasm(DASM_PARAMS); break; // illegal
276      case 0x2f: size = arcompact_handle04_2f_2f_dasm(DASM_PARAMS); break; // illegal
277      case 0x30: size = arcompact_handle04_2f_30_dasm(DASM_PARAMS); break; // illegal
278      case 0x31: size = arcompact_handle04_2f_31_dasm(DASM_PARAMS); break; // illegal
279      case 0x32: size = arcompact_handle04_2f_32_dasm(DASM_PARAMS); break; // illegal
280      case 0x33: size = arcompact_handle04_2f_33_dasm(DASM_PARAMS); break; // illegal
281      case 0x34: size = arcompact_handle04_2f_34_dasm(DASM_PARAMS); break; // illegal
282      case 0x35: size = arcompact_handle04_2f_35_dasm(DASM_PARAMS); break; // illegal
283      case 0x36: size = arcompact_handle04_2f_36_dasm(DASM_PARAMS); break; // illegal
284      case 0x37: size = arcompact_handle04_2f_37_dasm(DASM_PARAMS); break; // illegal
285      case 0x38: size = arcompact_handle04_2f_38_dasm(DASM_PARAMS); break; // illegal
286      case 0x39: size = arcompact_handle04_2f_39_dasm(DASM_PARAMS); break; // illegal
287      case 0x3a: size = arcompact_handle04_2f_3a_dasm(DASM_PARAMS); break; // illegal
288      case 0x3b: size = arcompact_handle04_2f_3b_dasm(DASM_PARAMS); break; // illegal
289      case 0x3c: size = arcompact_handle04_2f_3c_dasm(DASM_PARAMS); break; // illegal
290      case 0x3d: size = arcompact_handle04_2f_3d_dasm(DASM_PARAMS); break; // illegal
291      case 0x3e: size = arcompact_handle04_2f_3e_dasm(DASM_PARAMS); break; // illegal
292      case 0x3f: size = arcompact_handle04_2f_3f_dasm(DASM_PARAMS); break; // ZOPs (Zero Operand Opcodes)
293   }
294
295   return size;
296}
297
298int arcompact_handle04_2f_3f_dasm(DASM_OPS_32)
299{
300   int size = 4;
301   UINT8 subinstr3 = (op & 0x07000000) >> 24;
302   subinstr3 |= ((op & 0x00007000) >> 12) << 3;
303
304   op &= ~0x07007000;
305
306   switch (subinstr3)
307   {
308      case 0x00: size = arcompact_handle04_2f_3f_00_dasm(DASM_PARAMS); break; // illegal
309      case 0x01: size = arcompact_handle04_2f_3f_01_dasm(DASM_PARAMS); break; // SLEEP
310      case 0x02: size = arcompact_handle04_2f_3f_02_dasm(DASM_PARAMS); break; // SWI / TRAP9
311      case 0x03: size = arcompact_handle04_2f_3f_03_dasm(DASM_PARAMS); break; // SYNC
312      case 0x04: size = arcompact_handle04_2f_3f_04_dasm(DASM_PARAMS); break; // RTIE
313      case 0x05: size = arcompact_handle04_2f_3f_05_dasm(DASM_PARAMS); break; // BRK
314      case 0x06: size = arcompact_handle04_2f_3f_06_dasm(DASM_PARAMS); break; // illegal
315      case 0x07: size = arcompact_handle04_2f_3f_07_dasm(DASM_PARAMS); break; // illegal
316      case 0x08: size = arcompact_handle04_2f_3f_08_dasm(DASM_PARAMS); break; // illegal
317      case 0x09: size = arcompact_handle04_2f_3f_09_dasm(DASM_PARAMS); break; // illegal
318      case 0x0a: size = arcompact_handle04_2f_3f_0a_dasm(DASM_PARAMS); break; // illegal
319      case 0x0b: size = arcompact_handle04_2f_3f_0b_dasm(DASM_PARAMS); break; // illegal
320      case 0x0c: size = arcompact_handle04_2f_3f_0c_dasm(DASM_PARAMS); break; // illegal
321      case 0x0d: size = arcompact_handle04_2f_3f_0d_dasm(DASM_PARAMS); break; // illegal
322      case 0x0e: size = arcompact_handle04_2f_3f_0e_dasm(DASM_PARAMS); break; // illegal
323      case 0x0f: size = arcompact_handle04_2f_3f_0f_dasm(DASM_PARAMS); break; // illegal
324      case 0x10: size = arcompact_handle04_2f_3f_10_dasm(DASM_PARAMS); break; // illegal
325      case 0x11: size = arcompact_handle04_2f_3f_11_dasm(DASM_PARAMS); break; // illegal
326      case 0x12: size = arcompact_handle04_2f_3f_12_dasm(DASM_PARAMS); break; // illegal
327      case 0x13: size = arcompact_handle04_2f_3f_13_dasm(DASM_PARAMS); break; // illegal
328      case 0x14: size = arcompact_handle04_2f_3f_14_dasm(DASM_PARAMS); break; // illegal
329      case 0x15: size = arcompact_handle04_2f_3f_15_dasm(DASM_PARAMS); break; // illegal
330      case 0x16: size = arcompact_handle04_2f_3f_16_dasm(DASM_PARAMS); break; // illegal
331      case 0x17: size = arcompact_handle04_2f_3f_17_dasm(DASM_PARAMS); break; // illegal
332      case 0x18: size = arcompact_handle04_2f_3f_18_dasm(DASM_PARAMS); break; // illegal
333      case 0x19: size = arcompact_handle04_2f_3f_19_dasm(DASM_PARAMS); break; // illegal
334      case 0x1a: size = arcompact_handle04_2f_3f_1a_dasm(DASM_PARAMS); break; // illegal
335      case 0x1b: size = arcompact_handle04_2f_3f_1b_dasm(DASM_PARAMS); break; // illegal
336      case 0x1c: size = arcompact_handle04_2f_3f_1c_dasm(DASM_PARAMS); break; // illegal
337      case 0x1d: size = arcompact_handle04_2f_3f_1d_dasm(DASM_PARAMS); break; // illegal
338      case 0x1e: size = arcompact_handle04_2f_3f_1e_dasm(DASM_PARAMS); break; // illegal
339      case 0x1f: size = arcompact_handle04_2f_3f_1f_dasm(DASM_PARAMS); break; // illegal
340      case 0x20: size = arcompact_handle04_2f_3f_20_dasm(DASM_PARAMS); break; // illegal
341      case 0x21: size = arcompact_handle04_2f_3f_21_dasm(DASM_PARAMS); break; // illegal
342      case 0x22: size = arcompact_handle04_2f_3f_22_dasm(DASM_PARAMS); break; // illegal
343      case 0x23: size = arcompact_handle04_2f_3f_23_dasm(DASM_PARAMS); break; // illegal
344      case 0x24: size = arcompact_handle04_2f_3f_24_dasm(DASM_PARAMS); break; // illegal
345      case 0x25: size = arcompact_handle04_2f_3f_25_dasm(DASM_PARAMS); break; // illegal
346      case 0x26: size = arcompact_handle04_2f_3f_26_dasm(DASM_PARAMS); break; // illegal
347      case 0x27: size = arcompact_handle04_2f_3f_27_dasm(DASM_PARAMS); break; // illegal
348      case 0x28: size = arcompact_handle04_2f_3f_28_dasm(DASM_PARAMS); break; // illegal
349      case 0x29: size = arcompact_handle04_2f_3f_29_dasm(DASM_PARAMS); break; // illegal
350      case 0x2a: size = arcompact_handle04_2f_3f_2a_dasm(DASM_PARAMS); break; // illegal
351      case 0x2b: size = arcompact_handle04_2f_3f_2b_dasm(DASM_PARAMS); break; // illegal
352      case 0x2c: size = arcompact_handle04_2f_3f_2c_dasm(DASM_PARAMS); break; // illegal
353      case 0x2d: size = arcompact_handle04_2f_3f_2d_dasm(DASM_PARAMS); break; // illegal
354      case 0x2e: size = arcompact_handle04_2f_3f_2e_dasm(DASM_PARAMS); break; // illegal
355      case 0x2f: size = arcompact_handle04_2f_3f_2f_dasm(DASM_PARAMS); break; // illegal
356      case 0x30: size = arcompact_handle04_2f_3f_30_dasm(DASM_PARAMS); break; // illegal
357      case 0x31: size = arcompact_handle04_2f_3f_31_dasm(DASM_PARAMS); break; // illegal
358      case 0x32: size = arcompact_handle04_2f_3f_32_dasm(DASM_PARAMS); break; // illegal
359      case 0x33: size = arcompact_handle04_2f_3f_33_dasm(DASM_PARAMS); break; // illegal
360      case 0x34: size = arcompact_handle04_2f_3f_34_dasm(DASM_PARAMS); break; // illegal
361      case 0x35: size = arcompact_handle04_2f_3f_35_dasm(DASM_PARAMS); break; // illegal
362      case 0x36: size = arcompact_handle04_2f_3f_36_dasm(DASM_PARAMS); break; // illegal
363      case 0x37: size = arcompact_handle04_2f_3f_37_dasm(DASM_PARAMS); break; // illegal
364      case 0x38: size = arcompact_handle04_2f_3f_38_dasm(DASM_PARAMS); break; // illegal
365      case 0x39: size = arcompact_handle04_2f_3f_39_dasm(DASM_PARAMS); break; // illegal
366      case 0x3a: size = arcompact_handle04_2f_3f_3a_dasm(DASM_PARAMS); break; // illegal
367      case 0x3b: size = arcompact_handle04_2f_3f_3b_dasm(DASM_PARAMS); break; // illegal
368      case 0x3c: size = arcompact_handle04_2f_3f_3c_dasm(DASM_PARAMS); break; // illegal
369      case 0x3d: size = arcompact_handle04_2f_3f_3d_dasm(DASM_PARAMS); break; // illegal
370      case 0x3e: size = arcompact_handle04_2f_3f_3e_dasm(DASM_PARAMS); break; // illegal
371      case 0x3f: size = arcompact_handle04_2f_3f_3f_dasm(DASM_PARAMS); break; // illegal
372   }
373
374   return size;
375}
376
377// this is an Extension ALU group, maybe optional on some CPUs?
378int arcompact_handle05_dasm(DASM_OPS_32)
379{
380   int size = 4;
381   UINT8 subinstr = (op & 0x003f0000) >> 16;
382   op &= ~0x003f0000;
383
384   switch (subinstr)
385   {
386      case 0x00: size = arcompact_handle05_00_dasm(DASM_PARAMS); break; // ASL
387      case 0x01: size = arcompact_handle05_01_dasm(DASM_PARAMS); break; // LSR
388      case 0x02: size = arcompact_handle05_02_dasm(DASM_PARAMS); break; // ASR
389      case 0x03: size = arcompact_handle05_03_dasm(DASM_PARAMS); break; // ROR
390      case 0x04: size = arcompact_handle05_04_dasm(DASM_PARAMS); break; // MUL64
391      case 0x05: size = arcompact_handle05_05_dasm(DASM_PARAMS); break; // MULU64
392      case 0x06: size = arcompact_handle05_06_dasm(DASM_PARAMS); break; // ADDS
393      case 0x07: size = arcompact_handle05_07_dasm(DASM_PARAMS); break; // SUBS
394      case 0x08: size = arcompact_handle05_08_dasm(DASM_PARAMS); break; // DIVAW
395      case 0x09: size = arcompact_handle05_09_dasm(DASM_PARAMS); break; // illegal
396      case 0x0a: size = arcompact_handle05_0a_dasm(DASM_PARAMS); break; // ASLS
397      case 0x0b: size = arcompact_handle05_0b_dasm(DASM_PARAMS); break; // ASRS
398      case 0x0c: size = arcompact_handle05_0c_dasm(DASM_PARAMS); break; // illegal
399      case 0x0d: size = arcompact_handle05_0d_dasm(DASM_PARAMS); break; // illegal
400      case 0x0e: size = arcompact_handle05_0e_dasm(DASM_PARAMS); break; // illegal
401      case 0x0f: size = arcompact_handle05_0f_dasm(DASM_PARAMS); break; // illegal
402      case 0x10: size = arcompact_handle05_10_dasm(DASM_PARAMS); break; // illegal
403      case 0x11: size = arcompact_handle05_11_dasm(DASM_PARAMS); break; // illegal
404      case 0x12: size = arcompact_handle05_12_dasm(DASM_PARAMS); break; // illegal
405      case 0x13: size = arcompact_handle05_13_dasm(DASM_PARAMS); break; // illegal
406      case 0x14: size = arcompact_handle05_14_dasm(DASM_PARAMS); break; // illegal
407      case 0x15: size = arcompact_handle05_15_dasm(DASM_PARAMS); break; // illegal
408      case 0x16: size = arcompact_handle05_16_dasm(DASM_PARAMS); break; // illegal
409      case 0x17: size = arcompact_handle05_17_dasm(DASM_PARAMS); break; // illegal
410      case 0x18: size = arcompact_handle05_18_dasm(DASM_PARAMS); break; // illegal
411      case 0x19: size = arcompact_handle05_19_dasm(DASM_PARAMS); break; // illegal
412      case 0x1a: size = arcompact_handle05_1a_dasm(DASM_PARAMS); break; // illegal
413      case 0x1b: size = arcompact_handle05_1b_dasm(DASM_PARAMS); break; // illegal
414      case 0x1c: size = arcompact_handle05_1c_dasm(DASM_PARAMS); break; // illegal
415      case 0x1d: size = arcompact_handle05_1d_dasm(DASM_PARAMS); break; // illegal
416      case 0x1e: size = arcompact_handle05_1e_dasm(DASM_PARAMS); break; // illegal
417      case 0x1f: size = arcompact_handle05_1f_dasm(DASM_PARAMS); break; // illegal
418      case 0x20: size = arcompact_handle05_20_dasm(DASM_PARAMS); break; // illegal
419      case 0x21: size = arcompact_handle05_21_dasm(DASM_PARAMS); break; // illegal
420      case 0x22: size = arcompact_handle05_22_dasm(DASM_PARAMS); break; // illegal
421      case 0x23: size = arcompact_handle05_23_dasm(DASM_PARAMS); break; // illegal
422      case 0x24: size = arcompact_handle05_24_dasm(DASM_PARAMS); break; // illegal
423      case 0x25: size = arcompact_handle05_25_dasm(DASM_PARAMS); break; // illegal
424      case 0x26: size = arcompact_handle05_26_dasm(DASM_PARAMS); break; // illegal
425      case 0x27: size = arcompact_handle05_27_dasm(DASM_PARAMS); break; // illegal
426      case 0x28: size = arcompact_handle05_28_dasm(DASM_PARAMS); break; // ADDSDW
427      case 0x29: size = arcompact_handle05_29_dasm(DASM_PARAMS); break; // SUBSDW
428      case 0x2a: size = arcompact_handle05_2a_dasm(DASM_PARAMS); break; // illegal
429      case 0x2b: size = arcompact_handle05_2b_dasm(DASM_PARAMS); break; // illegal
430      case 0x2c: size = arcompact_handle05_2c_dasm(DASM_PARAMS); break; // illegal
431      case 0x2d: size = arcompact_handle05_2d_dasm(DASM_PARAMS); break; // illegal
432      case 0x2e: size = arcompact_handle05_2e_dasm(DASM_PARAMS); break; // illegal
433      case 0x2f: size = arcompact_handle05_2f_dasm(DASM_PARAMS); break; // SOPs
434      case 0x30: size = arcompact_handle05_30_dasm(DASM_PARAMS); break; // illegal
435      case 0x31: size = arcompact_handle05_31_dasm(DASM_PARAMS); break; // illegal
436      case 0x32: size = arcompact_handle05_32_dasm(DASM_PARAMS); break; // illegal
437      case 0x33: size = arcompact_handle05_33_dasm(DASM_PARAMS); break; // illegal
438      case 0x34: size = arcompact_handle05_34_dasm(DASM_PARAMS); break; // illegal
439      case 0x35: size = arcompact_handle05_35_dasm(DASM_PARAMS); break; // illegal
440      case 0x36: size = arcompact_handle05_36_dasm(DASM_PARAMS); break; // illegal
441      case 0x37: size = arcompact_handle05_37_dasm(DASM_PARAMS); break; // illegal
442      case 0x38: size = arcompact_handle05_38_dasm(DASM_PARAMS); break; // illegal
443      case 0x39: size = arcompact_handle05_39_dasm(DASM_PARAMS); break; // illegal
444      case 0x3a: size = arcompact_handle05_3a_dasm(DASM_PARAMS); break; // illegal
445      case 0x3b: size = arcompact_handle05_3b_dasm(DASM_PARAMS); break; // illegal
446      case 0x3c: size = arcompact_handle05_3c_dasm(DASM_PARAMS); break; // illegal
447      case 0x3d: size = arcompact_handle05_3d_dasm(DASM_PARAMS); break; // illegal
448      case 0x3e: size = arcompact_handle05_3e_dasm(DASM_PARAMS); break; // illegal
449      case 0x3f: size = arcompact_handle05_3f_dasm(DASM_PARAMS); break; // illegal
450   }
451
452   return size;
453}
454
455int arcompact_handle0c_dasm(DASM_OPS_16)
456{
457   int size = 2;
458   UINT8 subinstr = (op & 0x0018) >> 3;
459   op &= ~0x0018;
460
461   switch (subinstr)
462   {
463      case 0x00: size = arcompact_handle0c_00_dasm(DASM_PARAMS); break; // LD_S
464      case 0x01: size = arcompact_handle0c_01_dasm(DASM_PARAMS); break; // LDB_S
465      case 0x02: size = arcompact_handle0c_02_dasm(DASM_PARAMS); break; // LDW_S
466      case 0x03: size = arcompact_handle0c_03_dasm(DASM_PARAMS); break; // ADD_S
467   }
468   return size;
469}
470
471int arcompact_handle0d_dasm(DASM_OPS_16)
472{
473   int size = 2;
474   UINT8 subinstr = (op & 0x0018) >> 3;
475   op &= ~0x0018;
476
477   switch (subinstr)
478   {
479      case 0x00: size = arcompact_handle0d_00_dasm(DASM_PARAMS); break; // ADD_S
480      case 0x01: size = arcompact_handle0d_01_dasm(DASM_PARAMS); break; // SUB_S
481      case 0x02: size = arcompact_handle0d_02_dasm(DASM_PARAMS); break; // ASL_S
482      case 0x03: size = arcompact_handle0d_03_dasm(DASM_PARAMS); break; // ASR_S
483   }
484   return size;
485}
486
487int arcompact_handle0e_dasm(DASM_OPS_16)
488{
489   int size = 2;
490   UINT8 subinstr = (op & 0x0018) >> 3;
491   op &= ~0x0018;
492
493   switch (subinstr)
494   {
495      case 0x00: size = arcompact_handle0e_00_dasm(DASM_PARAMS); break; // ADD_S
496      case 0x01: size = arcompact_handle0e_01_dasm(DASM_PARAMS); break; // MOV_S
497      case 0x02: size = arcompact_handle0e_02_dasm(DASM_PARAMS); break; // CMP_S
498      case 0x03: size = arcompact_handle0e_03_dasm(DASM_PARAMS); break; // MOV_S
499   }
500   return size;
501}
502
503int arcompact_handle0f_dasm(DASM_OPS_16)
504{
505   int size = 2;
506   // General Register Instructions (16-bit)
507   // 01111 bbb ccc iiiii
508   UINT8 subinstr = (op & 0x01f) >> 0;
509   op &= ~0x001f;
510
511   switch (subinstr)
512   {
513      case 0x00: size = arcompact_handle0f_00_dasm(DASM_PARAMS); break; // SOPs
514      case 0x01: size = arcompact_handle0f_01_dasm(DASM_PARAMS); break; // 0x01 <illegal>
515      case 0x02: size = arcompact_handle0f_02_dasm(DASM_PARAMS); break; // SUB_S
516      case 0x03: size = arcompact_handle0f_03_dasm(DASM_PARAMS); break; // 0x03 <illegal>
517      case 0x04: size = arcompact_handle0f_04_dasm(DASM_PARAMS); break; // AND_S
518      case 0x05: size = arcompact_handle0f_05_dasm(DASM_PARAMS); break; // OR_S
519      case 0x06: size = arcompact_handle0f_06_dasm(DASM_PARAMS); break; // BIC_S
520      case 0x07: size = arcompact_handle0f_07_dasm(DASM_PARAMS); break; // XOR_S
521      case 0x08: size = arcompact_handle0f_08_dasm(DASM_PARAMS); break; // 0x08 <illegal>
522      case 0x09: size = arcompact_handle0f_09_dasm(DASM_PARAMS); break; // 0x09 <illegal>
523      case 0x0a: size = arcompact_handle0f_0a_dasm(DASM_PARAMS); break; // 0x0a <illegal>
524      case 0x0b: size = arcompact_handle0f_0b_dasm(DASM_PARAMS); break; // TST_S
525      case 0x0c: size = arcompact_handle0f_0c_dasm(DASM_PARAMS); break; // MUL64_S
526      case 0x0d: size = arcompact_handle0f_0d_dasm(DASM_PARAMS); break; // SEXB_S
527      case 0x0e: size = arcompact_handle0f_0e_dasm(DASM_PARAMS); break; // SEXW_S
528      case 0x0f: size = arcompact_handle0f_0f_dasm(DASM_PARAMS); break; // EXTB_S
529      case 0x10: size = arcompact_handle0f_10_dasm(DASM_PARAMS); break; // EXTW_S
530      case 0x11: size = arcompact_handle0f_11_dasm(DASM_PARAMS); break; // ABS_S
531      case 0x12: size = arcompact_handle0f_12_dasm(DASM_PARAMS); break; // NOT_S
532      case 0x13: size = arcompact_handle0f_13_dasm(DASM_PARAMS); break; // NEG_S
533      case 0x14: size = arcompact_handle0f_14_dasm(DASM_PARAMS); break; // ADD1_S
534      case 0x15: size = arcompact_handle0f_15_dasm(DASM_PARAMS); break; // ADD2_S
535      case 0x16: size = arcompact_handle0f_16_dasm(DASM_PARAMS); break; // ADD3_S
536      case 0x17: size = arcompact_handle0f_17_dasm(DASM_PARAMS); break; // 0x17 <illegal>
537      case 0x18: size = arcompact_handle0f_18_dasm(DASM_PARAMS); break; // ASL_S (multiple)
538      case 0x19: size = arcompact_handle0f_19_dasm(DASM_PARAMS); break; // LSR_S (multiple)
539      case 0x1a: size = arcompact_handle0f_1a_dasm(DASM_PARAMS); break; // ASR_S (multiple)
540      case 0x1b: size = arcompact_handle0f_1b_dasm(DASM_PARAMS); break; // ASL_S (single)
541      case 0x1c: size = arcompact_handle0f_1c_dasm(DASM_PARAMS); break; // LSR_S (single)
542      case 0x1d: size = arcompact_handle0f_1d_dasm(DASM_PARAMS); break; // ASR_S (single)
543      case 0x1e: size = arcompact_handle0f_1e_dasm(DASM_PARAMS); break; // TRAP (not a5?)
544      case 0x1f: size = arcompact_handle0f_1f_dasm(DASM_PARAMS); break; // BRK_S ( 0x7fff only? )
545
546   }
547   return size;
548}
549
550int arcompact_handle0f_00_dasm(DASM_OPS_16)
551{
552   int size = 2;
553   UINT8 subinstr = (op & 0x00e0) >> 5;
554   op &= ~0x00e0;
555
556   switch (subinstr)
557   {
558      case 0x00: size = arcompact_handle0f_00_00_dasm(DASM_PARAMS); break; // J_S
559      case 0x01: size = arcompact_handle0f_00_01_dasm(DASM_PARAMS); break; // J_S.D
560      case 0x02: size = arcompact_handle0f_00_02_dasm(DASM_PARAMS); break; // JL_S
561      case 0x03: size = arcompact_handle0f_00_03_dasm(DASM_PARAMS); break; // JL_S.D
562      case 0x04: size = arcompact_handle0f_00_04_dasm(DASM_PARAMS); break; // 0x04 <illegal>
563      case 0x05: size = arcompact_handle0f_00_05_dasm(DASM_PARAMS); break; // 0x05 <illegal>
564      case 0x06: size = arcompact_handle0f_00_06_dasm(DASM_PARAMS); break; // SUB_S.NE
565      case 0x07: size = arcompact_handle0f_00_07_dasm(DASM_PARAMS); break; // ZOPs
566
567   }
568
569   return size;
570}
571
572int arcompact_handle0f_00_07_dasm(DASM_OPS_16)
573{
574   int size = 2;
575   // General Operations w/o Register
576   // 01111 iii 111 00000
577   UINT8 subinstr3 = (op & 0x0700) >> 8;
578   op &= ~0x0700;
579
580   switch (subinstr3)
581   {
582      case 0x00: size = arcompact_handle0f_00_07_00_dasm(DASM_PARAMS); break; // NOP_S
583      case 0x01: size = arcompact_handle0f_00_07_01_dasm(DASM_PARAMS); break; // UNIMP_S
584      case 0x02: size = arcompact_handle0f_00_07_02_dasm(DASM_PARAMS); break; // 0x02 <illegal>
585      case 0x03: size = arcompact_handle0f_00_07_03_dasm(DASM_PARAMS); break; // 0x03 <illegal>
586      case 0x04: size = arcompact_handle0f_00_07_04_dasm(DASM_PARAMS); break; // JEQ_S [BLINK]
587      case 0x05: size = arcompact_handle0f_00_07_05_dasm(DASM_PARAMS); break; // JNE_S [BLINK]
588      case 0x06: size = arcompact_handle0f_00_07_06_dasm(DASM_PARAMS); break; // J_S [BLINK]
589      case 0x07: size = arcompact_handle0f_00_07_07_dasm(DASM_PARAMS); break; // J_S.D [BLINK]
590
591   }
592   return size;
593}
594
595int arcompact_handle17_dasm(DASM_OPS_16)
596{
597   int size = 2;
598   UINT8 subinstr = (op & 0x00e0) >> 5;
599   op &= ~0x00e0;
600
601   switch (subinstr)
602   {
603      case 0x00: size = arcompact_handle17_00_dasm(DASM_PARAMS); break; // ASL_S
604      case 0x01: size = arcompact_handle17_01_dasm(DASM_PARAMS); break; // LSR_S
605      case 0x02: size = arcompact_handle17_02_dasm(DASM_PARAMS); break; // ASR_S
606      case 0x03: size = arcompact_handle17_03_dasm(DASM_PARAMS); break; // SUB_S
607      case 0x04: size = arcompact_handle17_04_dasm(DASM_PARAMS); break; // BSET_S
608      case 0x05: size = arcompact_handle17_05_dasm(DASM_PARAMS); break; // BCLR_S
609      case 0x06: size = arcompact_handle17_06_dasm(DASM_PARAMS); break; // BMSK_S
610      case 0x07: size = arcompact_handle17_07_dasm(DASM_PARAMS); break; // BTST_S
611   }
612
613   return size;
614}
615
616int arcompact_handle18_dasm(DASM_OPS_16)
617{
618   int size = 2;
619   // Stack Pointer Based Instructions (16-bit)
620   // 11000 bbb iii uuuuu
621   UINT8 subinstr = (op & 0x00e0) >> 5;
622   op &= ~0x00e0;
623
624   switch (subinstr)
625   {
626      case 0x00: size = arcompact_handle18_00_dasm(DASM_PARAMS); break; // LD_S (SP)
627      case 0x01: size = arcompact_handle18_01_dasm(DASM_PARAMS); break; // LDB_S (SP)
628      case 0x02: size = arcompact_handle18_02_dasm(DASM_PARAMS); break; // ST_S (SP)
629      case 0x03: size = arcompact_handle18_03_dasm(DASM_PARAMS); break; // STB_S (SP)
630      case 0x04: size = arcompact_handle18_04_dasm(DASM_PARAMS); break; // ADD_S (SP)
631      case 0x05: size = arcompact_handle18_05_dasm(DASM_PARAMS); break; // subtable 18_05
632      case 0x06: size = arcompact_handle18_06_dasm(DASM_PARAMS); break; // subtable 18_06
633      case 0x07: size = arcompact_handle18_07_dasm(DASM_PARAMS); break; // subtable 18_07
634   }
635
636   return size;
637}
638
639int arcompact_handle18_05_dasm(DASM_OPS_16)
640{
641   int size = 2;
642   UINT8 subinstr2 = (op & 0x0700) >> 8;
643   op &= ~0x001f;
644
645   switch (subinstr2)
646   {
647      case 0x00: size = arcompact_handle18_05_00_dasm(DASM_PARAMS); break; // ADD_S (SP)
648      case 0x01: size = arcompact_handle18_05_01_dasm(DASM_PARAMS); break; // SUB_S (SP)
649      case 0x02: size = arcompact_handle18_05_02_dasm(DASM_PARAMS); break; // <illegal 0x18_05_02>
650      case 0x03: size = arcompact_handle18_05_03_dasm(DASM_PARAMS); break; // <illegal 0x18_05_03>
651      case 0x04: size = arcompact_handle18_05_04_dasm(DASM_PARAMS); break; // <illegal 0x18_05_04>
652      case 0x05: size = arcompact_handle18_05_05_dasm(DASM_PARAMS); break; // <illegal 0x18_05_05>
653      case 0x06: size = arcompact_handle18_05_06_dasm(DASM_PARAMS); break; // <illegal 0x18_05_06>
654      case 0x07: size = arcompact_handle18_05_07_dasm(DASM_PARAMS); break; // <illegal 0x18_05_07>
655   }
656
657   return size;
658}
659
660int arcompact_handle18_06_dasm(DASM_OPS_16)
661{
662   int size = 2;
663   UINT8 subinstr2 = (op & 0x001f) >> 0;
664   op &= ~0x001f;
665
666   switch (subinstr2)
667   {
668      case 0x00: size = arcompact_handle18_06_00_dasm(DASM_PARAMS); break; // <illegal 0x18_06_00>
669      case 0x01: size = arcompact_handle18_06_01_dasm(DASM_PARAMS); break; // POP_S b
670      case 0x02: size = arcompact_handle18_06_02_dasm(DASM_PARAMS); break; // <illegal 0x18_06_02>
671      case 0x03: size = arcompact_handle18_06_03_dasm(DASM_PARAMS); break; // <illegal 0x18_06_03>
672      case 0x04: size = arcompact_handle18_06_04_dasm(DASM_PARAMS); break; // <illegal 0x18_06_04>
673      case 0x05: size = arcompact_handle18_06_05_dasm(DASM_PARAMS); break; // <illegal 0x18_06_05>
674      case 0x06: size = arcompact_handle18_06_06_dasm(DASM_PARAMS); break; // <illegal 0x18_06_06>
675      case 0x07: size = arcompact_handle18_06_07_dasm(DASM_PARAMS); break; // <illegal 0x18_06_07>
676      case 0x08: size = arcompact_handle18_06_08_dasm(DASM_PARAMS); break; // <illegal 0x18_06_08>
677      case 0x09: size = arcompact_handle18_06_09_dasm(DASM_PARAMS); break; // <illegal 0x18_06_09>
678      case 0x0a: size = arcompact_handle18_06_0a_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0a>
679      case 0x0b: size = arcompact_handle18_06_0b_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0b>
680      case 0x0c: size = arcompact_handle18_06_0c_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0c>
681      case 0x0d: size = arcompact_handle18_06_0d_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0d>
682      case 0x0e: size = arcompact_handle18_06_0e_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0e>
683      case 0x0f: size = arcompact_handle18_06_0f_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0f>
684      case 0x10: size = arcompact_handle18_06_10_dasm(DASM_PARAMS); break; // <illegal 0x18_06_10>
685      case 0x11: size = arcompact_handle18_06_11_dasm(DASM_PARAMS); break; // POP_S blink
686      case 0x12: size = arcompact_handle18_06_12_dasm(DASM_PARAMS); break; // <illegal 0x18_06_12>
687      case 0x13: size = arcompact_handle18_06_13_dasm(DASM_PARAMS); break; // <illegal 0x18_06_13>
688      case 0x14: size = arcompact_handle18_06_14_dasm(DASM_PARAMS); break; // <illegal 0x18_06_14>
689      case 0x15: size = arcompact_handle18_06_15_dasm(DASM_PARAMS); break; // <illegal 0x18_06_15>
690      case 0x16: size = arcompact_handle18_06_16_dasm(DASM_PARAMS); break; // <illegal 0x18_06_16>
691      case 0x17: size = arcompact_handle18_06_17_dasm(DASM_PARAMS); break; // <illegal 0x18_06_17>
692      case 0x18: size = arcompact_handle18_06_18_dasm(DASM_PARAMS); break; // <illegal 0x18_06_18>
693      case 0x19: size = arcompact_handle18_06_19_dasm(DASM_PARAMS); break; // <illegal 0x18_06_19>
694      case 0x1a: size = arcompact_handle18_06_1a_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1a>
695      case 0x1b: size = arcompact_handle18_06_1b_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1b>
696      case 0x1c: size = arcompact_handle18_06_1c_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1c>
697      case 0x1d: size = arcompact_handle18_06_1d_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1d>
698      case 0x1e: size = arcompact_handle18_06_1e_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1e>
699      case 0x1f: size = arcompact_handle18_06_1f_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1f>
700   }
701
702   return size;
703}
704
705int arcompact_handle18_07_dasm(DASM_OPS_16)
706{
707   int size = 2;
708   UINT8 subinstr2 = (op & 0x001f) >> 0;
709   op &= ~0x001f;
710
711   switch (subinstr2)
712   {
713      case 0x00: size = arcompact_handle18_07_00_dasm(DASM_PARAMS); break; // <illegal 0x18_07_00>
714      case 0x01: size = arcompact_handle18_07_01_dasm(DASM_PARAMS); break; // PUSH_S b
715      case 0x02: size = arcompact_handle18_07_02_dasm(DASM_PARAMS); break; // <illegal 0x18_07_02>
716      case 0x03: size = arcompact_handle18_07_03_dasm(DASM_PARAMS); break; // <illegal 0x18_07_03>
717      case 0x04: size = arcompact_handle18_07_04_dasm(DASM_PARAMS); break; // <illegal 0x18_07_04>
718      case 0x05: size = arcompact_handle18_07_05_dasm(DASM_PARAMS); break; // <illegal 0x18_07_05>
719      case 0x06: size = arcompact_handle18_07_06_dasm(DASM_PARAMS); break; // <illegal 0x18_07_06>
720      case 0x07: size = arcompact_handle18_07_07_dasm(DASM_PARAMS); break; // <illegal 0x18_07_07>
721      case 0x08: size = arcompact_handle18_07_08_dasm(DASM_PARAMS); break; // <illegal 0x18_07_08>
722      case 0x09: size = arcompact_handle18_07_09_dasm(DASM_PARAMS); break; // <illegal 0x18_07_09>
723      case 0x0a: size = arcompact_handle18_07_0a_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0a>
724      case 0x0b: size = arcompact_handle18_07_0b_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0b>
725      case 0x0c: size = arcompact_handle18_07_0c_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0c>
726      case 0x0d: size = arcompact_handle18_07_0d_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0d>
727      case 0x0e: size = arcompact_handle18_07_0e_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0e>
728      case 0x0f: size = arcompact_handle18_07_0f_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0f>
729      case 0x10: size = arcompact_handle18_07_10_dasm(DASM_PARAMS); break; // <illegal 0x18_07_10>
730      case 0x11: size = arcompact_handle18_07_11_dasm(DASM_PARAMS); break; // PUSH_S blink
731      case 0x12: size = arcompact_handle18_07_12_dasm(DASM_PARAMS); break; // <illegal 0x18_07_12>
732      case 0x13: size = arcompact_handle18_07_13_dasm(DASM_PARAMS); break; // <illegal 0x18_07_13>
733      case 0x14: size = arcompact_handle18_07_14_dasm(DASM_PARAMS); break; // <illegal 0x18_07_14>
734      case 0x15: size = arcompact_handle18_07_15_dasm(DASM_PARAMS); break; // <illegal 0x18_07_15>
735      case 0x16: size = arcompact_handle18_07_16_dasm(DASM_PARAMS); break; // <illegal 0x18_07_16>
736      case 0x17: size = arcompact_handle18_07_17_dasm(DASM_PARAMS); break; // <illegal 0x18_07_17>
737      case 0x18: size = arcompact_handle18_07_18_dasm(DASM_PARAMS); break; // <illegal 0x18_07_18>
738      case 0x19: size = arcompact_handle18_07_19_dasm(DASM_PARAMS); break; // <illegal 0x18_07_19>
739      case 0x1a: size = arcompact_handle18_07_1a_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1a>
740      case 0x1b: size = arcompact_handle18_07_1b_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1b>
741      case 0x1c: size = arcompact_handle18_07_1c_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1c>
742      case 0x1d: size = arcompact_handle18_07_1d_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1d>
743      case 0x1e: size = arcompact_handle18_07_1e_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1e>
744      case 0x1f: size = arcompact_handle18_07_1f_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1f>
745   }
746
747   return size;
748}
749
750int arcompact_handle19_dasm(DASM_OPS_16)
751{
752   int size = 2;
753   UINT8 subinstr = (op & 0x0600) >> 9;
754   op &= ~0x0600;
755
756   switch (subinstr)
757   {
758      case 0x00: size = arcompact_handle19_00_dasm(DASM_PARAMS); break; // LD_S (GP)
759      case 0x01: size = arcompact_handle19_01_dasm(DASM_PARAMS); break; // LDB_S (GP)
760      case 0x02: size = arcompact_handle19_02_dasm(DASM_PARAMS); break; // LDW_S (GP)
761      case 0x03: size = arcompact_handle19_03_dasm(DASM_PARAMS); break; // ADD_S (GP)
762   }
763   return size;
764}
765
766int arcompact_handle1c_dasm(DASM_OPS_16)
767{
768   int size = 2;
769   UINT8 subinstr = (op & 0x0080) >> 7;
770   op &= ~0x0080;
771
772   switch (subinstr)
773   {
774      case 0x00: size = arcompact_handle1c_00_dasm(DASM_PARAMS); break; // ADD_S
775      case 0x01: size = arcompact_handle1c_01_dasm(DASM_PARAMS); break; // CMP_S
776   }
777   return size;
778}
779
780int arcompact_handle1d_dasm(DASM_OPS_16)
781{
782   int size = 2;
783   UINT8 subinstr = (op & 0x0080) >> 7;
784   op &= ~0x0080;
785
786   switch (subinstr)
787   {
788      case 0x00: size = arcompact_handle1d_00_dasm(DASM_PARAMS); break; // BREQ_S
789      case 0x01: size = arcompact_handle1d_01_dasm(DASM_PARAMS); break; // BRNE_S
790   }
791   return size;
792}
793
794int arcompact_handle1e_dasm(DASM_OPS_16)
795{
796   int size = 2;
797   UINT8 subinstr = (op & 0x0600) >> 9;
798   op &= ~0x0600;
799
800   switch (subinstr)
801   {
802      case 0x00: size = arcompact_handle1e_00_dasm(DASM_PARAMS); break; // B_S
803      case 0x01: size = arcompact_handle1e_01_dasm(DASM_PARAMS); break; // BEQ_S
804      case 0x02: size = arcompact_handle1e_02_dasm(DASM_PARAMS); break; // BNE_S
805      case 0x03: size = arcompact_handle1e_03_dasm(DASM_PARAMS); break; // Bcc_S
806   }
807   return size;
808}
809
810int arcompact_handle1e_03_dasm(DASM_OPS_16)
811{
812   
813   int size = 2;
814   UINT8 subinstr2 = (op & 0x01c0) >> 6;
815   op &= ~0x01c0;
816
817   switch (subinstr2)
818   {
819      case 0x00: size = arcompact_handle1e_03_00_dasm(DASM_PARAMS); break; // BGT_S
820      case 0x01: size = arcompact_handle1e_03_01_dasm(DASM_PARAMS); break; // BGE_S
821      case 0x02: size = arcompact_handle1e_03_02_dasm(DASM_PARAMS); break; // BLT_S
822      case 0x03: size = arcompact_handle1e_03_03_dasm(DASM_PARAMS); break; // BLE_S
823      case 0x04: size = arcompact_handle1e_03_04_dasm(DASM_PARAMS); break; // BHI_S
824      case 0x05: size = arcompact_handle1e_03_05_dasm(DASM_PARAMS); break; // BHS_S
825      case 0x06: size = arcompact_handle1e_03_06_dasm(DASM_PARAMS); break; // BLO_S
826      case 0x07: size = arcompact_handle1e_03_07_dasm(DASM_PARAMS); break; // BLS_S
827   }
828   return size;
829
830}
trunk/src/emu/cpu/arcompact/arcompactdasm_dispatch.h
r0r242320
1/*********************************\
2
3 ARCompact disassembler
4
5\*********************************/
6
7#define DASM_OPS_16 char *output, offs_t pc, UINT16 op, const UINT8* oprom
8#define DASM_OPS_32 char *output, offs_t pc, UINT32 op, const UINT8* oprom
9#define DASM_PARAMS output, pc, op, oprom
10
11#define LIMM_REG 62
12
13#define GET_LIMM_32 \
14   limm = oprom[6] | (oprom[7] << 8); \
15   limm |= (oprom[4] << 16) | (oprom[5] << 24); \
16
17
18
19int arcompact_handle00_dasm(DASM_OPS_32);
20int arcompact_handle01_dasm(DASM_OPS_32);
21int arcompact_handle01_00_dasm(DASM_OPS_32);
22int arcompact_handle01_01_dasm(DASM_OPS_32);
23int arcompact_handle01_01_00_dasm(DASM_OPS_32);
24int arcompact_handle01_01_01_dasm(DASM_OPS_32);
25int arcompact_handle04_dasm(DASM_OPS_32);
26int arcompact_handle04_2f_dasm(DASM_OPS_32);
27int arcompact_handle04_2f_3f_dasm(DASM_OPS_32);
28int arcompact_handle05_dasm(DASM_OPS_32);
29
30int arcompact_handle0c_dasm(DASM_OPS_16);
31int arcompact_handle0d_dasm(DASM_OPS_16);
32int arcompact_handle0e_dasm(DASM_OPS_16);
33int arcompact_handle0f_dasm(DASM_OPS_16);
34int arcompact_handle0f_00_dasm(DASM_OPS_16);
35int arcompact_handle0f_00_07_dasm(DASM_OPS_16);
36int arcompact_handle17_dasm(DASM_OPS_16);
37int arcompact_handle18_dasm(DASM_OPS_16);
38int arcompact_handle18_05_dasm(DASM_OPS_16);
39int arcompact_handle18_06_dasm(DASM_OPS_16);
40int arcompact_handle18_07_dasm(DASM_OPS_16);
41int arcompact_handle19_dasm(DASM_OPS_16);
42int arcompact_handle1c_dasm(DASM_OPS_16);
43int arcompact_handle1d_dasm(DASM_OPS_16);
44int arcompact_handle1e_dasm(DASM_OPS_16);
45int arcompact_handle1e_03_dasm(DASM_OPS_16);
trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
r0r242320
1/*********************************\
2
3 ARCompact disassembler
4
5\*********************************/
6
7#include "emu.h"
8#include <stdarg.h>
9
10#include "arcompactdasm_ops.h"
11
12char *output;
13
14static void ATTR_PRINTF(1,2) print(const char *fmt, ...)
15{
16   va_list vl;
17
18   va_start(vl, fmt);
19   vsprintf(output, fmt, vl);
20   va_end(vl);
21}
22
23
24// condition codes (basic ones are the same as arc
25static const char *conditions[0x20] =
26{
27   /* 00 */ "AL", // (aka RA         - Always)
28   /* 01 */ "EQ", // (aka Z          - Zero
29   /* 02 */ "NE", // (aka NZ         - Non-Zero)
30   /* 03 */ "PL", // (aka P          - Positive)
31   /* 04 */ "MI", // (aka N          - Negative)
32   /* 05 */ "CS", // (aka C,  LO     - Carry set / Lower than) (unsigned)
33   /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned)
34   /* 07 */ "VS", // (aka V          - Overflow set)
35   /* 08 */ "VC", // (aka NV         - Overflow clear)
36   /* 09 */ "GT", // (               - Greater than) (signed)
37   /* 0a */ "GE", // (               - Greater than or Equal) (signed)
38   /* 0b */ "LT", // (               - Less than) (signed)
39   /* 0c */ "LE", // (               - Less than or Equal) (signed)
40   /* 0d */ "HI", // (               - Higher than) (unsigned)
41   /* 0e */ "LS", // (               - Lower or Same) (unsigned)
42   /* 0f */ "PNZ",// (               - Positive non-0 value)
43   /* 10 */ "0x10 Reserved", // possible CPU implementation specifics
44   /* 11 */ "0x11 Reserved",
45   /* 12 */ "0x12 Reserved",
46   /* 13 */ "0x13 Reserved",
47   /* 14 */ "0x14 Reserved",
48   /* 15 */ "0x15 Reserved",
49   /* 16 */ "0x16 Reserved",
50   /* 17 */ "0x17 Reserved",
51   /* 18 */ "0x18 Reserved",
52   /* 19 */ "0x19 Reserved",
53   /* 1a */ "0x1a Reserved",
54   /* 1b */ "0x1b Reserved",
55   /* 1c */ "0x1c Reserved",
56   /* 1d */ "0x1d Reserved",
57   /* 1e */ "0x1e Reserved",
58   /* 1f */ "0x1f Reserved"
59};
60
61
62int arcompact_01_01_00_helper(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext)
63{
64   int size = 4;
65
66   // Branch on Compare / Bit Test - Register-Register
67   // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii
68   INT32 address = (op & 0x00fe0000) >> 17;
69   address |= ((op & 0x00008000) >> 15) << 7;
70   if (address & 0x80) address = -(address & 0x7f);
71
72   int c = (op & 0x00000fc0) >> 6;
73   int b = (op & 0x07000000) >> 24;
74   b |= ((op & 0x00007000) >> 12) << 3;
75
76   op &= ~0x07007fe0;
77
78   if ((b != LIMM_REG) && (c != LIMM_REG))
79   {
80      print("%s (r%d) (r%d) %08x (%08x)", optext, b, c, pc + (address * 2) + 4, op & ~0xf8fe800f);
81   }
82   else
83   {
84      UINT32 limm;
85      GET_LIMM_32;
86      size = 8;
87
88      if ((b == LIMM_REG) && (c != LIMM_REG))
89      {
90         print("%s (%08x) (r%d) %08x (%08x)", optext, limm, c, pc + (address * 2) + 4, op & ~0xf8fe800f);
91      }
92      else if ((c == LIMM_REG) && (b != LIMM_REG))
93      {
94         print("%s (r%d) (%08x) %08x (%08x)", optext, b, limm, pc + (address * 2) + 4, op & ~0xf8fe800f);
95      }
96      else
97      {
98         // b and c are LIMM? invalid??
99         print("%s (%08x) (%08x) (illegal?) %08x (%08x)", optext, limm, limm, pc + (address * 2) + 4, op & ~0xf8fe800f);
100
101      }
102   }
103
104   return size;
105}
106
107#define GET_01_01_01_BRANCH_ADDR \
108   INT32 address = (op & 0x00fe0000) >> 17; \
109   address |= ((op & 0x00008000) >> 15) << 7; \
110   if (address & 0x80) address = -(address & 0x7f); \
111   op &= ~ 0x00fe800f;
112
113
114#define GROUP_0e_GET_h \
115   h =  ((op & 0x0007) << 3); \
116    h |= ((op & 0x00e0) >> 5); \
117
118// this is as messed up as the rest of the 16-bit alignment in LE mode...
119
120#define GET_LIMM \
121   limm = oprom[4] | (oprom[5] << 8); \
122   limm |= (oprom[2] << 16) | (oprom[3] << 24); \
123
124
125/************************************************************************************************************************************
126*                                                                                                                                   *
127* individual opcode handlers (disassembly)                                                                                          *
128*                                                                                                                                   *
129************************************************************************************************************************************/
130
131int arcompact_handle00_00_dasm(DASM_OPS_32)
132{
133   int size = 4;
134   // Branch Conditionally
135   // 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ
136   INT32 address = (op & 0x07fe0000) >> 17;
137   address |= ((op & 0x0000ffc0) >> 6) << 10;
138   if (address & 0x800000) address = -(address & 0x7fffff);
139
140   UINT8 condition = op & 0x0000001f;
141
142   print("B(%s) %08x (%08x)", conditions[condition], pc + (address * 2) + 2, op & ~0xffffffdf);
143   return size;
144}
145
146int arcompact_handle00_01_dasm(DASM_OPS_32)
147{
148   int size = 4;
149   // Branch Unconditionally Far
150   // 00000 ssssssssss 1  SSSSSSSSSS N R TTTT
151   INT32 address = (op & 0x07fe0000) >> 17;
152   address |= ((op & 0x0000ffc0) >> 6) << 10;
153   address |= ((op & 0x0000000f) >> 0) << 20;
154   if (address & 0x800000) address = -(address & 0x7fffff);
155
156   print("B %08x (%08x)", pc + (address * 2) + 2, op & ~0xffffffcf);
157   return size;
158}
159
160int arcompact_handle01_00_00dasm(DASM_OPS_32)
161{
162   int size = 4;
163
164   // Branch and Link Conditionally
165   // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ
166   INT32 address =   (op & 0x07fc0000) >> 17;
167   address |=        ((op & 0x0000ffc0) >> 6) << 10;
168   if (address & 0x800000) address = -(address&0x7fffff);   
169
170   UINT8 condition = op & 0x0000001f;
171
172   print("BL(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
173   return size;
174}
175
176int arcompact_handle01_00_01dasm(DASM_OPS_32)
177{
178   int size = 4;
179   // Branch and Link Unconditionally Far
180   // 00001 sssssssss 10  SSSSSSSSSS N R TTTT
181   INT32 address =   (op & 0x07fc0000) >> 17;
182   address |=        ((op & 0x0000ffc0) >> 6) << 10;
183   address |=        ((op & 0x0000000f) >> 0) << 20;
184   if (address & 0x800000) address = -(address&0x7fffff);   
185
186   print("BL %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
187   return size;
188}
189
190int arcompact_handle01_01_00_00_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BREQ b - c"); }
191int arcompact_handle01_01_00_01_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRNE b - c"); }
192int arcompact_handle01_01_00_02_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLT b - c"); }
193int arcompact_handle01_01_00_03_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRGE b - c"); }
194int arcompact_handle01_01_00_04_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLO b - c"); }
195int arcompact_handle01_01_00_05_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRHS b - c"); }
196int arcompact_handle01_01_00_0e_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT0 (b & 1<<c) == 0");  }
197int arcompact_handle01_01_00_0f_dasm(DASM_OPS_32)  { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT1 (b & 1<<c) != 0");  }
198
199
200int arcompact_handle01_01_01_00_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BREQ b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
201int arcompact_handle01_01_01_01_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BRNE b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
202int arcompact_handle01_01_01_02_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BRLT b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
203int arcompact_handle01_01_01_03_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BRGE b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
204int arcompact_handle01_01_01_04_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BRLO b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
205int arcompact_handle01_01_01_05_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BRHS b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
206
207
208int arcompact_handle01_01_01_0e_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BBIT0 (b & 1<<u6) == 0 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
209int arcompact_handle01_01_01_0f_dasm(DASM_OPS_32)  { GET_01_01_01_BRANCH_ADDR;  print("BBIT1 (b & 1<<u6) != 0 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; }
210
211
212int arcompact_handle02_dasm(DASM_OPS_32)
213{
214   // bitpos
215   // 11111 111 11111111 0 000 0 00 00 0 000000
216   // fedcb a98 76543210 f edc b a9 87 6 543210
217   // fields
218   // 00010 bbb ssssssss S BBB D aa ZZ X AAAAAA
219#if 0   
220   int A = (op & 0x0000003f >> 0);  op &= ~0x0000003f;
221   int X = (op & 0x00000040 >> 6);  op &= ~0x00000040;
222   int Z = (op & 0x00000180 >> 7);  op &= ~0x00000180;
223   int a = (op & 0x00000600 >> 9);  op &= ~0x00000600;
224   int D = (op & 0x00000800 >> 11); op &= ~0x00000800;
225   int B = (op & 0x00007000 >> 12); op &= ~0x00007000;
226   int S = (op & 0x00008000 >> 15); op &= ~0x00008000;
227   int s = (op & 0x00ff0000 >> 16); op &= ~0x00ff0000;
228   int b = (op & 0x07000000 >> 24); op &= ~0x07000000;
229#endif
230
231   print("LD r+o (%08x)", op );
232   return 4;
233}
234
235int arcompact_handle03_dasm(DASM_OPS_32)
236{
237   // bitpos
238   // 11111 111 11111111 0 000 000000 0 00 00 0
239   // fedcb a98 76543210 f edc ba9876 5 43 21 0
240   // fields
241   // 00011 bbb ssssssss S BBB CCCCCC D aa ZZ R
242
243   print("ST r+o (%08x)", op );
244   return 4;
245}
246
247int arcompact_handle04_00_dasm(DASM_OPS_32)  { print("ADD (%08x)", op); return 4;}
248int arcompact_handle04_01_dasm(DASM_OPS_32)  { print("ADC (%08x)", op); return 4;}
249int arcompact_handle04_02_dasm(DASM_OPS_32)  { print("SUB (%08x)", op); return 4;}
250int arcompact_handle04_03_dasm(DASM_OPS_32)  { print("SBC (%08x)", op); return 4;}
251int arcompact_handle04_04_dasm(DASM_OPS_32)  { print("AND (%08x)", op); return 4;}
252int arcompact_handle04_05_dasm(DASM_OPS_32)  { print("OR (%08x)", op); return 4;}
253int arcompact_handle04_06_dasm(DASM_OPS_32)  { print("BIC (%08x)", op); return 4;}
254int arcompact_handle04_07_dasm(DASM_OPS_32)  { print("XOR (%08x)", op); return 4;}
255int arcompact_handle04_08_dasm(DASM_OPS_32)  { print("MAX (%08x)", op); return 4;}
256int arcompact_handle04_09_dasm(DASM_OPS_32)  { print("MIN (%08x)", op); return 4;}
257int arcompact_handle04_0a_dasm(DASM_OPS_32)  { print("MOV (%08x)", op); return 4;}
258int arcompact_handle04_0b_dasm(DASM_OPS_32)  { print("TST (%08x)", op); return 4;}
259int arcompact_handle04_0c_dasm(DASM_OPS_32)  { print("CMP (%08x)", op); return 4;}
260int arcompact_handle04_0d_dasm(DASM_OPS_32)  { print("RCMP (%08x)", op); return 4;}
261int arcompact_handle04_0e_dasm(DASM_OPS_32)  { print("RSUB (%08x)", op); return 4;}
262int arcompact_handle04_0f_dasm(DASM_OPS_32)  { print("BSET (%08x)", op); return 4;}
263int arcompact_handle04_10_dasm(DASM_OPS_32)  { print("BCLR (%08x)", op); return 4;}
264int arcompact_handle04_11_dasm(DASM_OPS_32)  { print("BTST (%08x)", op); return 4;}
265int arcompact_handle04_12_dasm(DASM_OPS_32)  { print("BXOR (%08x)", op); return 4;}
266int arcompact_handle04_13_dasm(DASM_OPS_32)  { print("BMSK (%08x)", op); return 4;}
267int arcompact_handle04_14_dasm(DASM_OPS_32)  { print("ADD1 (%08x)", op); return 4;}
268int arcompact_handle04_15_dasm(DASM_OPS_32)  { print("ADD2 (%08x)", op); return 4;}
269int arcompact_handle04_16_dasm(DASM_OPS_32)  { print("ADD3 (%08x)", op); return 4;}
270int arcompact_handle04_17_dasm(DASM_OPS_32)  { print("SUB1 (%08x)", op); return 4;}
271int arcompact_handle04_18_dasm(DASM_OPS_32)  { print("SUB2 (%08x)", op); return 4;}
272int arcompact_handle04_19_dasm(DASM_OPS_32)  { print("SUB3 (%08x)", op); return 4;}
273int arcompact_handle04_1a_dasm(DASM_OPS_32)  { print("MPY (%08x)", op); return 4;} // *
274int arcompact_handle04_1b_dasm(DASM_OPS_32)  { print("MPYH (%08x)", op); return 4;} // *
275int arcompact_handle04_1c_dasm(DASM_OPS_32)  { print("MPYHU (%08x)", op); return 4;} // *
276int arcompact_handle04_1d_dasm(DASM_OPS_32)  { print("MPYU (%08x)", op); return 4;} // *
277
278
279
280int arcompact_handle04_20_dasm(DASM_OPS_32)
281{
282   // todo, other bits (in none long immediate mode at least)
283
284   int size = 4;
285   int C = (op & 0x00000fc0) >> 6;
286   UINT8 condition = op & 0x0000001f;
287
288   op &= ~0x00000fc0;
289   
290   if (C == LIMM_REG)
291   {
292      UINT32 limm;
293      GET_LIMM_32;
294      size = 8;
295     
296      print("J(%s) %08x (%08x)", conditions[condition], limm, op);
297   }
298   else
299   {
300      print("J(%s) (r%d) (%08x)", conditions[condition], C, op);
301   }
302
303   return size;
304}
305
306
307
308int arcompact_handle04_21_dasm(DASM_OPS_32)  { print("Jcc.D (%08x)", op); return 4;}
309int arcompact_handle04_22_dasm(DASM_OPS_32)  { print("JLcc (%08x)", op); return 4;}
310int arcompact_handle04_23_dasm(DASM_OPS_32)  { print("JLcc.D (%08x)", op); return 4;}
311
312
313
314
315int arcompact_handle04_28_dasm(DASM_OPS_32)  { print("LPcc (%08x)", op); return 4;}
316int arcompact_handle04_29_dasm(DASM_OPS_32)  { print("FLAG (%08x)", op); return 4;}
317int arcompact_handle04_2a_dasm(DASM_OPS_32)  { print("LR (%08x)", op); return 4;}
318int arcompact_handle04_2b_dasm(DASM_OPS_32)  { print("SR (%08x)", op); return 4;}
319
320
321
322int arcompact_handle04_2f_00_dasm(DASM_OPS_32)  { print("ASL (%08x)", op); return 4;} // ASL
323int arcompact_handle04_2f_01_dasm(DASM_OPS_32)  { print("ASR (%08x)", op); return 4;} // ASR
324int arcompact_handle04_2f_02_dasm(DASM_OPS_32)  { print("LSR (%08x)", op); return 4;} // LSR
325int arcompact_handle04_2f_03_dasm(DASM_OPS_32)  { print("ROR (%08x)", op); return 4;} // ROR
326int arcompact_handle04_2f_04_dasm(DASM_OPS_32)  { print("RCC (%08x)", op); return 4;} // RCC
327int arcompact_handle04_2f_05_dasm(DASM_OPS_32)  { print("SEXB (%08x)", op); return 4;} // SEXB
328int arcompact_handle04_2f_06_dasm(DASM_OPS_32)  { print("SEXW (%08x)", op); return 4;} // SEXW
329int arcompact_handle04_2f_07_dasm(DASM_OPS_32)  { print("EXTB (%08x)", op); return 4;} // EXTB
330int arcompact_handle04_2f_08_dasm(DASM_OPS_32)  { print("EXTW (%08x)", op); return 4;} // EXTW
331int arcompact_handle04_2f_09_dasm(DASM_OPS_32)  { print("ABS (%08x)", op); return 4;} // ABS
332int arcompact_handle04_2f_0a_dasm(DASM_OPS_32)  { print("NOT (%08x)", op); return 4;} // NOT
333int arcompact_handle04_2f_0b_dasm(DASM_OPS_32)  { print("RLC (%08x)", op); return 4;} // RLC
334int arcompact_handle04_2f_0c_dasm(DASM_OPS_32)  { print("EX (%08x)", op); return 4;} // EX
335
336
337int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32)  { print("SLEEP (%08x)", op); return 4;}
338int arcompact_handle04_2f_3f_02_dasm(DASM_OPS_32)  { print("SWI / TRAP0 (%08x)", op); return 4;}
339int arcompact_handle04_2f_3f_03_dasm(DASM_OPS_32)  { print("SYNC (%08x)", op); return 4;}
340int arcompact_handle04_2f_3f_04_dasm(DASM_OPS_32)  { print("RTIE (%08x)", op); return 4;}
341int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32)  { print("BRK (%08x)", op); return 4;}
342
343
344
345
346
347
348
349int arcompact_handle04_30_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x30) (%08x)", op); return 4;}
350int arcompact_handle04_31_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x31) (%08x)", op); return 4;}
351int arcompact_handle04_32_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x32) (%08x)", op); return 4;}
352int arcompact_handle04_33_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x33) (%08x)", op); return 4;}
353int arcompact_handle04_34_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x34) (%08x)", op); return 4;}
354int arcompact_handle04_35_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x35) (%08x)", op); return 4;}
355int arcompact_handle04_36_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x36) (%08x)", op); return 4;}
356int arcompact_handle04_37_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x37) (%08x)", op); return 4;}
357
358
359
360
361
362
363int arcompact_handle05_00_dasm(DASM_OPS_32)  { print("ASL a <- b asl c (%08x)", op); return 4;}
364int arcompact_handle05_01_dasm(DASM_OPS_32)  { print("LSR a <- b lsr c (%08x)", op); return 4;}
365int arcompact_handle05_02_dasm(DASM_OPS_32)  { print("ASR a <- b asr c (%08x)", op); return 4;}
366int arcompact_handle05_03_dasm(DASM_OPS_32)  { print("ROR a <- b ror c (%08x)", op); return 4;}
367int arcompact_handle05_04_dasm(DASM_OPS_32)  { print("MUL64 mulres <- b * c (%08x)", op); return 4;}
368int arcompact_handle05_05_dasm(DASM_OPS_32)  { print("MULU64 mulres <- b * c (%08x)", op); return 4;}
369int arcompact_handle05_06_dasm(DASM_OPS_32)  { print("ADDS a <- sat32 (b + c) (%08x)", op); return 4;}
370int arcompact_handle05_07_dasm(DASM_OPS_32)  { print("SUBS a <- sat32 (b + c) (%08x)", op); return 4;}
371int arcompact_handle05_08_dasm(DASM_OPS_32)  { print("DIVAW (%08x)", op); return 4;}
372
373
374
375int arcompact_handle05_0a_dasm(DASM_OPS_32)  { print("ASLS a <- sat32 (b << c) (%08x)", op); return 4;}
376int arcompact_handle05_0b_dasm(DASM_OPS_32)  { print("ASRS a ,- sat32 (b >> c) (%08x)", op); return 4;}
377
378int arcompact_handle05_28_dasm(DASM_OPS_32)  { print("ADDSDW (%08x)", op); return 4;}
379int arcompact_handle05_29_dasm(DASM_OPS_32)  { print("SUBSDW (%08x)", op); return 4;}
380
381
382int arcompact_handle05_2f_dasm(DASM_OPS_32)  { print("SOP (another table) (%08x)", op); return 4;}
383
384
385
386
387int arcompact_handle06_dasm(DASM_OPS_32)
388{
389   print("op a,b,c (06 ARC ext) (%08x)", op );
390   return 4;
391}
392
393int arcompact_handle07_dasm(DASM_OPS_32)
394{
395   print("op a,b,c (07 User ext) (%08x)", op );
396   return 4;
397}
398
399int arcompact_handle08_dasm(DASM_OPS_32)
400{
401   print("op a,b,c (08 User ext) (%08x)", op );
402   return 4;
403}
404
405int arcompact_handle09_dasm(DASM_OPS_32)
406{
407   print("op a,b,c (09 Market ext) (%08x)", op );
408   return 4;
409}
410
411int arcompact_handle0a_dasm(DASM_OPS_32)
412{
413   print("op a,b,c (0a Market ext) (%08x)",  op );
414   return 4;
415}
416
417int arcompact_handle0b_dasm(DASM_OPS_32)
418{
419   print("op a,b,c (0b Market ext) (%08x)",  op );
420   return 4;
421}
422
423
424
425
426
427
428int arcompact_handle0c_00_dasm(DASM_OPS_16)
429{
430   int size = 2;
431   print("LD_S a <- m[b + c].long (%04x)", op);
432   return size;
433}
434
435int arcompact_handle0c_01_dasm(DASM_OPS_16)
436{
437   int size = 2;
438   print("LDB_S a <- m[b + c].byte (%04x)", op);
439   return size;
440}
441
442int arcompact_handle0c_02_dasm(DASM_OPS_16)
443{
444   int size = 2;
445   print("LDW_S a <- m[b + c].word (%04x)", op);
446   return size;
447}
448
449int arcompact_handle0c_03_dasm(DASM_OPS_16)
450{
451   int size = 2;
452   print("ADD_S a <- b + c (%04x)", op);
453   return size;
454}
455
456
457
458int arcompact_handle0d_00_dasm(DASM_OPS_16)
459{
460   int size = 2;
461   print("ADD_S c <- b + u3 (%04x)", op);
462   return size;
463}
464
465int arcompact_handle0d_01_dasm(DASM_OPS_16)
466{
467   int size = 2;
468   print("SUB_S c <- b - u3 (%04x)", op);
469   return size;
470}
471
472int arcompact_handle0d_02_dasm(DASM_OPS_16)
473{
474   int size = 2;
475   print("ASL_S c <- b asl u3 (%04x)", op);
476   return size;
477}
478
479int arcompact_handle0d_03_dasm(DASM_OPS_16)
480{
481   int size = 2;
482   print("ASL_S c <- b asr u3 (%04x)", op);
483   return size;
484}
485
486
487
488
489
490
491int arcompact_handle0e_00_dasm(DASM_OPS_16)
492{
493   int h;
494   int size = 2;
495
496   GROUP_0e_GET_h;
497
498   if (h == LIMM_REG)
499   {
500      UINT32 limm;
501      GET_LIMM;
502      size = 6;
503      print("ADD_S b <- b + (%08x) (%04x)", limm, op);
504   }
505   else
506   {
507
508      print("ADD_S b <- b + (r%d) (%04x)", h, op);
509   }
510
511   return size;
512}
513
514int arcompact_handle0e_01_dasm(DASM_OPS_16)
515{
516   int h;
517   int size = 2;
518   GROUP_0e_GET_h;
519
520   if (h == LIMM_REG)
521   {
522      UINT32 limm;
523      GET_LIMM;
524      size = 6;
525      print("MOV_S b <- (%08x)  (%04x)", limm, op);
526   }
527   else
528   {
529      print("MOV_S b <- (r%d)  (%04x)", h, op);
530   }
531   return size;
532}
533
534int arcompact_handle0e_02_dasm(DASM_OPS_16)
535{
536   int h;
537   int size = 2;
538   GROUP_0e_GET_h;
539
540   if (h == LIMM_REG)
541   {
542      UINT32 limm;
543      GET_LIMM;
544      size = 6;
545      print("CMP_S b - (%08x) (%04x)", limm, op);
546   }
547   else
548   {
549      print("CMP_S b - (r%d) (%04x)", h, op);
550   }
551   return size;
552}
553
554int arcompact_handle0e_03_dasm(DASM_OPS_16)
555{
556   int h;
557   int size = 2;
558   GROUP_0e_GET_h;
559
560   if (h == LIMM_REG)
561   {
562      UINT32 limm;
563      GET_LIMM;
564      size = 6;
565      print("MOV_S (%08x) <- b (%04x)", limm, op);
566   }
567   else
568   {
569      print("MOV_S (r%d) <- b (%04x)", h, op);
570   }
571
572   return size;
573}
574
575
576
577
578
579int arcompact_handle0f_00_00_dasm(DASM_OPS_16)  { print("J_S pc <- b (%08x)", op); return 2;}
580int arcompact_handle0f_00_01_dasm(DASM_OPS_16)  { print("J_S.D pc <- b (%08x)", op); return 2;}
581int arcompact_handle0f_00_02_dasm(DASM_OPS_16)  { print("JL_S blink <- pc; pc <- b (%08x)", op); return 2;}
582int arcompact_handle0f_00_03_dasm(DASM_OPS_16)  { print("L_S.D blink <- pc; pc <- b( %08x)", op); return 2;}
583int arcompact_handle0f_00_06_dasm(DASM_OPS_16)  { print("SUB_S.NE if (f.Z==0) b <- b - b  (%08x)", op); return 2;}
584
585
586
587
588
589int arcompact_handle0f_00_07_00_dasm(DASM_OPS_16)  { print("NOP_S (%08x)", op); return 2;}
590int arcompact_handle0f_00_07_01_dasm(DASM_OPS_16)  { print("UNIMP_S (%08x)", op); return 2;} // Unimplemented Instruction (how does this differ from illegal ops?)
591
592
593
594int arcompact_handle0f_00_07_04_dasm(DASM_OPS_16)  { print("JEQ_S [blink] (%08x)", op); return 2;}
595int arcompact_handle0f_00_07_05_dasm(DASM_OPS_16)  { print("JNE_S [blink]  (%08x)", op); return 2;}
596int arcompact_handle0f_00_07_06_dasm(DASM_OPS_16)  { print("J_S [blink]  (%08x)", op); return 2;}
597int arcompact_handle0f_00_07_07_dasm(DASM_OPS_16)  { print("J_S.D [blink] (%08x)", op); return 2;}
598
599
600int arcompact_handle0f_02_dasm(DASM_OPS_16)  { print("SUB_S b <- b - c (%08x)", op); return 2;}
601
602
603int arcompact_handle0f_04_dasm(DASM_OPS_16)  { print("AND_S b <- b and c (%08x)", op); return 2;}
604int arcompact_handle0f_05_dasm(DASM_OPS_16)  { print("OR_S b <- b or c (%08x)", op); return 2;}
605int arcompact_handle0f_06_dasm(DASM_OPS_16)  { print("BIC_S b <- b & !c (%08x)", op); return 2;}
606int arcompact_handle0f_07_dasm(DASM_OPS_16)  { print("XOR_S b <- b ^ c (%08x)", op); return 2;}
607
608
609int arcompact_handle0f_0b_dasm(DASM_OPS_16)  { print("TST_S b & c (%08x)", op); return 2;}
610int arcompact_handle0f_0c_dasm(DASM_OPS_16)  { print("MUL64_S mulres <- b * c  (%08x)", op); return 2;}
611int arcompact_handle0f_0d_dasm(DASM_OPS_16)  { print("SEXB_S b <- sexb(c) (%08x)", op); return 2;}
612int arcompact_handle0f_0e_dasm(DASM_OPS_16)  { print("SEXW_S b <- sexw(c) (%08x)", op); return 2;}
613int arcompact_handle0f_0f_dasm(DASM_OPS_16)  { print("EXTB_S b <- extb(c) (%08x)", op); return 2;}
614int arcompact_handle0f_10_dasm(DASM_OPS_16)  { print("EXTW_S b <- extw(c) (%08x)", op); return 2;}
615int arcompact_handle0f_11_dasm(DASM_OPS_16)  { print("ABS_S b <- abs(c)  (%08x)", op); return 2;}
616int arcompact_handle0f_12_dasm(DASM_OPS_16)  { print("NOT_S b <- !(c) (%08x)", op); return 2;}
617int arcompact_handle0f_13_dasm(DASM_OPS_16)  { print("NEG_S b <- neg(c)  (%08x)", op); return 2;}
618int arcompact_handle0f_14_dasm(DASM_OPS_16)  { print("ADD1_S b <- b + (c << 1) (%08x)", op); return 2;}
619int arcompact_handle0f_15_dasm(DASM_OPS_16)  { print("ADD2_S b <- b + (c << 2) (%08x)", op); return 2;}
620int arcompact_handle0f_16_dasm(DASM_OPS_16)  { print("ADD3_S b <- b + (c << 3)  (%08x)", op); return 2;}
621
622
623int arcompact_handle0f_18_dasm(DASM_OPS_16)  { print("ASL_S b <- b asl c (%08x)", op); return 2;}
624int arcompact_handle0f_19_dasm(DASM_OPS_16)  { print("LSR_S b <- b lsr c (%08x)", op); return 2;}
625int arcompact_handle0f_1a_dasm(DASM_OPS_16)  { print("ASR_S b <- b asr c (%08x)", op); return 2;}
626int arcompact_handle0f_1b_dasm(DASM_OPS_16)  { print("ASL_S b <- c + c (%08x)", op); return 2;}
627int arcompact_handle0f_1c_dasm(DASM_OPS_16)  { print("ASR_S b <- c asr 1 (%08x)", op); return 2;}
628int arcompact_handle0f_1d_dasm(DASM_OPS_16)  { print("LSR_S b <- c lsr 1(%08x)", op); return 2;}
629int arcompact_handle0f_1e_dasm(DASM_OPS_16)  { print("TRAP_S (%08x)", op); return 2;}
630int arcompact_handle0f_1f_dasm(DASM_OPS_16)  { print("BRK_S (%08x)", op); return 2;}
631
632
633int arcompact_handle10_dasm(DASM_OPS_16)
634{
635   print("LD_S (%04x)",  op);
636   return 2;
637}
638
639int arcompact_handle11_dasm(DASM_OPS_16)
640{
641   print("LDB_S (%04x)", op);
642   return 2;
643}
644
645int arcompact_handle12_dasm(DASM_OPS_16)
646{
647   print("LDW_S (%04x)", op);
648   return 2;
649}
650
651int arcompact_handle13_dasm(DASM_OPS_16)
652{
653   print("LSW_S.X (%04x)", op);
654   return 2;
655}
656
657int arcompact_handle14_dasm(DASM_OPS_16)
658{
659   print("ST_S (%04x)", op);
660   return 2;
661}
662
663int arcompact_handle15_dasm(DASM_OPS_16)
664{
665   print("STB_S (%04x)", op);
666   return 2;
667}
668
669int arcompact_handle16_dasm(DASM_OPS_16)
670{
671   print("STW_S (%04x)",  op);
672   return 2;
673}
674
675
676int arcompact_handle17_00_dasm(DASM_OPS_16)
677{
678   int size = 2;
679   print("ASL_S b <- b asl u5 (%04x)",  op);
680   return size;
681}
682
683int arcompact_handle17_01_dasm(DASM_OPS_16)
684{
685   int size = 2;
686   print("LSR_S b <- b lsr u5 (%04x)",  op);
687   return size;
688}
689
690int arcompact_handle17_02_dasm(DASM_OPS_16)
691{
692   int size = 2;
693   print("ASR_S b <- b asr u5 (%04x)",  op);
694   return size;
695}
696
697int arcompact_handle17_03_dasm(DASM_OPS_16)
698{
699   int size = 2;
700   print("SUB_S b <- b - u5 (%04x)",  op);
701   return size;
702}
703
704int arcompact_handle17_04_dasm(DASM_OPS_16)
705{
706   int size = 2;
707   print("BSET_S b <- b | (1 << u5) (%04x)",  op);
708   return size;
709}
710
711int arcompact_handle17_05_dasm(DASM_OPS_16)
712{
713   int size = 2;
714   print("BCLR_S b <- b & !(1 << u5) (%04x)",  op);
715   return size;
716}
717
718int arcompact_handle17_06_dasm(DASM_OPS_16)
719{
720   int size = 2;
721   print("BMSK_S (%04x)",  op);
722   return size;
723}
724
725int arcompact_handle17_07_dasm(DASM_OPS_16)
726{
727   int size = 2;
728   print("BTST_S (%04x)",  op);
729   return size;
730}
731
732
733// op bits remaining for 0x18_xx subgroups 0x071f
734
735int arcompact_handle18_00_dasm(DASM_OPS_16)
736{
737   print("LD_S (SP) (%04x)",  op);
738   return 2;
739}
740
741int arcompact_handle18_01_dasm(DASM_OPS_16)
742{
743   print("LDB_S (SP) (%04x)",  op);
744   return 2;
745}
746
747int arcompact_handle18_02_dasm(DASM_OPS_16)
748{
749   print("ST_S (SP) (%04x)",  op);
750   return 2;
751}
752
753int arcompact_handle18_03_dasm(DASM_OPS_16)
754{
755   print("STB_S (SP) (%04x)",  op);
756   return 2;
757}
758
759int arcompact_handle18_04_dasm(DASM_OPS_16)
760{
761   print("ADD_S (SP) (%04x)",  op);
762   return 2;
763}
764
765// op bits remaining for 0x18_05_xx subgroups 0x001f
766int arcompact_handle18_05_00_dasm(DASM_OPS_16)
767{
768   int u = op & 0x001f;
769   op &= ~0x001f; // all bits now used
770
771   print("ADD_S %02x (SP)", u);
772   return 2;
773
774}
775
776int arcompact_handle18_05_01_dasm(DASM_OPS_16)
777{
778   int u = op & 0x001f;
779   op &= ~0x001f; // all bits now used
780
781   print("SUB_S %02x (SP)", u);
782   return 2;
783}
784
785// op bits remaining for 0x18_06_xx subgroups 0x0700
786int arcompact_handle18_06_01_dasm(DASM_OPS_16)
787{
788   int b = (op & 0x0700) >> 8;
789   op &= ~0x0700; // all bits now used
790
791   print("POP_S [%02x]", b);
792
793   return 2;
794}
795
796int arcompact_handle18_06_11_dasm(DASM_OPS_16)
797{
798   int res = (op & 0x0700) >> 8;
799   op &= ~0x0700; // all bits now used
800
801   if (res)
802      print("POP_S [BLINK] (Reserved Bits set %04x)", op);
803   else
804      print("POP_S [BLINK]");
805
806   return 2;
807}
808
809// op bits remaining for 0x18_07_xx subgroups 0x0700
810int arcompact_handle18_07_01_dasm(DASM_OPS_16)
811{
812   int b = (op & 0x0700) >> 8;
813   op &= ~0x0700; // all bits now used
814
815   print("PUSH_S [%02x]", b);
816
817   return 2;
818}
819
820
821int arcompact_handle18_07_11_dasm(DASM_OPS_16)
822{
823   int res = (op & 0x0700) >> 8;
824   op &= ~0x0700; // all bits now used
825
826   if (res)
827      print("PUSH_S [BLINK] (Reserved Bits set %04x)", op);
828   else
829      print("PUSH_S [BLINK]");
830
831   return 2;
832}
833
834int arcompact_handle19_00_dasm(DASM_OPS_16)  { print("LD_S r0 <- m[GP + s11].long (%04x)",  op); return 2;}
835int arcompact_handle19_01_dasm(DASM_OPS_16)  { print("LDB_S r0 <- m[GP + s9].byte (%04x)",  op); return 2;}
836int arcompact_handle19_02_dasm(DASM_OPS_16)  { print("LDW_S r0 <- m[GP + s10].word (%04x)",  op); return 2;}
837int arcompact_handle19_03_dasm(DASM_OPS_16)  { print("ADD_S r0 <- GP + s11 (%04x)",  op); return 2;}
838
839int arcompact_handle1a_dasm(DASM_OPS_16)
840{
841   print("PCL Instr (%04x)", op);
842   return 2;
843}
844
845int arcompact_handle1b_dasm(DASM_OPS_16)
846{
847   print("MOV_S (%04x)", op);
848   return 2;
849}
850
851int arcompact_handle1c_00_dasm(DASM_OPS_16)  { print("ADD_S b <- b + u7 (%04x)",  op); return 2;}
852int arcompact_handle1c_01_dasm(DASM_OPS_16)  { print("CMP_S b - u7 (%04x)",  op); return 2;}
853
854
855int arcompact_handle1d_00_dasm(DASM_OPS_16)  { print("BREQ_S (%04x)",  op); return 2;}
856int arcompact_handle1d_01_dasm(DASM_OPS_16)  { print("BRNE_S (%04x)",  op); return 2;}
857
858
859int arcompact_handle1e_00_dasm(DASM_OPS_16)  { print("B_S (%04x)",  op); return 2;}
860int arcompact_handle1e_01_dasm(DASM_OPS_16)  { print("BEQ_S (%04x)",  op); return 2;}
861int arcompact_handle1e_02_dasm(DASM_OPS_16)  { print("BNE_S (%04x)",  op); return 2;}
862
863int arcompact_handle1e_03_00_dasm(DASM_OPS_16)  { print("BGT_S (%04x)",  op); return 2;}
864int arcompact_handle1e_03_01_dasm(DASM_OPS_16)  { print("BGE_S (%04x)",  op); return 2;}
865int arcompact_handle1e_03_02_dasm(DASM_OPS_16)  { print("BLT_S (%04x)",  op); return 2;}
866int arcompact_handle1e_03_03_dasm(DASM_OPS_16)  { print("BLE_S (%04x)",  op); return 2;}
867int arcompact_handle1e_03_04_dasm(DASM_OPS_16)  { print("BHI_S (%04x)",  op); return 2;}
868int arcompact_handle1e_03_05_dasm(DASM_OPS_16)  { print("BHS_S (%04x)",  op); return 2;}
869int arcompact_handle1e_03_06_dasm(DASM_OPS_16)  { print("BLO_S (%04x)",  op); return 2;}
870int arcompact_handle1e_03_07_dasm(DASM_OPS_16)  { print("BLS_S (%04x)",  op); return 2;}
871
872int arcompact_handle1f_dasm(DASM_OPS_16)
873{
874   print("BL_S (%04x)", op);
875   return 2;
876}
877
878/************************************************************************************************************************************
879*                                                                                                                                   *
880* illegal opcode handlers (disassembly)                                                                                             *
881*                                                                                                                                   *
882************************************************************************************************************************************/
883
884int arcompact_handle01_01_00_06_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_06> (%08x)", op); return 4; }
885int arcompact_handle01_01_00_07_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_07> (%08x)", op); return 4; }
886int arcompact_handle01_01_00_08_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_08> (%08x)", op); return 4; }
887int arcompact_handle01_01_00_09_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_09> (%08x)", op); return 4; }
888int arcompact_handle01_01_00_0a_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_0a> (%08x)", op); return 4; }
889int arcompact_handle01_01_00_0b_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_0b> (%08x)", op); return 4; }
890int arcompact_handle01_01_00_0c_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_0c> (%08x)", op); return 4; }
891int arcompact_handle01_01_00_0d_dasm(DASM_OPS_32)  { print("<illegal 01_01_00_0d> (%08x)", op); return 4; }
892
893int arcompact_handle01_01_01_06_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_06> (%08x)", op); return 4; }
894int arcompact_handle01_01_01_07_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_07> (%08x)", op); return 4; }
895int arcompact_handle01_01_01_08_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_08> (%08x)", op); return 4; }
896int arcompact_handle01_01_01_09_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_09> (%08x)", op); return 4; }
897int arcompact_handle01_01_01_0a_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_0a> (%08x)", op); return 4; }
898int arcompact_handle01_01_01_0b_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_0b> (%08x)", op); return 4; }
899int arcompact_handle01_01_01_0c_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_0c> (%08x)", op); return 4; }
900int arcompact_handle01_01_01_0d_dasm(DASM_OPS_32)  { print("<illegal 01_01_01_0d> (%08x)", op); return 4; }
901
902
903int arcompact_handle04_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_1e> (%08x)", op); return 4;}
904int arcompact_handle04_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_1f> (%08x)", op); return 4;}
905
906int arcompact_handle04_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_24> (%08x)", op); return 4;}
907int arcompact_handle04_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_25> (%08x)", op); return 4;}
908int arcompact_handle04_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_26> (%08x)", op); return 4;}
909int arcompact_handle04_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_27> (%08x)", op); return 4;}
910
911int arcompact_handle04_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2c> (%08x)", op); return 4;}
912int arcompact_handle04_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2d> (%08x)", op); return 4;}
913int arcompact_handle04_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2e> (%08x)", op); return 4;}
914
915int arcompact_handle04_2f_0d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0d> (%08x)", op); return 4;}
916int arcompact_handle04_2f_0e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0e> (%08x)", op); return 4;}
917int arcompact_handle04_2f_0f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0f> (%08x)", op); return 4;}
918int arcompact_handle04_2f_10_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_10> (%08x)", op); return 4;}
919int arcompact_handle04_2f_11_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_11> (%08x)", op); return 4;}
920int arcompact_handle04_2f_12_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_12> (%08x)", op); return 4;}
921int arcompact_handle04_2f_13_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_13> (%08x)", op); return 4;}
922int arcompact_handle04_2f_14_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_14> (%08x)", op); return 4;}
923int arcompact_handle04_2f_15_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_15> (%08x)", op); return 4;}
924int arcompact_handle04_2f_16_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_16> (%08x)", op); return 4;}
925int arcompact_handle04_2f_17_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_17> (%08x)", op); return 4;}
926int arcompact_handle04_2f_18_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_18> (%08x)", op); return 4;}
927int arcompact_handle04_2f_19_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_19> (%08x)", op); return 4;}
928int arcompact_handle04_2f_1a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1a> (%08x)", op); return 4;}
929int arcompact_handle04_2f_1b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1b> (%08x)", op); return 4;}
930int arcompact_handle04_2f_1c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1c> (%08x)", op); return 4;}
931int arcompact_handle04_2f_1d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1d> (%08x)", op); return 4;}
932int arcompact_handle04_2f_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1e> (%08x)", op); return 4;}
933int arcompact_handle04_2f_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1f> (%08x)", op); return 4;}
934int arcompact_handle04_2f_20_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_20> (%08x)", op); return 4;}
935int arcompact_handle04_2f_21_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_21> (%08x)", op); return 4;}
936int arcompact_handle04_2f_22_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_22> (%08x)", op); return 4;}
937int arcompact_handle04_2f_23_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_23> (%08x)", op); return 4;}
938int arcompact_handle04_2f_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_24> (%08x)", op); return 4;}
939int arcompact_handle04_2f_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_25> (%08x)", op); return 4;}
940int arcompact_handle04_2f_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_26> (%08x)", op); return 4;}
941int arcompact_handle04_2f_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_27> (%08x)", op); return 4;}
942int arcompact_handle04_2f_28_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_28> (%08x)", op); return 4;}
943int arcompact_handle04_2f_29_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_29> (%08x)", op); return 4;}
944int arcompact_handle04_2f_2a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2a> (%08x)", op); return 4;}
945int arcompact_handle04_2f_2b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2b> (%08x)", op); return 4;}
946int arcompact_handle04_2f_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2c> (%08x)", op); return 4;}
947int arcompact_handle04_2f_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2d> (%08x)", op); return 4;}
948int arcompact_handle04_2f_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2e> (%08x)", op); return 4;}
949int arcompact_handle04_2f_2f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2f> (%08x)", op); return 4;}
950int arcompact_handle04_2f_30_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_30> (%08x)", op); return 4;}
951int arcompact_handle04_2f_31_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_31> (%08x)", op); return 4;}
952int arcompact_handle04_2f_32_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_32> (%08x)", op); return 4;}
953int arcompact_handle04_2f_33_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_33> (%08x)", op); return 4;}
954int arcompact_handle04_2f_34_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_34> (%08x)", op); return 4;}
955int arcompact_handle04_2f_35_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_35> (%08x)", op); return 4;}
956int arcompact_handle04_2f_36_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_36> (%08x)", op); return 4;}
957int arcompact_handle04_2f_37_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_37> (%08x)", op); return 4;}
958int arcompact_handle04_2f_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_38> (%08x)", op); return 4;}
959int arcompact_handle04_2f_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_39> (%08x)", op); return 4;}
960int arcompact_handle04_2f_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3a> (%08x)", op); return 4;}
961int arcompact_handle04_2f_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3b> (%08x)", op); return 4;}
962int arcompact_handle04_2f_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3c> (%08x)", op); return 4;}
963int arcompact_handle04_2f_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3d> (%08x)", op); return 4;}
964int arcompact_handle04_2f_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3e> (%08x)", op); return 4;}
965
966int arcompact_handle04_2f_3f_00_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_00> (%08x)", op); return 4;}
967int arcompact_handle04_2f_3f_06_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_06> (%08x)", op); return 4;}
968int arcompact_handle04_2f_3f_07_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_07> (%08x)", op); return 4;}
969int arcompact_handle04_2f_3f_08_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_08> (%08x)", op); return 4;}
970int arcompact_handle04_2f_3f_09_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_09> (%08x)", op); return 4;}
971int arcompact_handle04_2f_3f_0a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0a> (%08x)", op); return 4;}
972int arcompact_handle04_2f_3f_0b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0b> (%08x)", op); return 4;}
973int arcompact_handle04_2f_3f_0c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0c> (%08x)", op); return 4;}
974int arcompact_handle04_2f_3f_0d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0d> (%08x)", op); return 4;}
975int arcompact_handle04_2f_3f_0e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0e> (%08x)", op); return 4;}
976int arcompact_handle04_2f_3f_0f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0f> (%08x)", op); return 4;}
977int arcompact_handle04_2f_3f_10_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_10> (%08x)", op); return 4;}
978int arcompact_handle04_2f_3f_11_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_11> (%08x)", op); return 4;}
979int arcompact_handle04_2f_3f_12_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_12> (%08x)", op); return 4;}
980int arcompact_handle04_2f_3f_13_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_13> (%08x)", op); return 4;}
981int arcompact_handle04_2f_3f_14_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_14> (%08x)", op); return 4;}
982int arcompact_handle04_2f_3f_15_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_15> (%08x)", op); return 4;}
983int arcompact_handle04_2f_3f_16_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_16> (%08x)", op); return 4;}
984int arcompact_handle04_2f_3f_17_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_17> (%08x)", op); return 4;}
985int arcompact_handle04_2f_3f_18_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_18> (%08x)", op); return 4;}
986int arcompact_handle04_2f_3f_19_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_19> (%08x)", op); return 4;}
987int arcompact_handle04_2f_3f_1a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1a> (%08x)", op); return 4;}
988int arcompact_handle04_2f_3f_1b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1b> (%08x)", op); return 4;}
989int arcompact_handle04_2f_3f_1c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1c> (%08x)", op); return 4;}
990int arcompact_handle04_2f_3f_1d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1d> (%08x)", op); return 4;}
991int arcompact_handle04_2f_3f_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1e> (%08x)", op); return 4;}
992int arcompact_handle04_2f_3f_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1f> (%08x)", op); return 4;}
993int arcompact_handle04_2f_3f_20_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_20> (%08x)", op); return 4;}
994int arcompact_handle04_2f_3f_21_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_21> (%08x)", op); return 4;}
995int arcompact_handle04_2f_3f_22_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_22> (%08x)", op); return 4;}
996int arcompact_handle04_2f_3f_23_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_23> (%08x)", op); return 4;}
997int arcompact_handle04_2f_3f_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_24> (%08x)", op); return 4;}
998int arcompact_handle04_2f_3f_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_25> (%08x)", op); return 4;}
999int arcompact_handle04_2f_3f_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_26> (%08x)", op); return 4;}
1000int arcompact_handle04_2f_3f_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_27> (%08x)", op); return 4;}
1001int arcompact_handle04_2f_3f_28_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_28> (%08x)", op); return 4;}
1002int arcompact_handle04_2f_3f_29_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_29> (%08x)", op); return 4;}
1003int arcompact_handle04_2f_3f_2a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2a> (%08x)", op); return 4;}
1004int arcompact_handle04_2f_3f_2b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2b> (%08x)", op); return 4;}
1005int arcompact_handle04_2f_3f_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2c> (%08x)", op); return 4;}
1006int arcompact_handle04_2f_3f_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2d> (%08x)", op); return 4;}
1007int arcompact_handle04_2f_3f_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2e> (%08x)", op); return 4;}
1008int arcompact_handle04_2f_3f_2f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2f> (%08x)", op); return 4;}
1009int arcompact_handle04_2f_3f_30_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_30> (%08x)", op); return 4;}
1010int arcompact_handle04_2f_3f_31_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_31> (%08x)", op); return 4;}
1011int arcompact_handle04_2f_3f_32_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_32> (%08x)", op); return 4;}
1012int arcompact_handle04_2f_3f_33_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_33> (%08x)", op); return 4;}
1013int arcompact_handle04_2f_3f_34_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_34> (%08x)", op); return 4;}
1014int arcompact_handle04_2f_3f_35_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_35> (%08x)", op); return 4;}
1015int arcompact_handle04_2f_3f_36_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_36> (%08x)", op); return 4;}
1016int arcompact_handle04_2f_3f_37_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_37> (%08x)", op); return 4;}
1017int arcompact_handle04_2f_3f_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_38> (%08x)", op); return 4;}
1018int arcompact_handle04_2f_3f_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_39> (%08x)", op); return 4;}
1019int arcompact_handle04_2f_3f_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3a> (%08x)", op); return 4;}
1020int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3b> (%08x)", op); return 4;}
1021int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3c> (%08x)", op); return 4;}
1022int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3d> (%08x)", op); return 4;}
1023int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3e> (%08x)", op); return 4;}
1024int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3f> (%08x)", op); return 4;}
1025
1026
1027
1028
1029int arcompact_handle04_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_38> (%08x)", op); return 4;}
1030int arcompact_handle04_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_39> (%08x)", op); return 4;}
1031int arcompact_handle04_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_3a> (%08x)", op); return 4;}
1032int arcompact_handle04_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_3b> (%08x)", op); return 4;}
1033int arcompact_handle04_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_3c> (%08x)", op); return 4;}
1034int arcompact_handle04_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_3d> (%08x)", op); return 4;}
1035int arcompact_handle04_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_3e> (%08x)", op); return 4;}
1036int arcompact_handle04_3f_dasm(DASM_OPS_32)  { print("<illegal 0x04_3f> (%08x)", op); return 4;}
1037
1038
1039int arcompact_handle05_09_dasm(DASM_OPS_32)  { print("<illegal 0x05_09> (%08x)", op); return 4;}
1040int arcompact_handle05_0c_dasm(DASM_OPS_32)  { print("<illegal 0x05_0c> (%08x)", op); return 4;}
1041int arcompact_handle05_0d_dasm(DASM_OPS_32)  { print("<illegal 0x05_0d> (%08x)", op); return 4;}
1042int arcompact_handle05_0e_dasm(DASM_OPS_32)  { print("<illegal 0x05_0e> (%08x)", op); return 4;}
1043int arcompact_handle05_0f_dasm(DASM_OPS_32)  { print("<illegal 0x05_0f> (%08x)", op); return 4;}
1044int arcompact_handle05_10_dasm(DASM_OPS_32)  { print("<illegal 0x05_10> (%08x)", op); return 4;}
1045int arcompact_handle05_11_dasm(DASM_OPS_32)  { print("<illegal 0x05_11> (%08x)", op); return 4;}
1046int arcompact_handle05_12_dasm(DASM_OPS_32)  { print("<illegal 0x05_12> (%08x)", op); return 4;}
1047int arcompact_handle05_13_dasm(DASM_OPS_32)  { print("<illegal 0x05_13> (%08x)", op); return 4;}
1048int arcompact_handle05_14_dasm(DASM_OPS_32)  { print("<illegal 0x05_14> (%08x)", op); return 4;}
1049int arcompact_handle05_15_dasm(DASM_OPS_32)  { print("<illegal 0x05_15> (%08x)", op); return 4;}
1050int arcompact_handle05_16_dasm(DASM_OPS_32)  { print("<illegal 0x05_16> (%08x)", op); return 4;}
1051int arcompact_handle05_17_dasm(DASM_OPS_32)  { print("<illegal 0x05_17> (%08x)", op); return 4;}
1052int arcompact_handle05_18_dasm(DASM_OPS_32)  { print("<illegal 0x05_18> (%08x)", op); return 4;}
1053int arcompact_handle05_19_dasm(DASM_OPS_32)  { print("<illegal 0x05_19> (%08x)", op); return 4;}
1054int arcompact_handle05_1a_dasm(DASM_OPS_32)  { print("<illegal 0x05_1a> (%08x)", op); return 4;}
1055int arcompact_handle05_1b_dasm(DASM_OPS_32)  { print("<illegal 0x05_1b> (%08x)", op); return 4;}
1056int arcompact_handle05_1c_dasm(DASM_OPS_32)  { print("<illegal 0x05_1c> (%08x)", op); return 4;}
1057int arcompact_handle05_1d_dasm(DASM_OPS_32)  { print("<illegal 0x05_1d> (%08x)", op); return 4;}
1058int arcompact_handle05_1e_dasm(DASM_OPS_32)  { print("<illegal 0x05_1e> (%08x)", op); return 4;}
1059int arcompact_handle05_1f_dasm(DASM_OPS_32)  { print("<illegal 0x05_1f> (%08x)", op); return 4;}
1060int arcompact_handle05_20_dasm(DASM_OPS_32)  { print("<illegal 0x05_20> (%08x)", op); return 4;}
1061int arcompact_handle05_21_dasm(DASM_OPS_32)  { print("<illegal 0x05_21> (%08x)", op); return 4;}
1062int arcompact_handle05_22_dasm(DASM_OPS_32)  { print("<illegal 0x05_22> (%08x)", op); return 4;}
1063int arcompact_handle05_23_dasm(DASM_OPS_32)  { print("<illegal 0x05_23> (%08x)", op); return 4;}
1064int arcompact_handle05_24_dasm(DASM_OPS_32)  { print("<illegal 0x05_24> (%08x)", op); return 4;}
1065int arcompact_handle05_25_dasm(DASM_OPS_32)  { print("<illegal 0x05_25> (%08x)", op); return 4;}
1066int arcompact_handle05_26_dasm(DASM_OPS_32)  { print("<illegal 0x05_26> (%08x)", op); return 4;}
1067int arcompact_handle05_27_dasm(DASM_OPS_32)  { print("<illegal 0x05_27> (%08x)", op); return 4;}
1068
1069int arcompact_handle05_2a_dasm(DASM_OPS_32)  { print("<illegal 0x05_2a> (%08x)", op); return 4;}
1070int arcompact_handle05_2b_dasm(DASM_OPS_32)  { print("<illegal 0x05_2b> (%08x)", op); return 4;}
1071int arcompact_handle05_2c_dasm(DASM_OPS_32)  { print("<illegal 0x05_2c> (%08x)", op); return 4;}
1072int arcompact_handle05_2d_dasm(DASM_OPS_32)  { print("<illegal 0x05_2d> (%08x)", op); return 4;}
1073int arcompact_handle05_2e_dasm(DASM_OPS_32)  { print("<illegal 0x05_2e> (%08x)", op); return 4;}
1074
1075int arcompact_handle05_30_dasm(DASM_OPS_32)  { print("<illegal 0x05_30> (%08x)", op); return 4;}
1076int arcompact_handle05_31_dasm(DASM_OPS_32)  { print("<illegal 0x05_31> (%08x)", op); return 4;}
1077int arcompact_handle05_32_dasm(DASM_OPS_32)  { print("<illegal 0x05_32> (%08x)", op); return 4;}
1078int arcompact_handle05_33_dasm(DASM_OPS_32)  { print("<illegal 0x05_33> (%08x)", op); return 4;}
1079int arcompact_handle05_34_dasm(DASM_OPS_32)  { print("<illegal 0x05_34> (%08x)", op); return 4;}
1080int arcompact_handle05_35_dasm(DASM_OPS_32)  { print("<illegal 0x05_35> (%08x)", op); return 4;}
1081int arcompact_handle05_36_dasm(DASM_OPS_32)  { print("<illegal 0x05_36> (%08x)", op); return 4;}
1082int arcompact_handle05_37_dasm(DASM_OPS_32)  { print("<illegal 0x05_37> (%08x)", op); return 4;}
1083int arcompact_handle05_38_dasm(DASM_OPS_32)  { print("<illegal 0x05_38> (%08x)", op); return 4;}
1084int arcompact_handle05_39_dasm(DASM_OPS_32)  { print("<illegal 0x05_39> (%08x)", op); return 4;}
1085int arcompact_handle05_3a_dasm(DASM_OPS_32)  { print("<illegal 0x05_3a> (%08x)", op); return 4;}
1086int arcompact_handle05_3b_dasm(DASM_OPS_32)  { print("<illegal 0x05_3b> (%08x)", op); return 4;}
1087int arcompact_handle05_3c_dasm(DASM_OPS_32)  { print("<illegal 0x05_3c> (%08x)", op); return 4;}
1088int arcompact_handle05_3d_dasm(DASM_OPS_32)  { print("<illegal 0x05_3d> (%08x)", op); return 4;}
1089int arcompact_handle05_3e_dasm(DASM_OPS_32)  { print("<illegal 0x05_3e> (%08x)", op); return 4;}
1090int arcompact_handle05_3f_dasm(DASM_OPS_32)  { print("<illegal 0x05_3f> (%08x)", op); return 4;}
1091
1092int arcompact_handle0f_00_04_dasm(DASM_OPS_16)  { print("<illegal 0x0f_00_00> (%08x)", op); return 2;}
1093int arcompact_handle0f_00_05_dasm(DASM_OPS_16)  { print("<illegal 0x0f_00_00> (%08x)", op); return 2;}
1094int arcompact_handle0f_00_07_02_dasm(DASM_OPS_16)  { print("<illegal 0x0f_00_07_02> (%08x)", op); return 2;}
1095int arcompact_handle0f_00_07_03_dasm(DASM_OPS_16)  { print("<illegal 0x0f_00_07_03> (%08x)", op); return 2;}
1096int arcompact_handle0f_01_dasm(DASM_OPS_16)  { print("<illegal 0x0f_01> (%08x)", op); return 2;}
1097int arcompact_handle0f_03_dasm(DASM_OPS_16)  { print("<illegal 0x0f_03> (%08x)", op); return 2;}
1098int arcompact_handle0f_08_dasm(DASM_OPS_16)  { print("<illegal 0x0f_08> (%08x)", op); return 2;}
1099int arcompact_handle0f_09_dasm(DASM_OPS_16)  { print("<illegal 0x0f_09> (%08x)", op); return 2;}
1100int arcompact_handle0f_0a_dasm(DASM_OPS_16)  { print("<illegal 0x0f_0a> (%08x)", op); return 2;}
1101int arcompact_handle0f_17_dasm(DASM_OPS_16)  { print("<illegal 0x0f_17> (%08x)", op); return 2;}
1102
1103int arcompact_handle18_05_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_02> (%04x)", op); return 2;}
1104int arcompact_handle18_05_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_03> (%04x)", op); return 2;}
1105int arcompact_handle18_05_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_04> (%04x)", op); return 2;}
1106int arcompact_handle18_05_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_05> (%04x)", op); return 2;}
1107int arcompact_handle18_05_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_06> (%04x)", op); return 2;}
1108int arcompact_handle18_05_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_07> (%04x)", op); return 2;}
1109int arcompact_handle18_06_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_00> (%04x)",  op); return 2;}
1110int arcompact_handle18_06_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_02> (%04x)", op); return 2;}
1111int arcompact_handle18_06_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_03> (%04x)", op); return 2;}
1112int arcompact_handle18_06_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_04> (%04x)", op); return 2;}
1113int arcompact_handle18_06_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_05> (%04x)", op); return 2;}
1114int arcompact_handle18_06_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_06> (%04x)", op); return 2;}
1115int arcompact_handle18_06_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_07> (%04x)", op); return 2;}
1116int arcompact_handle18_06_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_08> (%04x)", op); return 2;}
1117int arcompact_handle18_06_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_09> (%04x)", op); return 2;}
1118int arcompact_handle18_06_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0a> (%04x)", op); return 2;}
1119int arcompact_handle18_06_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0b> (%04x)", op); return 2;}
1120int arcompact_handle18_06_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0c> (%04x)", op); return 2;}
1121int arcompact_handle18_06_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0d> (%04x)", op); return 2;}
1122int arcompact_handle18_06_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0e> (%04x)", op); return 2;}
1123int arcompact_handle18_06_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0f> (%04x)", op); return 2;}
1124int arcompact_handle18_06_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_10> (%04x)", op); return 2;}
1125int arcompact_handle18_06_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_12> (%04x)",  op); return 2;}
1126int arcompact_handle18_06_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_13> (%04x)",  op); return 2;}
1127int arcompact_handle18_06_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_14> (%04x)",  op); return 2;}
1128int arcompact_handle18_06_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_15> (%04x)",  op); return 2;}
1129int arcompact_handle18_06_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_16> (%04x)",  op); return 2;}
1130int arcompact_handle18_06_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_17> (%04x)",  op); return 2;}
1131int arcompact_handle18_06_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_18> (%04x)",  op); return 2;}
1132int arcompact_handle18_06_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_19> (%04x)",  op); return 2;}
1133int arcompact_handle18_06_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1a> (%04x)",  op); return 2;}
1134int arcompact_handle18_06_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1b> (%04x)",  op); return 2;}
1135int arcompact_handle18_06_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1c> (%04x)",  op); return 2;}
1136int arcompact_handle18_06_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1d> (%04x)",  op); return 2;}
1137int arcompact_handle18_06_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1e> (%04x)",  op); return 2;}
1138int arcompact_handle18_06_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1f> (%04x)",  op); return 2;}
1139int arcompact_handle18_07_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_00> (%04x)",  op); return 2;}
1140int arcompact_handle18_07_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_02> (%04x)", op); return 2;}
1141int arcompact_handle18_07_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_03> (%04x)", op); return 2;}
1142int arcompact_handle18_07_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_04> (%04x)", op); return 2;}
1143int arcompact_handle18_07_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_05> (%04x)", op); return 2;}
1144int arcompact_handle18_07_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_06> (%04x)", op); return 2;}
1145int arcompact_handle18_07_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_07> (%04x)", op); return 2;}
1146int arcompact_handle18_07_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_08> (%04x)", op); return 2;}
1147int arcompact_handle18_07_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_09> (%04x)", op); return 2;}
1148int arcompact_handle18_07_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0a> (%04x)", op); return 2;}
1149int arcompact_handle18_07_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0b> (%04x)", op); return 2;}
1150int arcompact_handle18_07_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0c> (%04x)", op); return 2;}
1151int arcompact_handle18_07_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0d> (%04x)", op); return 2;}
1152int arcompact_handle18_07_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0e> (%04x)", op); return 2;}
1153int arcompact_handle18_07_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0f> (%04x)", op); return 2;}
1154int arcompact_handle18_07_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_10> (%04x)", op); return 2;}
1155int arcompact_handle18_07_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_12> (%04x)",  op); return 2;}
1156int arcompact_handle18_07_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_13> (%04x)",  op); return 2;}
1157int arcompact_handle18_07_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_14> (%04x)",  op); return 2;}
1158int arcompact_handle18_07_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_15> (%04x)",  op); return 2;}
1159int arcompact_handle18_07_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_16> (%04x)",  op); return 2;}
1160int arcompact_handle18_07_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_17> (%04x)",  op); return 2;}
1161int arcompact_handle18_07_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_18> (%04x)",  op); return 2;}
1162int arcompact_handle18_07_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_19> (%04x)",  op); return 2;}
1163int arcompact_handle18_07_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1a> (%04x)",  op); return 2;}
1164int arcompact_handle18_07_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1b> (%04x)",  op); return 2;}
1165int arcompact_handle18_07_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1c> (%04x)",  op); return 2;}
1166int arcompact_handle18_07_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1d> (%04x)",  op); return 2;}
1167int arcompact_handle18_07_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1e> (%04x)",  op); return 2;}
1168int arcompact_handle18_07_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1f> (%04x)",  op); return 2;}
1169
trunk/src/emu/cpu/arcompact/arcompactdasm_ops.h
r0r242320
1
2/************************************************************************************************************************************
3*                                                                                                                                   *
4* individual opcode handlers (disassembly)                                                                                          *
5*                                                                                                                                   *
6************************************************************************************************************************************/
7
8#define DASM_OPS_16 char *output, offs_t pc, UINT16 op, const UINT8* oprom
9#define DASM_OPS_32 char *output, offs_t pc, UINT32 op, const UINT8* oprom
10#define DASM_PARAMS output, pc, op, oprom
11
12#define LIMM_REG 62
13
14#define GET_LIMM_32 \
15   limm = oprom[6] | (oprom[7] << 8); \
16   limm |= (oprom[4] << 16) | (oprom[5] << 24); \
17
18
19int arcompact_handle00_00_dasm(DASM_OPS_32);
20int arcompact_handle00_01_dasm(DASM_OPS_32);
21int arcompact_handle01_00_00dasm(DASM_OPS_32);
22int arcompact_handle01_00_01dasm(DASM_OPS_32);
23int arcompact_handle01_01_00_00_dasm(DASM_OPS_32);
24int arcompact_handle01_01_00_01_dasm(DASM_OPS_32);
25int arcompact_handle01_01_00_02_dasm(DASM_OPS_32);
26int arcompact_handle01_01_00_03_dasm(DASM_OPS_32);
27int arcompact_handle01_01_00_04_dasm(DASM_OPS_32);
28int arcompact_handle01_01_00_05_dasm(DASM_OPS_32);
29int arcompact_handle01_01_00_0e_dasm(DASM_OPS_32);
30int arcompact_handle01_01_00_0f_dasm(DASM_OPS_32);
31int arcompact_handle01_01_01_00_dasm(DASM_OPS_32);
32int arcompact_handle01_01_01_01_dasm(DASM_OPS_32);
33int arcompact_handle01_01_01_02_dasm(DASM_OPS_32);
34int arcompact_handle01_01_01_03_dasm(DASM_OPS_32);
35int arcompact_handle01_01_01_04_dasm(DASM_OPS_32);
36int arcompact_handle01_01_01_05_dasm(DASM_OPS_32);
37int arcompact_handle01_01_01_0e_dasm(DASM_OPS_32);
38int arcompact_handle01_01_01_0f_dasm(DASM_OPS_32);
39int arcompact_handle02_dasm(DASM_OPS_32);
40int arcompact_handle03_dasm(DASM_OPS_32);
41int arcompact_handle04_00_dasm(DASM_OPS_32);
42int arcompact_handle04_01_dasm(DASM_OPS_32);
43int arcompact_handle04_02_dasm(DASM_OPS_32);
44int arcompact_handle04_03_dasm(DASM_OPS_32);
45int arcompact_handle04_04_dasm(DASM_OPS_32);
46int arcompact_handle04_05_dasm(DASM_OPS_32);
47int arcompact_handle04_06_dasm(DASM_OPS_32);
48int arcompact_handle04_07_dasm(DASM_OPS_32);
49int arcompact_handle04_08_dasm(DASM_OPS_32);
50int arcompact_handle04_09_dasm(DASM_OPS_32);
51int arcompact_handle04_0a_dasm(DASM_OPS_32);
52int arcompact_handle04_0b_dasm(DASM_OPS_32);
53int arcompact_handle04_0c_dasm(DASM_OPS_32);
54int arcompact_handle04_0d_dasm(DASM_OPS_32);
55int arcompact_handle04_0e_dasm(DASM_OPS_32);
56int arcompact_handle04_0f_dasm(DASM_OPS_32);
57int arcompact_handle04_10_dasm(DASM_OPS_32);
58int arcompact_handle04_11_dasm(DASM_OPS_32);
59int arcompact_handle04_12_dasm(DASM_OPS_32);
60int arcompact_handle04_13_dasm(DASM_OPS_32);
61int arcompact_handle04_14_dasm(DASM_OPS_32);
62int arcompact_handle04_15_dasm(DASM_OPS_32);
63int arcompact_handle04_16_dasm(DASM_OPS_32);
64int arcompact_handle04_17_dasm(DASM_OPS_32);
65int arcompact_handle04_18_dasm(DASM_OPS_32);
66int arcompact_handle04_19_dasm(DASM_OPS_32);
67int arcompact_handle04_1a_dasm(DASM_OPS_32);
68int arcompact_handle04_1b_dasm(DASM_OPS_32);
69int arcompact_handle04_1c_dasm(DASM_OPS_32);
70int arcompact_handle04_1d_dasm(DASM_OPS_32);
71int arcompact_handle04_20_dasm(DASM_OPS_32);
72int arcompact_handle04_21_dasm(DASM_OPS_32);
73int arcompact_handle04_22_dasm(DASM_OPS_32);
74int arcompact_handle04_23_dasm(DASM_OPS_32);
75int arcompact_handle04_28_dasm(DASM_OPS_32);
76int arcompact_handle04_29_dasm(DASM_OPS_32);
77int arcompact_handle04_2a_dasm(DASM_OPS_32);
78int arcompact_handle04_2b_dasm(DASM_OPS_32);
79int arcompact_handle04_2f_00_dasm(DASM_OPS_32);
80int arcompact_handle04_2f_01_dasm(DASM_OPS_32);
81int arcompact_handle04_2f_02_dasm(DASM_OPS_32);
82int arcompact_handle04_2f_03_dasm(DASM_OPS_32);
83int arcompact_handle04_2f_04_dasm(DASM_OPS_32);
84int arcompact_handle04_2f_05_dasm(DASM_OPS_32);
85int arcompact_handle04_2f_06_dasm(DASM_OPS_32);
86int arcompact_handle04_2f_07_dasm(DASM_OPS_32);
87int arcompact_handle04_2f_08_dasm(DASM_OPS_32);
88int arcompact_handle04_2f_09_dasm(DASM_OPS_32);
89int arcompact_handle04_2f_0a_dasm(DASM_OPS_32);
90int arcompact_handle04_2f_0b_dasm(DASM_OPS_32);
91int arcompact_handle04_2f_0c_dasm(DASM_OPS_32);
92int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32);
93int arcompact_handle04_2f_3f_02_dasm(DASM_OPS_32);
94int arcompact_handle04_2f_3f_03_dasm(DASM_OPS_32);
95int arcompact_handle04_2f_3f_04_dasm(DASM_OPS_32);
96int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32);
97int arcompact_handle04_30_dasm(DASM_OPS_32);
98int arcompact_handle04_31_dasm(DASM_OPS_32);
99int arcompact_handle04_32_dasm(DASM_OPS_32);
100int arcompact_handle04_33_dasm(DASM_OPS_32);
101int arcompact_handle04_34_dasm(DASM_OPS_32);
102int arcompact_handle04_35_dasm(DASM_OPS_32);
103int arcompact_handle04_36_dasm(DASM_OPS_32);
104int arcompact_handle04_37_dasm(DASM_OPS_32);
105int arcompact_handle05_00_dasm(DASM_OPS_32);
106int arcompact_handle05_01_dasm(DASM_OPS_32);
107int arcompact_handle05_02_dasm(DASM_OPS_32);
108int arcompact_handle05_03_dasm(DASM_OPS_32);
109int arcompact_handle05_04_dasm(DASM_OPS_32);
110int arcompact_handle05_05_dasm(DASM_OPS_32);
111int arcompact_handle05_06_dasm(DASM_OPS_32);
112int arcompact_handle05_07_dasm(DASM_OPS_32);
113int arcompact_handle05_08_dasm(DASM_OPS_32);
114int arcompact_handle05_0a_dasm(DASM_OPS_32);
115int arcompact_handle05_0b_dasm(DASM_OPS_32);
116int arcompact_handle05_28_dasm(DASM_OPS_32);
117int arcompact_handle05_29_dasm(DASM_OPS_32);
118int arcompact_handle05_2f_dasm(DASM_OPS_32);
119int arcompact_handle06_dasm(DASM_OPS_32);
120int arcompact_handle07_dasm(DASM_OPS_32);
121int arcompact_handle08_dasm(DASM_OPS_32);
122int arcompact_handle09_dasm(DASM_OPS_32);
123int arcompact_handle0a_dasm(DASM_OPS_32);
124int arcompact_handle0b_dasm(DASM_OPS_32);
125
126int arcompact_handle0c_00_dasm(DASM_OPS_16);
127int arcompact_handle0c_01_dasm(DASM_OPS_16);
128int arcompact_handle0c_02_dasm(DASM_OPS_16);
129int arcompact_handle0c_03_dasm(DASM_OPS_16);
130int arcompact_handle0d_00_dasm(DASM_OPS_16);
131int arcompact_handle0d_01_dasm(DASM_OPS_16);
132int arcompact_handle0d_02_dasm(DASM_OPS_16);
133int arcompact_handle0d_03_dasm(DASM_OPS_16);
134int arcompact_handle0e_00_dasm(DASM_OPS_16);
135int arcompact_handle0e_01_dasm(DASM_OPS_16);
136int arcompact_handle0e_02_dasm(DASM_OPS_16);
137int arcompact_handle0e_03_dasm(DASM_OPS_16);
138int arcompact_handle0f_00_00_dasm(DASM_OPS_16);
139int arcompact_handle0f_00_01_dasm(DASM_OPS_16);
140int arcompact_handle0f_00_02_dasm(DASM_OPS_16);
141int arcompact_handle0f_00_03_dasm(DASM_OPS_16);
142int arcompact_handle0f_00_06_dasm(DASM_OPS_16);
143int arcompact_handle0f_00_07_00_dasm(DASM_OPS_16);
144int arcompact_handle0f_00_07_01_dasm(DASM_OPS_16);
145int arcompact_handle0f_00_07_04_dasm(DASM_OPS_16);
146int arcompact_handle0f_00_07_05_dasm(DASM_OPS_16);
147int arcompact_handle0f_00_07_06_dasm(DASM_OPS_16);
148int arcompact_handle0f_00_07_07_dasm(DASM_OPS_16);
149int arcompact_handle0f_02_dasm(DASM_OPS_16);
150int arcompact_handle0f_04_dasm(DASM_OPS_16);
151int arcompact_handle0f_05_dasm(DASM_OPS_16);
152int arcompact_handle0f_06_dasm(DASM_OPS_16);
153int arcompact_handle0f_07_dasm(DASM_OPS_16);
154int arcompact_handle0f_0b_dasm(DASM_OPS_16);
155int arcompact_handle0f_0c_dasm(DASM_OPS_16);
156int arcompact_handle0f_0d_dasm(DASM_OPS_16);
157int arcompact_handle0f_0e_dasm(DASM_OPS_16);
158int arcompact_handle0f_0f_dasm(DASM_OPS_16);
159int arcompact_handle0f_10_dasm(DASM_OPS_16);
160int arcompact_handle0f_11_dasm(DASM_OPS_16);
161int arcompact_handle0f_12_dasm(DASM_OPS_16);
162int arcompact_handle0f_13_dasm(DASM_OPS_16);
163int arcompact_handle0f_14_dasm(DASM_OPS_16);
164int arcompact_handle0f_15_dasm(DASM_OPS_16);
165int arcompact_handle0f_16_dasm(DASM_OPS_16);
166int arcompact_handle0f_18_dasm(DASM_OPS_16);
167int arcompact_handle0f_19_dasm(DASM_OPS_16);
168int arcompact_handle0f_1a_dasm(DASM_OPS_16);
169int arcompact_handle0f_1b_dasm(DASM_OPS_16);
170int arcompact_handle0f_1c_dasm(DASM_OPS_16);
171int arcompact_handle0f_1d_dasm(DASM_OPS_16);
172int arcompact_handle0f_1e_dasm(DASM_OPS_16);
173int arcompact_handle0f_1f_dasm(DASM_OPS_16);
174int arcompact_handle10_dasm(DASM_OPS_16);
175int arcompact_handle11_dasm(DASM_OPS_16);
176int arcompact_handle12_dasm(DASM_OPS_16);
177int arcompact_handle13_dasm(DASM_OPS_16);
178int arcompact_handle14_dasm(DASM_OPS_16);
179int arcompact_handle15_dasm(DASM_OPS_16);
180int arcompact_handle16_dasm(DASM_OPS_16);
181int arcompact_handle17_00_dasm(DASM_OPS_16);
182int arcompact_handle17_01_dasm(DASM_OPS_16);
183int arcompact_handle17_02_dasm(DASM_OPS_16);
184int arcompact_handle17_03_dasm(DASM_OPS_16);
185int arcompact_handle17_04_dasm(DASM_OPS_16);
186int arcompact_handle17_05_dasm(DASM_OPS_16);
187int arcompact_handle17_06_dasm(DASM_OPS_16);
188int arcompact_handle17_07_dasm(DASM_OPS_16);
189int arcompact_handle18_00_dasm(DASM_OPS_16);
190int arcompact_handle18_01_dasm(DASM_OPS_16);
191int arcompact_handle18_02_dasm(DASM_OPS_16);
192int arcompact_handle18_03_dasm(DASM_OPS_16);
193int arcompact_handle18_04_dasm(DASM_OPS_16);
194int arcompact_handle18_05_00_dasm(DASM_OPS_16);
195int arcompact_handle18_05_01_dasm(DASM_OPS_16);
196int arcompact_handle18_06_01_dasm(DASM_OPS_16);
197int arcompact_handle18_06_11_dasm(DASM_OPS_16);
198int arcompact_handle18_07_01_dasm(DASM_OPS_16);
199int arcompact_handle18_07_11_dasm(DASM_OPS_16);
200int arcompact_handle19_00_dasm(DASM_OPS_16);
201int arcompact_handle19_01_dasm(DASM_OPS_16);
202int arcompact_handle19_02_dasm(DASM_OPS_16);
203int arcompact_handle19_03_dasm(DASM_OPS_16);
204int arcompact_handle1a_dasm(DASM_OPS_16);
205int arcompact_handle1b_dasm(DASM_OPS_16);
206int arcompact_handle1c_00_dasm(DASM_OPS_16);
207int arcompact_handle1c_01_dasm(DASM_OPS_16);
208int arcompact_handle1d_00_dasm(DASM_OPS_16);
209int arcompact_handle1d_01_dasm(DASM_OPS_16);
210int arcompact_handle1e_00_dasm(DASM_OPS_16);
211int arcompact_handle1e_01_dasm(DASM_OPS_16);
212int arcompact_handle1e_02_dasm(DASM_OPS_16);
213int arcompact_handle1e_03_00_dasm(DASM_OPS_16);
214int arcompact_handle1e_03_01_dasm(DASM_OPS_16);
215int arcompact_handle1e_03_02_dasm(DASM_OPS_16);
216int arcompact_handle1e_03_03_dasm(DASM_OPS_16);
217int arcompact_handle1e_03_04_dasm(DASM_OPS_16);
218int arcompact_handle1e_03_05_dasm(DASM_OPS_16);
219int arcompact_handle1e_03_06_dasm(DASM_OPS_16);
220int arcompact_handle1e_03_07_dasm(DASM_OPS_16);
221int arcompact_handle1f_dasm(DASM_OPS_16);
222
223/************************************************************************************************************************************
224*                                                                                                                                   *
225* illegal opcode handlers (disassembly)                                                                                             *
226*                                                                                                                                   *
227************************************************************************************************************************************/
228
229int arcompact_handle01_01_00_06_dasm(DASM_OPS_32); //("<illegal 01_01_00_06> (%08x)", op); return 4; }
230int arcompact_handle01_01_00_07_dasm(DASM_OPS_32); //("<illegal 01_01_00_07> (%08x)", op); return 4; }
231int arcompact_handle01_01_00_08_dasm(DASM_OPS_32); //("<illegal 01_01_00_08> (%08x)", op); return 4; }
232int arcompact_handle01_01_00_09_dasm(DASM_OPS_32); //("<illegal 01_01_00_09> (%08x)", op); return 4; }
233int arcompact_handle01_01_00_0a_dasm(DASM_OPS_32); //("<illegal 01_01_00_0a> (%08x)", op); return 4; }
234int arcompact_handle01_01_00_0b_dasm(DASM_OPS_32); //("<illegal 01_01_00_0b> (%08x)", op); return 4; }
235int arcompact_handle01_01_00_0c_dasm(DASM_OPS_32); //("<illegal 01_01_00_0c> (%08x)", op); return 4; }
236int arcompact_handle01_01_00_0d_dasm(DASM_OPS_32); //("<illegal 01_01_00_0d> (%08x)", op); return 4; }
237
238int arcompact_handle01_01_01_06_dasm(DASM_OPS_32); //("<illegal 01_01_01_06> (%08x)", op); return 4; }
239int arcompact_handle01_01_01_07_dasm(DASM_OPS_32); //("<illegal 01_01_01_07> (%08x)", op); return 4; }
240int arcompact_handle01_01_01_08_dasm(DASM_OPS_32); //("<illegal 01_01_01_08> (%08x)", op); return 4; }
241int arcompact_handle01_01_01_09_dasm(DASM_OPS_32); //("<illegal 01_01_01_09> (%08x)", op); return 4; }
242int arcompact_handle01_01_01_0a_dasm(DASM_OPS_32); //("<illegal 01_01_01_0a> (%08x)", op); return 4; }
243int arcompact_handle01_01_01_0b_dasm(DASM_OPS_32); //("<illegal 01_01_01_0b> (%08x)", op); return 4; }
244int arcompact_handle01_01_01_0c_dasm(DASM_OPS_32); //("<illegal 01_01_01_0c> (%08x)", op); return 4; }
245int arcompact_handle01_01_01_0d_dasm(DASM_OPS_32); //("<illegal 01_01_01_0d> (%08x)", op); return 4; }
246
247
248int arcompact_handle04_1e_dasm(DASM_OPS_32); //("<illegal 0x04_1e> (%08x)", op); return 4;}
249int arcompact_handle04_1f_dasm(DASM_OPS_32); //("<illegal 0x04_1f> (%08x)", op); return 4;}
250
251int arcompact_handle04_24_dasm(DASM_OPS_32); //("<illegal 0x04_24> (%08x)", op); return 4;}
252int arcompact_handle04_25_dasm(DASM_OPS_32); //("<illegal 0x04_25> (%08x)", op); return 4;}
253int arcompact_handle04_26_dasm(DASM_OPS_32); //("<illegal 0x04_26> (%08x)", op); return 4;}
254int arcompact_handle04_27_dasm(DASM_OPS_32); //("<illegal 0x04_27> (%08x)", op); return 4;}
255
256int arcompact_handle04_2c_dasm(DASM_OPS_32); //("<illegal 0x04_2c> (%08x)", op); return 4;}
257int arcompact_handle04_2d_dasm(DASM_OPS_32); //("<illegal 0x04_2d> (%08x)", op); return 4;}
258int arcompact_handle04_2e_dasm(DASM_OPS_32); //("<illegal 0x04_2e> (%08x)", op); return 4;}
259
260int arcompact_handle04_2f_0d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_0d> (%08x)", op); return 4;}
261int arcompact_handle04_2f_0e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_0e> (%08x)", op); return 4;}
262int arcompact_handle04_2f_0f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_0f> (%08x)", op); return 4;}
263int arcompact_handle04_2f_10_dasm(DASM_OPS_32); //("<illegal 0x04_2f_10> (%08x)", op); return 4;}
264int arcompact_handle04_2f_11_dasm(DASM_OPS_32); //("<illegal 0x04_2f_11> (%08x)", op); return 4;}
265int arcompact_handle04_2f_12_dasm(DASM_OPS_32); //("<illegal 0x04_2f_12> (%08x)", op); return 4;}
266int arcompact_handle04_2f_13_dasm(DASM_OPS_32); //("<illegal 0x04_2f_13> (%08x)", op); return 4;}
267int arcompact_handle04_2f_14_dasm(DASM_OPS_32); //("<illegal 0x04_2f_14> (%08x)", op); return 4;}
268int arcompact_handle04_2f_15_dasm(DASM_OPS_32); //("<illegal 0x04_2f_15> (%08x)", op); return 4;}
269int arcompact_handle04_2f_16_dasm(DASM_OPS_32); //("<illegal 0x04_2f_16> (%08x)", op); return 4;}
270int arcompact_handle04_2f_17_dasm(DASM_OPS_32); //("<illegal 0x04_2f_17> (%08x)", op); return 4;}
271int arcompact_handle04_2f_18_dasm(DASM_OPS_32); //("<illegal 0x04_2f_18> (%08x)", op); return 4;}
272int arcompact_handle04_2f_19_dasm(DASM_OPS_32); //("<illegal 0x04_2f_19> (%08x)", op); return 4;}
273int arcompact_handle04_2f_1a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_1a> (%08x)", op); return 4;}
274int arcompact_handle04_2f_1b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_1b> (%08x)", op); return 4;}
275int arcompact_handle04_2f_1c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_1c> (%08x)", op); return 4;}
276int arcompact_handle04_2f_1d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_1d> (%08x)", op); return 4;}
277int arcompact_handle04_2f_1e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_1e> (%08x)", op); return 4;}
278int arcompact_handle04_2f_1f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_1f> (%08x)", op); return 4;}
279int arcompact_handle04_2f_20_dasm(DASM_OPS_32); //("<illegal 0x04_2f_20> (%08x)", op); return 4;}
280int arcompact_handle04_2f_21_dasm(DASM_OPS_32); //("<illegal 0x04_2f_21> (%08x)", op); return 4;}
281int arcompact_handle04_2f_22_dasm(DASM_OPS_32); //("<illegal 0x04_2f_22> (%08x)", op); return 4;}
282int arcompact_handle04_2f_23_dasm(DASM_OPS_32); //("<illegal 0x04_2f_23> (%08x)", op); return 4;}
283int arcompact_handle04_2f_24_dasm(DASM_OPS_32); //("<illegal 0x04_2f_24> (%08x)", op); return 4;}
284int arcompact_handle04_2f_25_dasm(DASM_OPS_32); //("<illegal 0x04_2f_25> (%08x)", op); return 4;}
285int arcompact_handle04_2f_26_dasm(DASM_OPS_32); //("<illegal 0x04_2f_26> (%08x)", op); return 4;}
286int arcompact_handle04_2f_27_dasm(DASM_OPS_32); //("<illegal 0x04_2f_27> (%08x)", op); return 4;}
287int arcompact_handle04_2f_28_dasm(DASM_OPS_32); //("<illegal 0x04_2f_28> (%08x)", op); return 4;}
288int arcompact_handle04_2f_29_dasm(DASM_OPS_32); //("<illegal 0x04_2f_29> (%08x)", op); return 4;}
289int arcompact_handle04_2f_2a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_2a> (%08x)", op); return 4;}
290int arcompact_handle04_2f_2b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_2b> (%08x)", op); return 4;}
291int arcompact_handle04_2f_2c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_2c> (%08x)", op); return 4;}
292int arcompact_handle04_2f_2d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_2d> (%08x)", op); return 4;}
293int arcompact_handle04_2f_2e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_2e> (%08x)", op); return 4;}
294int arcompact_handle04_2f_2f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_2f> (%08x)", op); return 4;}
295int arcompact_handle04_2f_30_dasm(DASM_OPS_32); //("<illegal 0x04_2f_30> (%08x)", op); return 4;}
296int arcompact_handle04_2f_31_dasm(DASM_OPS_32); //("<illegal 0x04_2f_31> (%08x)", op); return 4;}
297int arcompact_handle04_2f_32_dasm(DASM_OPS_32); //("<illegal 0x04_2f_32> (%08x)", op); return 4;}
298int arcompact_handle04_2f_33_dasm(DASM_OPS_32); //("<illegal 0x04_2f_33> (%08x)", op); return 4;}
299int arcompact_handle04_2f_34_dasm(DASM_OPS_32); //("<illegal 0x04_2f_34> (%08x)", op); return 4;}
300int arcompact_handle04_2f_35_dasm(DASM_OPS_32); //("<illegal 0x04_2f_35> (%08x)", op); return 4;}
301int arcompact_handle04_2f_36_dasm(DASM_OPS_32); //("<illegal 0x04_2f_36> (%08x)", op); return 4;}
302int arcompact_handle04_2f_37_dasm(DASM_OPS_32); //("<illegal 0x04_2f_37> (%08x)", op); return 4;}
303int arcompact_handle04_2f_38_dasm(DASM_OPS_32); //("<illegal 0x04_2f_38> (%08x)", op); return 4;}
304int arcompact_handle04_2f_39_dasm(DASM_OPS_32); //("<illegal 0x04_2f_39> (%08x)", op); return 4;}
305int arcompact_handle04_2f_3a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3a> (%08x)", op); return 4;}
306int arcompact_handle04_2f_3b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3b> (%08x)", op); return 4;}
307int arcompact_handle04_2f_3c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3c> (%08x)", op); return 4;}
308int arcompact_handle04_2f_3d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3d> (%08x)", op); return 4;}
309int arcompact_handle04_2f_3e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3e> (%08x)", op); return 4;}
310
311int arcompact_handle04_2f_3f_00_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_00> (%08x)", op); return 4;}
312int arcompact_handle04_2f_3f_06_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_06> (%08x)", op); return 4;}
313int arcompact_handle04_2f_3f_07_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_07> (%08x)", op); return 4;}
314int arcompact_handle04_2f_3f_08_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_08> (%08x)", op); return 4;}
315int arcompact_handle04_2f_3f_09_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_09> (%08x)", op); return 4;}
316int arcompact_handle04_2f_3f_0a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_0a> (%08x)", op); return 4;}
317int arcompact_handle04_2f_3f_0b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_0b> (%08x)", op); return 4;}
318int arcompact_handle04_2f_3f_0c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_0c> (%08x)", op); return 4;}
319int arcompact_handle04_2f_3f_0d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_0d> (%08x)", op); return 4;}
320int arcompact_handle04_2f_3f_0e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_0e> (%08x)", op); return 4;}
321int arcompact_handle04_2f_3f_0f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_0f> (%08x)", op); return 4;}
322int arcompact_handle04_2f_3f_10_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_10> (%08x)", op); return 4;}
323int arcompact_handle04_2f_3f_11_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_11> (%08x)", op); return 4;}
324int arcompact_handle04_2f_3f_12_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_12> (%08x)", op); return 4;}
325int arcompact_handle04_2f_3f_13_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_13> (%08x)", op); return 4;}
326int arcompact_handle04_2f_3f_14_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_14> (%08x)", op); return 4;}
327int arcompact_handle04_2f_3f_15_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_15> (%08x)", op); return 4;}
328int arcompact_handle04_2f_3f_16_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_16> (%08x)", op); return 4;}
329int arcompact_handle04_2f_3f_17_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_17> (%08x)", op); return 4;}
330int arcompact_handle04_2f_3f_18_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_18> (%08x)", op); return 4;}
331int arcompact_handle04_2f_3f_19_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_19> (%08x)", op); return 4;}
332int arcompact_handle04_2f_3f_1a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_1a> (%08x)", op); return 4;}
333int arcompact_handle04_2f_3f_1b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_1b> (%08x)", op); return 4;}
334int arcompact_handle04_2f_3f_1c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_1c> (%08x)", op); return 4;}
335int arcompact_handle04_2f_3f_1d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_1d> (%08x)", op); return 4;}
336int arcompact_handle04_2f_3f_1e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_1e> (%08x)", op); return 4;}
337int arcompact_handle04_2f_3f_1f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_1f> (%08x)", op); return 4;}
338int arcompact_handle04_2f_3f_20_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_20> (%08x)", op); return 4;}
339int arcompact_handle04_2f_3f_21_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_21> (%08x)", op); return 4;}
340int arcompact_handle04_2f_3f_22_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_22> (%08x)", op); return 4;}
341int arcompact_handle04_2f_3f_23_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_23> (%08x)", op); return 4;}
342int arcompact_handle04_2f_3f_24_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_24> (%08x)", op); return 4;}
343int arcompact_handle04_2f_3f_25_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_25> (%08x)", op); return 4;}
344int arcompact_handle04_2f_3f_26_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_26> (%08x)", op); return 4;}
345int arcompact_handle04_2f_3f_27_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_27> (%08x)", op); return 4;}
346int arcompact_handle04_2f_3f_28_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_28> (%08x)", op); return 4;}
347int arcompact_handle04_2f_3f_29_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_29> (%08x)", op); return 4;}
348int arcompact_handle04_2f_3f_2a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_2a> (%08x)", op); return 4;}
349int arcompact_handle04_2f_3f_2b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_2b> (%08x)", op); return 4;}
350int arcompact_handle04_2f_3f_2c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_2c> (%08x)", op); return 4;}
351int arcompact_handle04_2f_3f_2d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_2d> (%08x)", op); return 4;}
352int arcompact_handle04_2f_3f_2e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_2e> (%08x)", op); return 4;}
353int arcompact_handle04_2f_3f_2f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_2f> (%08x)", op); return 4;}
354int arcompact_handle04_2f_3f_30_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_30> (%08x)", op); return 4;}
355int arcompact_handle04_2f_3f_31_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_31> (%08x)", op); return 4;}
356int arcompact_handle04_2f_3f_32_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_32> (%08x)", op); return 4;}
357int arcompact_handle04_2f_3f_33_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_33> (%08x)", op); return 4;}
358int arcompact_handle04_2f_3f_34_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_34> (%08x)", op); return 4;}
359int arcompact_handle04_2f_3f_35_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_35> (%08x)", op); return 4;}
360int arcompact_handle04_2f_3f_36_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_36> (%08x)", op); return 4;}
361int arcompact_handle04_2f_3f_37_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_37> (%08x)", op); return 4;}
362int arcompact_handle04_2f_3f_38_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_38> (%08x)", op); return 4;}
363int arcompact_handle04_2f_3f_39_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_39> (%08x)", op); return 4;}
364int arcompact_handle04_2f_3f_3a_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_3a> (%08x)", op); return 4;}
365int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_3b> (%08x)", op); return 4;}
366int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_3c> (%08x)", op); return 4;}
367int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_3d> (%08x)", op); return 4;}
368int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_3e> (%08x)", op); return 4;}
369int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32); //("<illegal 0x04_2f_3f_3f> (%08x)", op); return 4;}
370
371int arcompact_handle04_38_dasm(DASM_OPS_32); //("<illegal 0x04_38> (%08x)", op); return 4;}
372int arcompact_handle04_39_dasm(DASM_OPS_32); //("<illegal 0x04_39> (%08x)", op); return 4;}
373int arcompact_handle04_3a_dasm(DASM_OPS_32); //("<illegal 0x04_3a> (%08x)", op); return 4;}
374int arcompact_handle04_3b_dasm(DASM_OPS_32); //("<illegal 0x04_3b> (%08x)", op); return 4;}
375int arcompact_handle04_3c_dasm(DASM_OPS_32); //("<illegal 0x04_3c> (%08x)", op); return 4;}
376int arcompact_handle04_3d_dasm(DASM_OPS_32); //("<illegal 0x04_3d> (%08x)", op); return 4;}
377int arcompact_handle04_3e_dasm(DASM_OPS_32); //("<illegal 0x04_3e> (%08x)", op); return 4;}
378int arcompact_handle04_3f_dasm(DASM_OPS_32); //("<illegal 0x04_3f> (%08x)", op); return 4;}
379
380int arcompact_handle05_09_dasm(DASM_OPS_32); //("<illegal 0x05_09> (%08x)", op); return 4;}
381int arcompact_handle05_0c_dasm(DASM_OPS_32); //("<illegal 0x05_0c> (%08x)", op); return 4;}
382int arcompact_handle05_0d_dasm(DASM_OPS_32); //("<illegal 0x05_0d> (%08x)", op); return 4;}
383int arcompact_handle05_0e_dasm(DASM_OPS_32); //("<illegal 0x05_0e> (%08x)", op); return 4;}
384int arcompact_handle05_0f_dasm(DASM_OPS_32); //("<illegal 0x05_0f> (%08x)", op); return 4;}
385int arcompact_handle05_10_dasm(DASM_OPS_32); //("<illegal 0x05_10> (%08x)", op); return 4;}
386int arcompact_handle05_11_dasm(DASM_OPS_32); //("<illegal 0x05_11> (%08x)", op); return 4;}
387int arcompact_handle05_12_dasm(DASM_OPS_32); //("<illegal 0x05_12> (%08x)", op); return 4;}
388int arcompact_handle05_13_dasm(DASM_OPS_32); //("<illegal 0x05_13> (%08x)", op); return 4;}
389int arcompact_handle05_14_dasm(DASM_OPS_32); //("<illegal 0x05_14> (%08x)", op); return 4;}
390int arcompact_handle05_15_dasm(DASM_OPS_32); //("<illegal 0x05_15> (%08x)", op); return 4;}
391int arcompact_handle05_16_dasm(DASM_OPS_32); //("<illegal 0x05_16> (%08x)", op); return 4;}
392int arcompact_handle05_17_dasm(DASM_OPS_32); //("<illegal 0x05_17> (%08x)", op); return 4;}
393int arcompact_handle05_18_dasm(DASM_OPS_32); //("<illegal 0x05_18> (%08x)", op); return 4;}
394int arcompact_handle05_19_dasm(DASM_OPS_32); //("<illegal 0x05_19> (%08x)", op); return 4;}
395int arcompact_handle05_1a_dasm(DASM_OPS_32); //("<illegal 0x05_1a> (%08x)", op); return 4;}
396int arcompact_handle05_1b_dasm(DASM_OPS_32); //("<illegal 0x05_1b> (%08x)", op); return 4;}
397int arcompact_handle05_1c_dasm(DASM_OPS_32); //("<illegal 0x05_1c> (%08x)", op); return 4;}
398int arcompact_handle05_1d_dasm(DASM_OPS_32); //("<illegal 0x05_1d> (%08x)", op); return 4;}
399int arcompact_handle05_1e_dasm(DASM_OPS_32); //("<illegal 0x05_1e> (%08x)", op); return 4;}
400int arcompact_handle05_1f_dasm(DASM_OPS_32); //("<illegal 0x05_1f> (%08x)", op); return 4;}
401int arcompact_handle05_20_dasm(DASM_OPS_32); //("<illegal 0x05_20> (%08x)", op); return 4;}
402int arcompact_handle05_21_dasm(DASM_OPS_32); //("<illegal 0x05_21> (%08x)", op); return 4;}
403int arcompact_handle05_22_dasm(DASM_OPS_32); //("<illegal 0x05_22> (%08x)", op); return 4;}
404int arcompact_handle05_23_dasm(DASM_OPS_32); //("<illegal 0x05_23> (%08x)", op); return 4;}
405int arcompact_handle05_24_dasm(DASM_OPS_32); //("<illegal 0x05_24> (%08x)", op); return 4;}
406int arcompact_handle05_25_dasm(DASM_OPS_32); //("<illegal 0x05_25> (%08x)", op); return 4;}
407int arcompact_handle05_26_dasm(DASM_OPS_32); //("<illegal 0x05_26> (%08x)", op); return 4;}
408int arcompact_handle05_27_dasm(DASM_OPS_32); //("<illegal 0x05_27> (%08x)", op); return 4;}
409
410int arcompact_handle05_2a_dasm(DASM_OPS_32); //("<illegal 0x05_2a> (%08x)", op); return 4;}
411int arcompact_handle05_2b_dasm(DASM_OPS_32); //("<illegal 0x05_2b> (%08x)", op); return 4;}
412int arcompact_handle05_2c_dasm(DASM_OPS_32); //("<illegal 0x05_2c> (%08x)", op); return 4;}
413int arcompact_handle05_2d_dasm(DASM_OPS_32); //("<illegal 0x05_2d> (%08x)", op); return 4;}
414int arcompact_handle05_2e_dasm(DASM_OPS_32); //("<illegal 0x05_2e> (%08x)", op); return 4;}
415
416int arcompact_handle05_30_dasm(DASM_OPS_32); //("<illegal 0x05_30> (%08x)", op); return 4;}
417int arcompact_handle05_31_dasm(DASM_OPS_32); //("<illegal 0x05_31> (%08x)", op); return 4;}
418int arcompact_handle05_32_dasm(DASM_OPS_32); //("<illegal 0x05_32> (%08x)", op); return 4;}
419int arcompact_handle05_33_dasm(DASM_OPS_32); //("<illegal 0x05_33> (%08x)", op); return 4;}
420int arcompact_handle05_34_dasm(DASM_OPS_32); //("<illegal 0x05_34> (%08x)", op); return 4;}
421int arcompact_handle05_35_dasm(DASM_OPS_32); //("<illegal 0x05_35> (%08x)", op); return 4;}
422int arcompact_handle05_36_dasm(DASM_OPS_32); //("<illegal 0x05_36> (%08x)", op); return 4;}
423int arcompact_handle05_37_dasm(DASM_OPS_32); //("<illegal 0x05_37> (%08x)", op); return 4;}
424int arcompact_handle05_38_dasm(DASM_OPS_32); //("<illegal 0x05_38> (%08x)", op); return 4;}
425int arcompact_handle05_39_dasm(DASM_OPS_32); //("<illegal 0x05_39> (%08x)", op); return 4;}
426int arcompact_handle05_3a_dasm(DASM_OPS_32); //("<illegal 0x05_3a> (%08x)", op); return 4;}
427int arcompact_handle05_3b_dasm(DASM_OPS_32); //("<illegal 0x05_3b> (%08x)", op); return 4;}
428int arcompact_handle05_3c_dasm(DASM_OPS_32); //("<illegal 0x05_3c> (%08x)", op); return 4;}
429int arcompact_handle05_3d_dasm(DASM_OPS_32); //("<illegal 0x05_3d> (%08x)", op); return 4;}
430int arcompact_handle05_3e_dasm(DASM_OPS_32); //("<illegal 0x05_3e> (%08x)", op); return 4;}
431int arcompact_handle05_3f_dasm(DASM_OPS_32); //("<illegal 0x05_3f> (%08x)", op); return 4;}
432
433int arcompact_handle0f_00_04_dasm(DASM_OPS_16); //("<illegal 0x0f_00_00> (%08x)", op); return 2;}
434int arcompact_handle0f_00_05_dasm(DASM_OPS_16); //("<illegal 0x0f_00_00> (%08x)", op); return 2;}
435int arcompact_handle0f_00_07_02_dasm(DASM_OPS_16); //("<illegal 0x0f_00_07_02> (%08x)", op); return 2;}
436int arcompact_handle0f_00_07_03_dasm(DASM_OPS_16); //("<illegal 0x0f_00_07_03> (%08x)", op); return 2;}
437int arcompact_handle0f_01_dasm(DASM_OPS_16); //("<illegal 0x0f_01> (%08x)", op); return 2;}
438int arcompact_handle0f_03_dasm(DASM_OPS_16); //("<illegal 0x0f_03> (%08x)", op); return 2;}
439int arcompact_handle0f_08_dasm(DASM_OPS_16); //("<illegal 0x0f_08> (%08x)", op); return 2;}
440int arcompact_handle0f_09_dasm(DASM_OPS_16); //("<illegal 0x0f_09> (%08x)", op); return 2;}
441int arcompact_handle0f_0a_dasm(DASM_OPS_16); //("<illegal 0x0f_0a> (%08x)", op); return 2;}
442int arcompact_handle0f_17_dasm(DASM_OPS_16); //("<illegal 0x0f_17> (%08x)", op); return 2;}
443
444int arcompact_handle18_05_02_dasm(DASM_OPS_16); //("<illegal 0x18_05_02> (%04x)", op); return 2;}
445int arcompact_handle18_05_03_dasm(DASM_OPS_16); //("<illegal 0x18_05_03> (%04x)", op); return 2;}
446int arcompact_handle18_05_04_dasm(DASM_OPS_16); //("<illegal 0x18_05_04> (%04x)", op); return 2;}
447int arcompact_handle18_05_05_dasm(DASM_OPS_16); //("<illegal 0x18_05_05> (%04x)", op); return 2;}
448int arcompact_handle18_05_06_dasm(DASM_OPS_16); //("<illegal 0x18_05_06> (%04x)", op); return 2;}
449int arcompact_handle18_05_07_dasm(DASM_OPS_16); //("<illegal 0x18_05_07> (%04x)", op); return 2;}
450int arcompact_handle18_06_00_dasm(DASM_OPS_16); //("<illegal 0x18_06_00> (%04x)",  op); return 2;}
451int arcompact_handle18_06_02_dasm(DASM_OPS_16); //("<illegal 0x18_06_02> (%04x)", op); return 2;}
452int arcompact_handle18_06_03_dasm(DASM_OPS_16); //("<illegal 0x18_06_03> (%04x)", op); return 2;}
453int arcompact_handle18_06_04_dasm(DASM_OPS_16); //("<illegal 0x18_06_04> (%04x)", op); return 2;}
454int arcompact_handle18_06_05_dasm(DASM_OPS_16); //("<illegal 0x18_06_05> (%04x)", op); return 2;}
455int arcompact_handle18_06_06_dasm(DASM_OPS_16); //("<illegal 0x18_06_06> (%04x)", op); return 2;}
456int arcompact_handle18_06_07_dasm(DASM_OPS_16); //("<illegal 0x18_06_07> (%04x)", op); return 2;}
457int arcompact_handle18_06_08_dasm(DASM_OPS_16); //("<illegal 0x18_06_08> (%04x)", op); return 2;}
458int arcompact_handle18_06_09_dasm(DASM_OPS_16); //("<illegal 0x18_06_09> (%04x)", op); return 2;}
459int arcompact_handle18_06_0a_dasm(DASM_OPS_16); //("<illegal 0x18_06_0a> (%04x)", op); return 2;}
460int arcompact_handle18_06_0b_dasm(DASM_OPS_16); //("<illegal 0x18_06_0b> (%04x)", op); return 2;}
461int arcompact_handle18_06_0c_dasm(DASM_OPS_16); //("<illegal 0x18_06_0c> (%04x)", op); return 2;}
462int arcompact_handle18_06_0d_dasm(DASM_OPS_16); //("<illegal 0x18_06_0d> (%04x)", op); return 2;}
463int arcompact_handle18_06_0e_dasm(DASM_OPS_16); //("<illegal 0x18_06_0e> (%04x)", op); return 2;}
464int arcompact_handle18_06_0f_dasm(DASM_OPS_16); //("<illegal 0x18_06_0f> (%04x)", op); return 2;}
465int arcompact_handle18_06_10_dasm(DASM_OPS_16); //("<illegal 0x18_06_10> (%04x)", op); return 2;}
466int arcompact_handle18_06_12_dasm(DASM_OPS_16); //("<illegal 0x18_06_12> (%04x)",  op); return 2;}
467int arcompact_handle18_06_13_dasm(DASM_OPS_16); //("<illegal 0x18_06_13> (%04x)",  op); return 2;}
468int arcompact_handle18_06_14_dasm(DASM_OPS_16); //("<illegal 0x18_06_14> (%04x)",  op); return 2;}
469int arcompact_handle18_06_15_dasm(DASM_OPS_16); //("<illegal 0x18_06_15> (%04x)",  op); return 2;}
470int arcompact_handle18_06_16_dasm(DASM_OPS_16); //("<illegal 0x18_06_16> (%04x)",  op); return 2;}
471int arcompact_handle18_06_17_dasm(DASM_OPS_16); //("<illegal 0x18_06_17> (%04x)",  op); return 2;}
472int arcompact_handle18_06_18_dasm(DASM_OPS_16); //("<illegal 0x18_06_18> (%04x)",  op); return 2;}
473int arcompact_handle18_06_19_dasm(DASM_OPS_16); //("<illegal 0x18_06_19> (%04x)",  op); return 2;}
474int arcompact_handle18_06_1a_dasm(DASM_OPS_16); //("<illegal 0x18_06_1a> (%04x)",  op); return 2;}
475int arcompact_handle18_06_1b_dasm(DASM_OPS_16); //("<illegal 0x18_06_1b> (%04x)",  op); return 2;}
476int arcompact_handle18_06_1c_dasm(DASM_OPS_16); //("<illegal 0x18_06_1c> (%04x)",  op); return 2;}
477int arcompact_handle18_06_1d_dasm(DASM_OPS_16); //("<illegal 0x18_06_1d> (%04x)",  op); return 2;}
478int arcompact_handle18_06_1e_dasm(DASM_OPS_16); //("<illegal 0x18_06_1e> (%04x)",  op); return 2;}
479int arcompact_handle18_06_1f_dasm(DASM_OPS_16); //("<illegal 0x18_06_1f> (%04x)",  op); return 2;}
480int arcompact_handle18_07_00_dasm(DASM_OPS_16); //("<illegal 0x18_07_00> (%04x)",  op); return 2;}
481int arcompact_handle18_07_02_dasm(DASM_OPS_16); //("<illegal 0x18_07_02> (%04x)", op); return 2;}
482int arcompact_handle18_07_03_dasm(DASM_OPS_16); //("<illegal 0x18_07_03> (%04x)", op); return 2;}
483int arcompact_handle18_07_04_dasm(DASM_OPS_16); //("<illegal 0x18_07_04> (%04x)", op); return 2;}
484int arcompact_handle18_07_05_dasm(DASM_OPS_16); //("<illegal 0x18_07_05> (%04x)", op); return 2;}
485int arcompact_handle18_07_06_dasm(DASM_OPS_16); //("<illegal 0x18_07_06> (%04x)", op); return 2;}
486int arcompact_handle18_07_07_dasm(DASM_OPS_16); //("<illegal 0x18_07_07> (%04x)", op); return 2;}
487int arcompact_handle18_07_08_dasm(DASM_OPS_16); //("<illegal 0x18_07_08> (%04x)", op); return 2;}
488int arcompact_handle18_07_09_dasm(DASM_OPS_16); //("<illegal 0x18_07_09> (%04x)", op); return 2;}
489int arcompact_handle18_07_0a_dasm(DASM_OPS_16); //("<illegal 0x18_07_0a> (%04x)", op); return 2;}
490int arcompact_handle18_07_0b_dasm(DASM_OPS_16); //("<illegal 0x18_07_0b> (%04x)", op); return 2;}
491int arcompact_handle18_07_0c_dasm(DASM_OPS_16); //("<illegal 0x18_07_0c> (%04x)", op); return 2;}
492int arcompact_handle18_07_0d_dasm(DASM_OPS_16); //("<illegal 0x18_07_0d> (%04x)", op); return 2;}
493int arcompact_handle18_07_0e_dasm(DASM_OPS_16); //("<illegal 0x18_07_0e> (%04x)", op); return 2;}
494int arcompact_handle18_07_0f_dasm(DASM_OPS_16); //("<illegal 0x18_07_0f> (%04x)", op); return 2;}
495int arcompact_handle18_07_10_dasm(DASM_OPS_16); //("<illegal 0x18_07_10> (%04x)", op); return 2;}
496int arcompact_handle18_07_12_dasm(DASM_OPS_16); //("<illegal 0x18_07_12> (%04x)",  op); return 2;}
497int arcompact_handle18_07_13_dasm(DASM_OPS_16); //("<illegal 0x18_07_13> (%04x)",  op); return 2;}
498int arcompact_handle18_07_14_dasm(DASM_OPS_16); //("<illegal 0x18_07_14> (%04x)",  op); return 2;}
499int arcompact_handle18_07_15_dasm(DASM_OPS_16); //("<illegal 0x18_07_15> (%04x)",  op); return 2;}
500int arcompact_handle18_07_16_dasm(DASM_OPS_16); //("<illegal 0x18_07_16> (%04x)",  op); return 2;}
501int arcompact_handle18_07_17_dasm(DASM_OPS_16); //("<illegal 0x18_07_17> (%04x)",  op); return 2;}
502int arcompact_handle18_07_18_dasm(DASM_OPS_16); //("<illegal 0x18_07_18> (%04x)",  op); return 2;}
503int arcompact_handle18_07_19_dasm(DASM_OPS_16); //("<illegal 0x18_07_19> (%04x)",  op); return 2;}
504int arcompact_handle18_07_1a_dasm(DASM_OPS_16); //("<illegal 0x18_07_1a> (%04x)",  op); return 2;}
505int arcompact_handle18_07_1b_dasm(DASM_OPS_16); //("<illegal 0x18_07_1b> (%04x)",  op); return 2;}
506int arcompact_handle18_07_1c_dasm(DASM_OPS_16); //("<illegal 0x18_07_1c> (%04x)",  op); return 2;}
507int arcompact_handle18_07_1d_dasm(DASM_OPS_16); //("<illegal 0x18_07_1d> (%04x)",  op); return 2;}
508int arcompact_handle18_07_1e_dasm(DASM_OPS_16); //("<illegal 0x18_07_1e> (%04x)",  op); return 2;}
509int arcompact_handle18_07_1f_dasm(DASM_OPS_16); //("<illegal 0x18_07_1f> (%04x)",  op); return 2;}
510
trunk/src/emu/cpu/cpu.mak
r242319r242320
101101ifneq ($(filter ARCOMPACT,$(CPUS)),)
102102OBJDIRS += $(CPUOBJ)/arcompact
103103CPUOBJS += $(CPUOBJ)/arcompact/arcompact.o
104DASMOBJS += $(CPUOBJ)/arcompact/arcompactdasm.o
104DASMOBJS += $(CPUOBJ)/arcompact/arcompactdasm.o $(CPUOBJ)/arcompact/arcompactdasm_dispatch.o $(CPUOBJ)/arcompact/arcompactdasm_ops.o
105105endif
106106
107107$(CPUOBJ)/arcompact/arcompact.o:  $(CPUSRC)/arcompact/arcompact.c \
trunk/src/mess/drivers/leapster.c
r242319r242320
215215public:
216216   leapster_state(const machine_config &mconfig, device_type type, const char *tag)
217217      : driver_device(mconfig, type, tag),
218      m_maincpu(*this, "maincpu"),
218219      m_cart(*this, "cartslot")
219220      { }
220221
r242319r242320
227228   DECLARE_DRIVER_INIT(leapster);
228229
229230protected:
231   required_device<cpu_device> m_maincpu;
230232   required_device<generic_slot_device> m_cart;
231233
232234   memory_region *m_cart_rom;
r242319r242320
259261{
260262   astring region_tag;
261263   m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
262   membank("cartrom")->set_base(m_cart_rom->base());
264
265   if (m_cart_rom)
266   {
267      address_space &space = m_maincpu->space(AS_PROGRAM);
268
269      space.install_readwrite_bank(0x80000000, 0x807fffff, "cartrom");
270      membank("cartrom")->set_base(m_cart_rom->base());
271   }
263272}
264273
265274void leapster_state::machine_reset()
r242319r242320
268277
269278static ADDRESS_MAP_START( leapster_map, AS_PROGRAM, 32, leapster_state )
270279   AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_MIRROR(0x40000000) // pointers in the bios region seem to be to the 40xxxxxx region, either we mirror there or something (real bios?) is acutally missing
271   AM_RANGE(0x80000000, 0x807fffff) AM_ROMBANK("cartrom") // game ROM pointers are all to the 80xxxxxx region, so I assume it maps here
272
280//   AM_RANGE(0x80000000, 0x807fffff) AM_ROMBANK("cartrom") // game ROM pointers are all to the 80xxxxxx region, so I assume it maps here - installed if a cart is present
273281ADDRESS_MAP_END
274282
275283static MACHINE_CONFIG_START( leapster, leapster_state )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team