Previous 199869 Revisions Next

r33743 Monday 8th December, 2014 at 18:01:08 UTC by David Haywood
misc ARC dasm (nw)
[src/emu/cpu/arcompact]arcompactdasm.c

trunk/src/emu/cpu/arcompact/arcompactdasm.c
r242254r242255
2424
2525/*****************************************************************************/
2626
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
2729
28static const char *basic[0x20] =
29{
30   /* opcode below are 32-bit mode */
31   /* 00 */ "Bcc",
32   /* 01 */ "BLcc/BRcc",
33   /* 02 */ "LD r+o",
34   /* 03 */ "ST r+o",
35   /* 04 */ "op a,b,c (basecase)", // basecase ops
36   /* 05 */ "op a,b,c (05 ARC ext)", // ARC processor specific extensions
37   /* 06 */ "op a,b,c (06 ARC ext)",
38   /* 07 */ "op a,b,c (07 User ext)", // User speciifc extensions
39   /* 08 */ "op a,b,c (08 User ext)",
40   /* 09 */ "op a,b,c (09 Market ext)", // Market specific extensions
41   /* 0a */ "op a,b,c (0a Market ext)",
42   /* 0b */ "op a,b,c (0b Market ext)",
43   /* opcodes below are 16-bit mode */
44   /* 0c */ "Load/Add reg-reg",
45   /* 0d */ "Add/Sub/Shft imm",
46   /* 0e */ "Mov/Cmp/Add",
47   /* 0f */ "op_S b,b,c", // single ops
48   /* 10 */ "LD_S",
49   /* 11 */ "LDB_S",
50   /* 12 */ "LDW_S",
51   /* 13 */ "LSW_S.X",
52   /* 14 */ "ST_S",
53   /* 15 */ "STB_S",
54   /* 16 */ "STW_S",
55   /* 17 */ "Shift/Sub/Bit",
56   /* 18 */ "Stack Instr",
57   /* 19 */ "GP Instr",
58   /* 1a */ "PCL Instr",
59   /* 1b */ "MOV_S",
60   /* 1c */ "ADD_S/CMP_S",
61   /* 1d */ "BRcc_S",
62   /* 1e */ "Bcc_S",
63   /* 1f */ "BL_S"
64};
30int arcompact_handle18_00_dasm(DASM_OPS_16);
31int arcompact_handle18_01_dasm(DASM_OPS_16);
32int arcompact_handle18_02_dasm(DASM_OPS_16);
33int arcompact_handle18_03_dasm(DASM_OPS_16);
34int arcompact_handle18_04_dasm(DASM_OPS_16);
6535
36int arcompact_handle18_05_dasm(DASM_OPS_16);
37int arcompact_handle18_05_00_dasm(DASM_OPS_16);
38int arcompact_handle18_05_01_dasm(DASM_OPS_16);
39int arcompact_handle18_05_02_dasm(DASM_OPS_16);
40int arcompact_handle18_05_03_dasm(DASM_OPS_16);
41int arcompact_handle18_05_04_dasm(DASM_OPS_16);
42int arcompact_handle18_05_05_dasm(DASM_OPS_16);
43int arcompact_handle18_05_06_dasm(DASM_OPS_16);
44int arcompact_handle18_05_07_dasm(DASM_OPS_16);
45
46int arcompact_handle18_06_dasm(DASM_OPS_16);
47int arcompact_handle18_06_00_dasm(DASM_OPS_16);
48int arcompact_handle18_06_01_dasm(DASM_OPS_16);
49int arcompact_handle18_06_02_dasm(DASM_OPS_16);
50int arcompact_handle18_06_03_dasm(DASM_OPS_16);
51int arcompact_handle18_06_04_dasm(DASM_OPS_16);
52int arcompact_handle18_06_05_dasm(DASM_OPS_16);
53int arcompact_handle18_06_06_dasm(DASM_OPS_16);
54int arcompact_handle18_06_07_dasm(DASM_OPS_16);
55int arcompact_handle18_06_08_dasm(DASM_OPS_16);
56int arcompact_handle18_06_09_dasm(DASM_OPS_16);
57int arcompact_handle18_06_0a_dasm(DASM_OPS_16);
58int arcompact_handle18_06_0b_dasm(DASM_OPS_16);
59int arcompact_handle18_06_0c_dasm(DASM_OPS_16);
60int arcompact_handle18_06_0d_dasm(DASM_OPS_16);
61int arcompact_handle18_06_0e_dasm(DASM_OPS_16);
62int arcompact_handle18_06_0f_dasm(DASM_OPS_16);
63int arcompact_handle18_06_10_dasm(DASM_OPS_16);
64int arcompact_handle18_06_11_dasm(DASM_OPS_16);
65int arcompact_handle18_06_12_dasm(DASM_OPS_16);
66int arcompact_handle18_06_13_dasm(DASM_OPS_16);
67int arcompact_handle18_06_14_dasm(DASM_OPS_16);
68int arcompact_handle18_06_15_dasm(DASM_OPS_16);
69int arcompact_handle18_06_16_dasm(DASM_OPS_16);
70int arcompact_handle18_06_17_dasm(DASM_OPS_16);
71int arcompact_handle18_06_18_dasm(DASM_OPS_16);
72int arcompact_handle18_06_19_dasm(DASM_OPS_16);
73int arcompact_handle18_06_1a_dasm(DASM_OPS_16);
74int arcompact_handle18_06_1b_dasm(DASM_OPS_16);
75int arcompact_handle18_06_1c_dasm(DASM_OPS_16);
76int arcompact_handle18_06_1d_dasm(DASM_OPS_16);
77int arcompact_handle18_06_1e_dasm(DASM_OPS_16);
78int arcompact_handle18_06_1f_dasm(DASM_OPS_16);
79
80int arcompact_handle18_07_dasm(DASM_OPS_16);
81int arcompact_handle18_07_00_dasm(DASM_OPS_16);
82int arcompact_handle18_07_01_dasm(DASM_OPS_16);
83int arcompact_handle18_07_02_dasm(DASM_OPS_16);
84int arcompact_handle18_07_03_dasm(DASM_OPS_16);
85int arcompact_handle18_07_04_dasm(DASM_OPS_16);
86int arcompact_handle18_07_05_dasm(DASM_OPS_16);
87int arcompact_handle18_07_06_dasm(DASM_OPS_16);
88int arcompact_handle18_07_07_dasm(DASM_OPS_16);
89int arcompact_handle18_07_08_dasm(DASM_OPS_16);
90int arcompact_handle18_07_09_dasm(DASM_OPS_16);
91int arcompact_handle18_07_0a_dasm(DASM_OPS_16);
92int arcompact_handle18_07_0b_dasm(DASM_OPS_16);
93int arcompact_handle18_07_0c_dasm(DASM_OPS_16);
94int arcompact_handle18_07_0d_dasm(DASM_OPS_16);
95int arcompact_handle18_07_0e_dasm(DASM_OPS_16);
96int arcompact_handle18_07_0f_dasm(DASM_OPS_16);
97int arcompact_handle18_07_10_dasm(DASM_OPS_16);
98int arcompact_handle18_07_11_dasm(DASM_OPS_16);
99int arcompact_handle18_07_12_dasm(DASM_OPS_16);
100int arcompact_handle18_07_13_dasm(DASM_OPS_16);
101int arcompact_handle18_07_14_dasm(DASM_OPS_16);
102int arcompact_handle18_07_15_dasm(DASM_OPS_16);
103int arcompact_handle18_07_16_dasm(DASM_OPS_16);
104int arcompact_handle18_07_17_dasm(DASM_OPS_16);
105int arcompact_handle18_07_18_dasm(DASM_OPS_16);
106int arcompact_handle18_07_19_dasm(DASM_OPS_16);
107int arcompact_handle18_07_1a_dasm(DASM_OPS_16);
108int arcompact_handle18_07_1b_dasm(DASM_OPS_16);
109int arcompact_handle18_07_1c_dasm(DASM_OPS_16);
110int arcompact_handle18_07_1d_dasm(DASM_OPS_16);
111int arcompact_handle18_07_1e_dasm(DASM_OPS_16);
112int arcompact_handle18_07_1f_dasm(DASM_OPS_16);
113
114
115
66116// condition codes (basic ones are the same as arc
67117static const char *conditions[0x20] =
68118{
r242254r242255
120170   /* 0f */ "<BBIT1>"
121171};
122172
123static const char *table18[0x8] =
124{
125   /* 00 */ "LD_S (SP)",
126   /* 01 */ "LDB_S (SP)",
127   /* 02 */ "ST_S (SP)",
128   /* 03 */ "STB_S (SP)",
129   /* 04 */ "ADD_S (SP)",
130   /* 05 */ "ADD_S/SUB_S (SP)",
131   /* 06 */ "POP_S (SP)",
132   /* 07 */ "PUSH_S (SP)",
133173
134};
135174
175
176
136177static const char *table0f[0x20] =
137178{
138179   /* 00 */ "SOPs", // Sub Operation (another table..) ( table0f_00 )
r242254r242255
195236
196237#define ARCOMPACT_OPERATION ((op & 0xf800) >> 11)
197238
198CPU_DISASSEMBLE(arcompact)
239
240int arcompact_handle00_dasm(DASM_OPS_32)
199241{
200   int size = 2;
242   if (op & 0x00010000)
243   { // Branch Unconditionally Far
244      // 00000 ssssssssss 1  SSSSSSSSSS N R TTTT
245      INT32 address =   (op & 0x07fe0000) >> 17;
246      address |=        ((op & 0x0000ffc0) >> 6) << 10;
247      address |=        ((op & 0x0000000f) >> 0) << 20;
248      if (address & 0x800000) address = -(address&0x7fffff);   
201249
202   UINT32 op = oprom[2] | (oprom[3] << 8);
203   output = buffer;
250      print("B %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
251   }
252   else
253   { // Branch Conditionally
254      // 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ
255      INT32 address =   (op & 0x07fe0000) >> 17;
256      address |=        ((op & 0x0000ffc0) >> 6) << 10;
257      if (address & 0x800000) address = -(address&0x7fffff);   
204258
205   UINT8 instruction = ARCOMPACT_OPERATION;
259      UINT8 condition = op & 0x0000001f;
206260
207   if (instruction < 0x0c)
261      print("B(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
262   }
263   return 4;
264}
265
266int arcompact_handle01_dasm(DASM_OPS_32)
267{
268   if (op & 0x00010000)
208269   {
209      size = 4;
210      op <<= 16;
211      op |= oprom[0] | (oprom[1] << 8);
270      if (op & 0x00000010)
271      { // Branch on Compare / Bit Test - Register-Immediate
272         // 00001 bbb sssssss 1 S BBB UUUUUU N 1 iiii
273         UINT8 subinstr = op & 0x0000000f;
274         INT32 address =    (op & 0x00fe0000) >> 17;
275         address |=        ((op & 0x00008000) >> 15) << 7;
276         if (address & 0x80) address = -(address&0x7f);   
212277
213      switch (instruction)
278                 
279         print("%s (reg-imm) %08x (%08x)", table01_01_0x[subinstr], pc + (address *2) + 4, op & ~0xf8fe800f);
280
281
282      }
283      else
214284      {
215         case 0x00:
216            if (op & 0x00010000)
217            { // Branch Unconditionally Far
218              // 00000 ssssssssss 1  SSSSSSSSSS N R TTTT
219               INT32 address =   (op & 0x07fe0000) >> 17;
220               address |=        ((op & 0x0000ffc0) >> 6) << 10;
221               address |=        ((op & 0x0000000f) >> 0) << 20;
222               if (address & 0x800000) address = -(address&0x7fffff);   
285         // Branch on Compare / Bit Test - Register-Register
286         // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii
287         UINT8 subinstr = op & 0x0000000f;
288         INT32 address =    (op & 0x00fe0000) >> 17;
289         address |=        ((op & 0x00008000) >> 15) << 7;
290         if (address & 0x80) address = -(address&0x7f);   
223291
224               print("B %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
225            }
226            else
227            { // Branch Conditionally
228              // 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ
229               INT32 address =   (op & 0x07fe0000) >> 17;
230               address |=        ((op & 0x0000ffc0) >> 6) << 10;
231               if (address & 0x800000) address = -(address&0x7fffff);   
292         print("%s (reg-reg) %08x (%08x)", table01_01_0x[subinstr], pc + (address *2) + 4, op & ~0xf8fe800f);
232293
233               UINT8 condition = op & 0x0000001f;
294      }
234295
235               print("B(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
296   }
297   else
298   {
299      if (op & 0x00020000)
300      { // Branch and Link Unconditionally Far
301         // 00001 sssssssss 10  SSSSSSSSSS N R TTTT
302         INT32 address =   (op & 0x07fc0000) >> 17;
303         address |=        ((op & 0x0000ffc0) >> 6) << 10;
304         address |=        ((op & 0x0000000f) >> 0) << 20;
305         if (address & 0x800000) address = -(address&0x7fffff);   
236306
237            }
307         print("BL %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
308      }
309      else
310      { // Branch and Link Conditionally
311         // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ
312         INT32 address =   (op & 0x07fc0000) >> 17;
313         address |=        ((op & 0x0000ffc0) >> 6) << 10;
314         if (address & 0x800000) address = -(address&0x7fffff);   
238315
239            break;
316         UINT8 condition = op & 0x0000001f;
240317
241         case 0x01:
242            if (op & 0x00010000)
243            {
244               if (op & 0x00000010)
245               { // Branch on Compare / Bit Test - Register-Immediate
246                  // 00001 bbb sssssss 1 S BBB UUUUUU N 1 iiii
247                  UINT8 subinstr = op & 0x0000000f;
248                  INT32 address =    (op & 0x00fe0000) >> 17;
249                  address |=        ((op & 0x00008000) >> 15) << 7;
250                  if (address & 0x80) address = -(address&0x7f);   
318         print("BL(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
251319
252                 
253                  print("%s (reg-imm) %08x (%08x)", table01_01_0x[subinstr], pc + (address *2) + 4, op & ~0xf8fe800f);
320      }
254321
322   }
323   return 4;
324}
255325
256               }
257               else
258               {
259                  // Branch on Compare / Bit Test - Register-Register
260                  // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii
261                  UINT8 subinstr = op & 0x0000000f;
262                  INT32 address =    (op & 0x00fe0000) >> 17;
263                  address |=        ((op & 0x00008000) >> 15) << 7;
264                  if (address & 0x80) address = -(address&0x7f);   
326int arcompact_handle02_dasm(DASM_OPS_32)
327{
328   print("LD r+o (%08x)", op );
329   return 4;
330}
265331
266                  print("%s (reg-reg) %08x (%08x)", table01_01_0x[subinstr], pc + (address *2) + 4, op & ~0xf8fe800f);
332int arcompact_handle03_dasm(DASM_OPS_32)
333{
334   print("ST r+o (%08x)", op );
335   return 4;
336}
267337
268               }
338int arcompact_handle04_dasm(DASM_OPS_32)
339{
340   print("op a,b,c (basecase) (%08x)", op );
341   return 4;
342}
269343
270            }
271            else
272            {
273               if (op & 0x00020000)
274               { // Branch and Link Unconditionally Far
275                 // 00001 sssssssss 10  SSSSSSSSSS N R TTTT
276                  INT32 address =   (op & 0x07fc0000) >> 17;
277                  address |=        ((op & 0x0000ffc0) >> 6) << 10;
278                  address |=        ((op & 0x0000000f) >> 0) << 20;
279                  if (address & 0x800000) address = -(address&0x7fffff);   
344int arcompact_handle05_dasm(DASM_OPS_32)
345{
346   print("op a,b,c (05 ARC ext) (%08x)", op );
347   return 4;
348}
280349
281                  print("BL %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
282               }
283               else
284               { // Branch and Link Conditionally
285                 // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ
286                  INT32 address =   (op & 0x07fc0000) >> 17;
287                  address |=        ((op & 0x0000ffc0) >> 6) << 10;
288                  if (address & 0x800000) address = -(address&0x7fffff);   
350int arcompact_handle06_dasm(DASM_OPS_32)
351{
352   print("op a,b,c (06 ARC ext) (%08x)", op );
353   return 4;
354}
289355
290                  UINT8 condition = op & 0x0000001f;
356int arcompact_handle07_dasm(DASM_OPS_32)
357{
358   print("op a,b,c (07 User ext) (%08x)", op );
359   return 4;
360}
291361
292                  print("BL(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
362int arcompact_handle08_dasm(DASM_OPS_32)
363{
364   print("op a,b,c (08 User ext) (%08x)", op );
365   return 4;
366}
293367
294               }
368int arcompact_handle09_dasm(DASM_OPS_32)
369{
370   print("op a,b,c (09 Market ext) (%08x)", op );
371   return 4;
372}
295373
296            }
297            break;
374int arcompact_handle0a_dasm(DASM_OPS_32)
375{
376   print("op a,b,c (0a Market ext) (%08x)",  op );
377   return 4;
378}
298379
299         default:
300            print("%s (%08x)", basic[instruction], op & ~0xf8000000 );
301            break;
380int arcompact_handle0b_dasm(DASM_OPS_32)
381{
382   print("op a,b,c (0b Market ext) (%08x)",  op );
383   return 4;
384}
302385
303      }
304386
387
388
389int arcompact_handle0c_dasm(DASM_OPS_16)
390{
391   print("Load/Add reg-reg (%04x)", op);
392   return 2;
393}
394
395int arcompact_handle0d_dasm(DASM_OPS_16)
396{
397   print("Add/Sub/Shft imm (%04x)", op);
398   return 2;
399}
400
401int arcompact_handle0e_dasm(DASM_OPS_16)
402{
403   print("Mov/Cmp/Add (%04x)", op);
404   return 2;
405}
406
407int arcompact_handle0f_dasm(DASM_OPS_16)
408{
409   // General Register Instructions (16-bit)
410   // 01111 bbb ccc iiiii
411   UINT8 subinstr = (op & 0x01f) >> 0;
412   //print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
305413     
306   }
307   else
308   {   
309      size = 2;
414   switch (subinstr)
415   {
416   
417      default:
418         print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
419         break;
310420
311      switch (instruction)
421      case 0x00:
312422      {
313         case 0x0f:
423         // General Operations w/ Register
424         // 01111 bbb iii 00000
425         UINT8 subinstr2 = (op & 0x00e0) >> 5;
426
427         switch (subinstr2)
314428         {
315            // General Register Instructions (16-bit)
316            // 01111 bbb ccc iiiii
317            UINT8 subinstr = (op & 0x01f) >> 0;
318            //print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
429            default:
430               print("%s (%04x)", table0f_00[subinstr2], op & ~0xf8ff);
431               return 2;
319432
320#if 1         
321            switch (subinstr)
433            case 0x7:
322434            {
435               // General Operations w/o Register
436               // 01111 iii 111 00000
437               UINT8 subinstr3 = (op & 0x0700) >> 8;
438
439               print("%s (%04x)", table0f_00_07[subinstr3], op & ~0xffff);
440
441               return 2;
442            }
443         }
444      }
445   }
323446   
324               default:
325                  print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
326                  break;
447   return 2;
448}
327449
328               case 0x00:
329               {
330                  // General Operations w/ Register
331                  // 01111 bbb iii 00000
332                  UINT8 subinstr2 = (op & 0x00e0) >> 5;
450int arcompact_handle10_dasm(DASM_OPS_16)
451{
452   print("LD_S (%04x)",  op);
453   return 2;
454}
333455
334                  switch (subinstr2)
335                  {
336                     default:
337                        print("%s (%04x)", table0f_00[subinstr2], op & ~0xf8ff);
338                        break;
456int arcompact_handle11_dasm(DASM_OPS_16)
457{
458   print("LDB_S (%04x)", op);
459   return 2;
460}
339461
340                     case 0x7:
341                     {
342                        // General Operations w/o Register
343                        // 01111 iii 111 00000
344                        UINT8 subinstr3 = (op & 0x0700) >> 8;
462int arcompact_handle12_dasm(DASM_OPS_16)
463{
464   print("LDW_S (%04x)", op);
465   return 2;
466}
345467
346                        print("%s (%04x)", table0f_00_07[subinstr3], op & ~0xffff);
468int arcompact_handle13_dasm(DASM_OPS_16)
469{
470   print("LSW_S.X (%04x)", op);
471   return 2;
472}
347473
348                        break;
349                     }
350                  }
351               }
352            }
353#endif           
354         
355            break;
474int arcompact_handle14_dasm(DASM_OPS_16)
475{
476   print("ST_S (%04x)", op);
477   return 2;
478}
356479
357         }
480int arcompact_handle15_dasm(DASM_OPS_16)
481{
482   print("STB_S (%04x)", op);
483   return 2;
484}
358485
486int arcompact_handle16_dasm(DASM_OPS_16)
487{
488   print("STW_S (%04x)",  op);
489   return 2;
490}
359491
360         case 0x18:
361         {
362            // Stack Pointer Based Instructions (16-bit)
363            // 11000 bbb iii uuuuu
364            UINT8 subinstr = (op & 0x00e0) >> 5;
365            print("%s (%04x)", table18[subinstr], op & ~0xf8e0);
366            break;
492int arcompact_handle17_dasm(DASM_OPS_16)
493{
494   print("Shift/Sub/Bit (%04x)",  op);
495   return 2;
496}
367497
368         }
498int arcompact_handle18_dasm(DASM_OPS_16)
499{
500   int size = 2;
501   // Stack Pointer Based Instructions (16-bit)
502   // 11000 bbb iii uuuuu
503   UINT8 subinstr = (op & 0x00e0) >> 5;
504   op &= ~0x00e0;
369505
370         default:
371            print("%s (%04x)", basic[instruction], op & ~0xf800);
372            break;
506   switch (subinstr)
507   {
508      case 0x00: size = arcompact_handle18_00_dasm(output, pc, op, oprom); break; // LD_S (SP)
509      case 0x01: size = arcompact_handle18_01_dasm(output, pc, op, oprom); break; // LDB_S (SP)
510      case 0x02: size = arcompact_handle18_02_dasm(output, pc, op, oprom); break; // ST_S (SP)
511      case 0x03: size = arcompact_handle18_03_dasm(output, pc, op, oprom); break; // STB_S (SP)
512      case 0x04: size = arcompact_handle18_04_dasm(output, pc, op, oprom); break; // ADD_S (SP)
513      case 0x05: size = arcompact_handle18_05_dasm(output, pc, op, oprom); break; // subtable 18_05
514      case 0x06: size = arcompact_handle18_06_dasm(output, pc, op, oprom); break; // subtable 18_06
515      case 0x07: size = arcompact_handle18_07_dasm(output, pc, op, oprom); break; // subtable 18_07
516   }
517
518   return size;
519}
520
521// op bits remaining for 0x18_xx subgroups 0x071f
522
523int arcompact_handle18_00_dasm(DASM_OPS_16)
524{
525   print("LD_S (SP) (%04x)",  op);
526   return 2;
527}
528
529int arcompact_handle18_01_dasm(DASM_OPS_16)
530{
531   print("LDB_S (SP) (%04x)",  op);
532   return 2;
533}
534
535int arcompact_handle18_02_dasm(DASM_OPS_16)
536{
537   print("ST_S (SP) (%04x)",  op);
538   return 2;
539}
540
541int arcompact_handle18_03_dasm(DASM_OPS_16)
542{
543   print("STB_S (SP) (%04x)",  op);
544   return 2;
545}
546
547int arcompact_handle18_04_dasm(DASM_OPS_16)
548{
549   print("ADD_S (SP) (%04x)",  op);
550   return 2;
551}
552
553
554
555
556
557int arcompact_handle18_05_dasm(DASM_OPS_16)
558{
559   int size = 2;
560   UINT8 subinstr2 = (op & 0x0700) >> 8;
561   op &= ~0x001f;
562
563   switch (subinstr2)
564   {
565      case 0x00: size = arcompact_handle18_05_00_dasm(output, pc, op, oprom); break; // ADD_S (SP)
566      case 0x01: size = arcompact_handle18_05_01_dasm(output, pc, op, oprom); break; // SUB_S (SP)
567      case 0x02: size = arcompact_handle18_05_02_dasm(output, pc, op, oprom); break; // <illegal 0x18_05_02>
568      case 0x03: size = arcompact_handle18_05_03_dasm(output, pc, op, oprom); break; // <illegal 0x18_05_03>
569      case 0x04: size = arcompact_handle18_05_04_dasm(output, pc, op, oprom); break; // <illegal 0x18_05_04>
570      case 0x05: size = arcompact_handle18_05_05_dasm(output, pc, op, oprom); break; // <illegal 0x18_05_05>
571      case 0x06: size = arcompact_handle18_05_06_dasm(output, pc, op, oprom); break; // <illegal 0x18_05_06>
572      case 0x07: size = arcompact_handle18_05_07_dasm(output, pc, op, oprom); break; // <illegal 0x18_05_07>
573   }
574
575   return size;
576}
577// op bits remaining for 0x18_05_xx subgroups 0x001f
578int arcompact_handle18_05_00_dasm(DASM_OPS_16)
579{
580   int u = op & 0x001f;
581   op &= ~0x001f; // all bits now used
582
583   print("ADD_S %02x (SP)", u);
584   return 2;
585
586}
587
588int arcompact_handle18_05_01_dasm(DASM_OPS_16)
589{
590   int u = op & 0x001f;
591   op &= ~0x001f; // all bits now used
592
593   print("SUB_S %02x (SP)", u);
594   return 2;
595}
596
597
598int arcompact_handle18_05_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_02> (%04x)", op); return 2;}
599int arcompact_handle18_05_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_03> (%04x)", op); return 2;}
600int arcompact_handle18_05_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_04> (%04x)", op); return 2;}
601int arcompact_handle18_05_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_05> (%04x)", op); return 2;}
602int arcompact_handle18_05_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_06> (%04x)", op); return 2;}
603int arcompact_handle18_05_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_07> (%04x)", op); return 2;}
604
605
606int arcompact_handle18_06_dasm(DASM_OPS_16)
607{
608   int size = 2;
609   UINT8 subinstr2 = (op & 0x001f) >> 0;
610   op &= ~0x001f;
611
612   switch (subinstr2)
613   {
614      case 0x00: size = arcompact_handle18_06_00_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_00>
615      case 0x01: size = arcompact_handle18_06_01_dasm(output, pc, op, oprom); break; // POP_S b
616      case 0x02: size = arcompact_handle18_06_02_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_02>
617      case 0x03: size = arcompact_handle18_06_03_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_03>
618      case 0x04: size = arcompact_handle18_06_04_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_04>
619      case 0x05: size = arcompact_handle18_06_05_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_05>
620      case 0x06: size = arcompact_handle18_06_06_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_06>
621      case 0x07: size = arcompact_handle18_06_07_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_07>
622      case 0x08: size = arcompact_handle18_06_08_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_08>
623      case 0x09: size = arcompact_handle18_06_09_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_09>
624      case 0x0a: size = arcompact_handle18_06_0a_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_0a>
625      case 0x0b: size = arcompact_handle18_06_0b_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_0b>
626      case 0x0c: size = arcompact_handle18_06_0c_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_0c>
627      case 0x0d: size = arcompact_handle18_06_0d_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_0d>
628      case 0x0e: size = arcompact_handle18_06_0e_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_0e>
629      case 0x0f: size = arcompact_handle18_06_0f_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_0f>
630      case 0x10: size = arcompact_handle18_06_10_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_10>
631      case 0x11: size = arcompact_handle18_06_11_dasm(output, pc, op, oprom); break; // POP_S blink
632      case 0x12: size = arcompact_handle18_06_12_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_12>
633      case 0x13: size = arcompact_handle18_06_13_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_13>
634      case 0x14: size = arcompact_handle18_06_14_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_14>
635      case 0x15: size = arcompact_handle18_06_15_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_15>
636      case 0x16: size = arcompact_handle18_06_16_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_16>
637      case 0x17: size = arcompact_handle18_06_17_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_17>
638      case 0x18: size = arcompact_handle18_06_18_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_18>
639      case 0x19: size = arcompact_handle18_06_19_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_19>
640      case 0x1a: size = arcompact_handle18_06_1a_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_1a>
641      case 0x1b: size = arcompact_handle18_06_1b_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_1b>
642      case 0x1c: size = arcompact_handle18_06_1c_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_1c>
643      case 0x1d: size = arcompact_handle18_06_1d_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_1d>
644      case 0x1e: size = arcompact_handle18_06_1e_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_1e>
645      case 0x1f: size = arcompact_handle18_06_1f_dasm(output, pc, op, oprom); break; // <illegal 0x18_06_1f>
646   }
647
648   return size;
649}
650
651
652// op bits remaining for 0x18_06_xx subgroups 0x0700
653int arcompact_handle18_06_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_00> (%04x)",  op); return 2;}
654
655int arcompact_handle18_06_01_dasm(DASM_OPS_16)
656{
657   int b = (op & 0x0700) >> 8;
658   op &= ~0x0700; // all bits now used
659
660   print("POP_S [%02x]", b);
661
662   return 2;
663}
664
665int arcompact_handle18_06_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_02> (%04x)", op); return 2;}
666int arcompact_handle18_06_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_03> (%04x)", op); return 2;}
667int arcompact_handle18_06_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_04> (%04x)", op); return 2;}
668int arcompact_handle18_06_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_05> (%04x)", op); return 2;}
669int arcompact_handle18_06_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_06> (%04x)", op); return 2;}
670int arcompact_handle18_06_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_07> (%04x)", op); return 2;}
671int arcompact_handle18_06_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_08> (%04x)", op); return 2;}
672int arcompact_handle18_06_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_09> (%04x)", op); return 2;}
673int arcompact_handle18_06_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0a> (%04x)", op); return 2;}
674int arcompact_handle18_06_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0b> (%04x)", op); return 2;}
675int arcompact_handle18_06_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0c> (%04x)", op); return 2;}
676int arcompact_handle18_06_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0d> (%04x)", op); return 2;}
677int arcompact_handle18_06_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0e> (%04x)", op); return 2;}
678int arcompact_handle18_06_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0f> (%04x)", op); return 2;}
679int arcompact_handle18_06_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_10> (%04x)", op); return 2;}
680
681int arcompact_handle18_06_11_dasm(DASM_OPS_16)
682{
683   int res = (op & 0x0700) >> 8;
684   op &= ~0x0700; // all bits now used
685
686   if (res)
687      print("POP_S [BLINK] (Reserved Bits set %04x)", op);
688   else
689      print("POP_S [BLINK]");
690
691   return 2;
692}
693
694int arcompact_handle18_06_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_12> (%04x)",  op); return 2;}
695int arcompact_handle18_06_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_13> (%04x)",  op); return 2;}
696int arcompact_handle18_06_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_14> (%04x)",  op); return 2;}
697int arcompact_handle18_06_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_15> (%04x)",  op); return 2;}
698int arcompact_handle18_06_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_16> (%04x)",  op); return 2;}
699int arcompact_handle18_06_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_17> (%04x)",  op); return 2;}
700int arcompact_handle18_06_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_18> (%04x)",  op); return 2;}
701int arcompact_handle18_06_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_19> (%04x)",  op); return 2;}
702int arcompact_handle18_06_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1a> (%04x)",  op); return 2;}
703int arcompact_handle18_06_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1b> (%04x)",  op); return 2;}
704int arcompact_handle18_06_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1c> (%04x)",  op); return 2;}
705int arcompact_handle18_06_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1d> (%04x)",  op); return 2;}
706int arcompact_handle18_06_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1e> (%04x)",  op); return 2;}
707int arcompact_handle18_06_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1f> (%04x)",  op); return 2;}
708
709
710
711
712int arcompact_handle18_07_dasm(DASM_OPS_16)
713{
714   int size = 2;
715   UINT8 subinstr2 = (op & 0x001f) >> 0;
716   op &= ~0x001f;
717
718   switch (subinstr2)
719   {
720      case 0x00: size = arcompact_handle18_07_00_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_00>
721      case 0x01: size = arcompact_handle18_07_01_dasm(output, pc, op, oprom); break; // PUSH_S b
722      case 0x02: size = arcompact_handle18_07_02_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_02>
723      case 0x03: size = arcompact_handle18_07_03_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_03>
724      case 0x04: size = arcompact_handle18_07_04_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_04>
725      case 0x05: size = arcompact_handle18_07_05_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_05>
726      case 0x06: size = arcompact_handle18_07_06_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_06>
727      case 0x07: size = arcompact_handle18_07_07_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_07>
728      case 0x08: size = arcompact_handle18_07_08_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_08>
729      case 0x09: size = arcompact_handle18_07_09_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_09>
730      case 0x0a: size = arcompact_handle18_07_0a_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_0a>
731      case 0x0b: size = arcompact_handle18_07_0b_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_0b>
732      case 0x0c: size = arcompact_handle18_07_0c_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_0c>
733      case 0x0d: size = arcompact_handle18_07_0d_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_0d>
734      case 0x0e: size = arcompact_handle18_07_0e_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_0e>
735      case 0x0f: size = arcompact_handle18_07_0f_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_0f>
736      case 0x10: size = arcompact_handle18_07_10_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_10>
737      case 0x11: size = arcompact_handle18_07_11_dasm(output, pc, op, oprom); break; // PUSH_S blink
738      case 0x12: size = arcompact_handle18_07_12_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_12>
739      case 0x13: size = arcompact_handle18_07_13_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_13>
740      case 0x14: size = arcompact_handle18_07_14_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_14>
741      case 0x15: size = arcompact_handle18_07_15_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_15>
742      case 0x16: size = arcompact_handle18_07_16_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_16>
743      case 0x17: size = arcompact_handle18_07_17_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_17>
744      case 0x18: size = arcompact_handle18_07_18_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_18>
745      case 0x19: size = arcompact_handle18_07_19_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_19>
746      case 0x1a: size = arcompact_handle18_07_1a_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_1a>
747      case 0x1b: size = arcompact_handle18_07_1b_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_1b>
748      case 0x1c: size = arcompact_handle18_07_1c_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_1c>
749      case 0x1d: size = arcompact_handle18_07_1d_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_1d>
750      case 0x1e: size = arcompact_handle18_07_1e_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_1e>
751      case 0x1f: size = arcompact_handle18_07_1f_dasm(output, pc, op, oprom); break; // <illegal 0x18_07_1f>
752   }
753
754   return size;
755}
756
757
758// op bits remaining for 0x18_07_xx subgroups 0x0700
759int arcompact_handle18_07_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_00> (%04x)",  op); return 2;}
760
761int arcompact_handle18_07_01_dasm(DASM_OPS_16)
762{
763   int b = (op & 0x0700) >> 8;
764   op &= ~0x0700; // all bits now used
765
766   print("PUSH_S [%02x]", b);
767
768   return 2;
769}
770
771int arcompact_handle18_07_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_02> (%04x)", op); return 2;}
772int arcompact_handle18_07_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_03> (%04x)", op); return 2;}
773int arcompact_handle18_07_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_04> (%04x)", op); return 2;}
774int arcompact_handle18_07_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_05> (%04x)", op); return 2;}
775int arcompact_handle18_07_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_06> (%04x)", op); return 2;}
776int arcompact_handle18_07_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_07> (%04x)", op); return 2;}
777int arcompact_handle18_07_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_08> (%04x)", op); return 2;}
778int arcompact_handle18_07_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_09> (%04x)", op); return 2;}
779int arcompact_handle18_07_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0a> (%04x)", op); return 2;}
780int arcompact_handle18_07_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0b> (%04x)", op); return 2;}
781int arcompact_handle18_07_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0c> (%04x)", op); return 2;}
782int arcompact_handle18_07_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0d> (%04x)", op); return 2;}
783int arcompact_handle18_07_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0e> (%04x)", op); return 2;}
784int arcompact_handle18_07_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0f> (%04x)", op); return 2;}
785int arcompact_handle18_07_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_10> (%04x)", op); return 2;}
786
787int arcompact_handle18_07_11_dasm(DASM_OPS_16)
788{
789   int res = (op & 0x0700) >> 8;
790   op &= ~0x0700; // all bits now used
791
792   if (res)
793      print("PUSH_S [BLINK] (Reserved Bits set %04x)", op);
794   else
795      print("PUSH_S [BLINK]");
796
797   return 2;
798}
799
800int arcompact_handle18_07_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_12> (%04x)",  op); return 2;}
801int arcompact_handle18_07_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_13> (%04x)",  op); return 2;}
802int arcompact_handle18_07_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_14> (%04x)",  op); return 2;}
803int arcompact_handle18_07_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_15> (%04x)",  op); return 2;}
804int arcompact_handle18_07_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_16> (%04x)",  op); return 2;}
805int arcompact_handle18_07_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_17> (%04x)",  op); return 2;}
806int arcompact_handle18_07_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_18> (%04x)",  op); return 2;}
807int arcompact_handle18_07_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_19> (%04x)",  op); return 2;}
808int arcompact_handle18_07_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1a> (%04x)",  op); return 2;}
809int arcompact_handle18_07_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1b> (%04x)",  op); return 2;}
810int arcompact_handle18_07_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1c> (%04x)",  op); return 2;}
811int arcompact_handle18_07_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1d> (%04x)",  op); return 2;}
812int arcompact_handle18_07_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1e> (%04x)",  op); return 2;}
813int arcompact_handle18_07_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1f> (%04x)",  op); return 2;}
814
815
816int arcompact_handle19_dasm(DASM_OPS_16)
817{
818   print("GP Instr (%04x)",  op);
819   return 2;
820}
821
822
823int arcompact_handle1a_dasm(DASM_OPS_16)
824{
825   print("PCL Instr (%04x)", op);
826   return 2;
827}
828
829int arcompact_handle1b_dasm(DASM_OPS_16)
830{
831   print("MOV_S (%04x)", op);
832   return 2;
833}
834
835int arcompact_handle1c_dasm(DASM_OPS_16)
836{
837   print("ADD_S/CMP_S (%04x)", op);
838   return 2;
839}
840
841int arcompact_handle1d_dasm(DASM_OPS_16)
842{
843   print("BRcc_S (%04x)", op);
844   return 2;
845}
846
847int arcompact_handle1e_dasm(DASM_OPS_16)
848{
849   print("Bcc_S (%04x)", op);
850   return 2;
851}
852
853int arcompact_handle1f_dasm(DASM_OPS_16)
854{
855   print("BL_S (%04x)", op);
856   return 2;
857}
858
859CPU_DISASSEMBLE(arcompact)
860{
861   int size = 2;
862
863   UINT32 op = oprom[2] | (oprom[3] << 8);
864   output = buffer;
865
866   UINT8 instruction = ARCOMPACT_OPERATION;
867
868   if (instruction < 0x0c)
869   {
870      size = 4;
871      op <<= 16;
872      op |= oprom[0] | (oprom[1] << 8);
873
874      op &= ~0xf8000000;
875
876      switch (instruction) // 32-bit instructions (with optional extra dword for immediate data)
877      {
878         case 0x00: size = arcompact_handle00_dasm(output, pc, op, oprom);   break; // Bcc
879         case 0x01: size = arcompact_handle01_dasm(output, pc, op, oprom);   break; // BLcc/BRcc
880         case 0x02: size = arcompact_handle02_dasm(output, pc, op, oprom);   break; // LD r+o
881         case 0x03: size = arcompact_handle03_dasm(output, pc, op, oprom);   break; // ST r+o
882         case 0x04: size = arcompact_handle04_dasm(output, pc, op, oprom);   break; // op a,b,c (basecase)
883         case 0x05: size = arcompact_handle05_dasm(output, pc, op, oprom);   break; // op a,b,c (05 ARC ext)
884         case 0x06: size = arcompact_handle06_dasm(output, pc, op, oprom);   break; // op a,b,c (06 ARC ext)
885         case 0x07: size = arcompact_handle07_dasm(output, pc, op, oprom);   break; // op a,b,c (07 User ext)
886         case 0x08: size = arcompact_handle08_dasm(output, pc, op, oprom);   break; // op a,b,c (08 User ext)
887         case 0x09: size = arcompact_handle09_dasm(output, pc, op, oprom);   break; // op a,b,c (09 Market ext)
888         case 0x0a: size = arcompact_handle0a_dasm(output, pc, op, oprom);   break; // op a,b,c (0a Market ext)
889         case 0x0b: size = arcompact_handle0b_dasm(output, pc, op, oprom);   break; // op a,b,c (0b Market ext)
373890      }
374891   }
892   else
893   {   
894      size = 2;
895      op &= ~0xf800;
375896
376897
898      switch (instruction) // 16-bit instructions
899      {
900         case 0x0c: size = arcompact_handle0c_dasm(output, pc, op, oprom);   break; // Load/Add reg-reg
901         case 0x0d: size = arcompact_handle0d_dasm(output, pc, op, oprom);   break; // Add/Sub/Shft imm
902         case 0x0e: size = arcompact_handle0e_dasm(output, pc, op, oprom);   break; // Mov/Cmp/Add
903         case 0x0f: size = arcompact_handle0f_dasm(output, pc, op, oprom);   break; // op_S b,b,c (single 16-bit ops)
904         case 0x10: size = arcompact_handle10_dasm(output, pc, op, oprom);   break; // LD_S
905         case 0x11: size = arcompact_handle11_dasm(output, pc, op, oprom);   break; // LDB_S
906         case 0x12: size = arcompact_handle12_dasm(output, pc, op, oprom);   break; // LDW_S
907         case 0x13: size = arcompact_handle13_dasm(output, pc, op, oprom);   break; // LSW_S.X
908         case 0x14: size = arcompact_handle14_dasm(output, pc, op, oprom);   break; // ST_S
909         case 0x15: size = arcompact_handle15_dasm(output, pc, op, oprom);   break; // STB_S
910         case 0x16: size = arcompact_handle16_dasm(output, pc, op, oprom);   break; // STW_S
911         case 0x17: size = arcompact_handle17_dasm(output, pc, op, oprom);   break; // Shift/Sub/Bit
912         case 0x18: size = arcompact_handle18_dasm(output, pc, op, oprom);   break; // Stack Instr
913         case 0x19: size = arcompact_handle19_dasm(output, pc, op, oprom);   break; // GP Instr
914         case 0x1a: size = arcompact_handle1a_dasm(output, pc, op, oprom);   break; // PCL Instr
915         case 0x1b: size = arcompact_handle1b_dasm(output, pc, op, oprom);   break; // MOV_S
916         case 0x1c: size = arcompact_handle1c_dasm(output, pc, op, oprom);   break; // ADD_S/CMP_S
917         case 0x1d: size = arcompact_handle1d_dasm(output, pc, op, oprom);   break; // BRcc_S
918         case 0x1e: size = arcompact_handle1e_dasm(output, pc, op, oprom);   break; // Bcc_S
919         case 0x1f: size = arcompact_handle1f_dasm(output, pc, op, oprom);   break; // BL_S
920      }
921   }
922
377923   return size | DASMFLAG_SUPPORTED;
378924}


Previous 199869 Revisions Next


© 1997-2024 The MAME Team