trunk/src/emu/cpu/arcompact/arcompactdasm.c
| r242278 | r242279 | |
| 403 | 403 | int arcompact_handle18_07_1e_dasm(DASM_OPS_16); |
| 404 | 404 | int arcompact_handle18_07_1f_dasm(DASM_OPS_16); |
| 405 | 405 | |
| 406 | int arcompact_handle19_00_dasm(DASM_OPS_16); |
| 407 | int arcompact_handle19_01_dasm(DASM_OPS_16); |
| 408 | int arcompact_handle19_02_dasm(DASM_OPS_16); |
| 409 | int arcompact_handle19_03_dasm(DASM_OPS_16); |
| 406 | 410 | |
| 411 | int arcompact_handle1c_00_dasm(DASM_OPS_16); |
| 412 | int arcompact_handle1c_01_dasm(DASM_OPS_16); |
| 407 | 413 | |
| 414 | int arcompact_handle1d_00_dasm(DASM_OPS_16); |
| 415 | int arcompact_handle1d_01_dasm(DASM_OPS_16); |
| 416 | |
| 417 | int arcompact_handle1e_00_dasm(DASM_OPS_16); |
| 418 | int arcompact_handle1e_01_dasm(DASM_OPS_16); |
| 419 | int arcompact_handle1e_02_dasm(DASM_OPS_16); |
| 420 | int arcompact_handle1e_03_dasm(DASM_OPS_16); |
| 421 | |
| 422 | int arcompact_handle1e_03_00_dasm(DASM_OPS_16); |
| 423 | int arcompact_handle1e_03_01_dasm(DASM_OPS_16); |
| 424 | int arcompact_handle1e_03_02_dasm(DASM_OPS_16); |
| 425 | int arcompact_handle1e_03_03_dasm(DASM_OPS_16); |
| 426 | int arcompact_handle1e_03_04_dasm(DASM_OPS_16); |
| 427 | int arcompact_handle1e_03_05_dasm(DASM_OPS_16); |
| 428 | int arcompact_handle1e_03_06_dasm(DASM_OPS_16); |
| 429 | int arcompact_handle1e_03_07_dasm(DASM_OPS_16); |
| 430 | |
| 431 | |
| 432 | |
| 408 | 433 | // condition codes (basic ones are the same as arc |
| 409 | 434 | static const char *conditions[0x20] = |
| 410 | 435 | { |
| r242278 | r242279 | |
| 2036 | 2061 | |
| 2037 | 2062 | int arcompact_handle19_dasm(DASM_OPS_16) |
| 2038 | 2063 | { |
| 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; |
| 2041 | 2076 | } |
| 2042 | 2077 | |
| 2078 | int arcompact_handle19_00_dasm(DASM_OPS_16) { print("LD_S r0 <- m[GP + s11].long (%04x)", op); return 2;} |
| 2079 | int arcompact_handle19_01_dasm(DASM_OPS_16) { print("LDB_S r0 <- m[GP + s9].byte (%04x)", op); return 2;} |
| 2080 | int arcompact_handle19_02_dasm(DASM_OPS_16) { print("LDW_S r0 <- m[GP + s10].word (%04x)", op); return 2;} |
| 2081 | int arcompact_handle19_03_dasm(DASM_OPS_16) { print("ADD_S r0 <- GP + s11 (%04x)", op); return 2;} |
| 2043 | 2082 | |
| 2083 | |
| 2084 | |
| 2044 | 2085 | int arcompact_handle1a_dasm(DASM_OPS_16) |
| 2045 | 2086 | { |
| 2046 | 2087 | print("PCL Instr (%04x)", op); |
| r242278 | r242279 | |
| 2055 | 2096 | |
| 2056 | 2097 | int arcompact_handle1c_dasm(DASM_OPS_16) |
| 2057 | 2098 | { |
| 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; |
| 2060 | 2109 | } |
| 2061 | 2110 | |
| 2111 | int arcompact_handle1c_00_dasm(DASM_OPS_16) { print("ADD_S b <- b + u7 (%04x)", op); return 2;} |
| 2112 | int arcompact_handle1c_01_dasm(DASM_OPS_16) { print("CMP_S b - u7 (%04x)", op); return 2;} |
| 2113 | |
| 2114 | |
| 2062 | 2115 | int arcompact_handle1d_dasm(DASM_OPS_16) |
| 2063 | 2116 | { |
| 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; |
| 2066 | 2127 | } |
| 2067 | 2128 | |
| 2129 | int arcompact_handle1d_00_dasm(DASM_OPS_16) { print("BREQ_S (%04x)", op); return 2;} |
| 2130 | int arcompact_handle1d_01_dasm(DASM_OPS_16) { print("BRNE_S (%04x)", op); return 2;} |
| 2131 | |
| 2132 | |
| 2068 | 2133 | int arcompact_handle1e_dasm(DASM_OPS_16) |
| 2069 | 2134 | { |
| 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; |
| 2072 | 2147 | } |
| 2073 | 2148 | |
| 2149 | int arcompact_handle1e_00_dasm(DASM_OPS_16) { print("B_S (%04x)", op); return 2;} |
| 2150 | int arcompact_handle1e_01_dasm(DASM_OPS_16) { print("BEQ_S (%04x)", op); return 2;} |
| 2151 | int arcompact_handle1e_02_dasm(DASM_OPS_16) { print("BNE_S (%04x)", op); return 2;} |
| 2152 | |
| 2153 | |
| 2154 | int 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 | |
| 2176 | int arcompact_handle1e_03_00_dasm(DASM_OPS_16) { print("BGT_S (%04x)", op); return 2;} |
| 2177 | int arcompact_handle1e_03_01_dasm(DASM_OPS_16) { print("BGE_S (%04x)", op); return 2;} |
| 2178 | int arcompact_handle1e_03_02_dasm(DASM_OPS_16) { print("BLT_S (%04x)", op); return 2;} |
| 2179 | int arcompact_handle1e_03_03_dasm(DASM_OPS_16) { print("BLE_S (%04x)", op); return 2;} |
| 2180 | int arcompact_handle1e_03_04_dasm(DASM_OPS_16) { print("BHI_S (%04x)", op); return 2;} |
| 2181 | int arcompact_handle1e_03_05_dasm(DASM_OPS_16) { print("BHS_S (%04x)", op); return 2;} |
| 2182 | int arcompact_handle1e_03_06_dasm(DASM_OPS_16) { print("BLO_S (%04x)", op); return 2;} |
| 2183 | int arcompact_handle1e_03_07_dasm(DASM_OPS_16) { print("BLS_S (%04x)", op); return 2;} |
| 2184 | |
| 2185 | |
| 2186 | |
| 2074 | 2187 | int arcompact_handle1f_dasm(DASM_OPS_16) |
| 2075 | 2188 | { |
| 2076 | 2189 | print("BL_S (%04x)", op); |