Previous 199869 Revisions Next

r33767 Tuesday 9th December, 2014 at 14:37:02 UTC by David Haywood
more arcompact (nw)
[src/emu/cpu/arcompact]arcompactdasm.c

trunk/src/emu/cpu/arcompact/arcompactdasm.c
r242278r242279
403403int arcompact_handle18_07_1e_dasm(DASM_OPS_16);
404404int arcompact_handle18_07_1f_dasm(DASM_OPS_16);
405405
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);
406410
411int arcompact_handle1c_00_dasm(DASM_OPS_16);
412int arcompact_handle1c_01_dasm(DASM_OPS_16);
407413
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
408433// condition codes (basic ones are the same as arc
409434static const char *conditions[0x20] =
410435{
r242278r242279
20362061
20372062int arcompact_handle19_dasm(DASM_OPS_16)
20382063{
2039   print("GP Instr (%04x)",  op);
2040   return 2;
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;
20412076}
20422077
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;}
20432082
2083
2084
20442085int arcompact_handle1a_dasm(DASM_OPS_16)
20452086{
20462087   print("PCL Instr (%04x)", op);
r242278r242279
20552096
20562097int arcompact_handle1c_dasm(DASM_OPS_16)
20572098{
2058   print("ADD_S/CMP_S (%04x)", op);
2059   return 2;
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;
20602109}
20612110
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
20622115int arcompact_handle1d_dasm(DASM_OPS_16)
20632116{
2064   print("BRcc_S (%04x)", op);
2065   return 2;
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;
20662127}
20672128
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
20682133int arcompact_handle1e_dasm(DASM_OPS_16)
20692134{
2070   print("Bcc_S (%04x)", op);
2071   return 2;
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;
20722147}
20732148
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
20742187int arcompact_handle1f_dasm(DASM_OPS_16)
20752188{
20762189   print("BL_S (%04x)", op);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team