trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242337 | r242338 | |
| 208 | 208 | int 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; } |
| 209 | 209 | int 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 | 210 | |
| 211 | #if 0 |
| 212 | //#define EXPLICIT_EXTENSIONS |
| 211 | 213 | |
| 214 | static const char *datasize[0x4] = |
| 215 | { |
| 216 | #ifdef EXPLICIT_EXTENSIONS |
| 217 | /* 00 */ ".L", // Dword (default) (can use no extension, using .L to be explicit) |
| 218 | #else |
| 219 | /* 00 */ " ",// Dword (default) |
| 220 | #endif |
| 221 | /* 01 */ ".B", // Byte |
| 222 | /* 02 */ ".W", // Word |
| 223 | /* 03 */ ".<illegal data size>" |
| 224 | }; |
| 225 | |
| 226 | static const char *dataextend[0x2] = |
| 227 | { |
| 228 | #ifdef EXPLICIT_EXTENSIONS |
| 229 | /* 00 */ ".ZX", // Zero Extend (can use no extension, using .ZX to be explicit) |
| 230 | else |
| 231 | /* 00 */ " ", // Zero Extend |
| 232 | #endif |
| 233 | /* 01 */ ".X" // Sign Extend |
| 234 | }; |
| 235 | |
| 236 | static const char *addressmode[0x4] = |
| 237 | { |
| 238 | #ifdef EXPLICIT_EXTENSIONS |
| 239 | /* 00 */ ".AN", // No Writeback (can use no extension, using .AN to be explicit) |
| 240 | #else |
| 241 | /* 00 */ " ", // No Writeback |
| 242 | #endif |
| 243 | /* 01 */ ".AW", // Writeback pre memory access |
| 244 | /* 02 */ ".AB", // Writeback post memory access |
| 245 | /* 03 */ ".AS" // scaled |
| 246 | }; |
| 247 | |
| 248 | static const char *cachebit[0x2] = |
| 249 | { |
| 250 | #ifdef EXPLICIT_EXTENSIONS |
| 251 | /* 00 */ ".EN", // Data Cache Enabled (can use no extension, using .EN to be explicit) |
| 252 | #else |
| 253 | /* 00 */ " ", // Data Cache Enabled |
| 254 | #endif |
| 255 | /* 01 */ ".DI" // Direct to Memory (Cache Bypass) |
| 256 | }; |
| 257 | |
| 258 | static const char *regnames[0x40] = |
| 259 | { |
| 260 | /* 00 */ "r0", |
| 261 | /* 01 */ "r1", |
| 262 | /* 02 */ "r2", |
| 263 | /* 03 */ "r3", |
| 264 | /* 04 */ "r4", |
| 265 | /* 05 */ "r5", |
| 266 | /* 06 */ "r6", |
| 267 | /* 07 */ "r7", |
| 268 | /* 08 */ "r8", |
| 269 | /* 09 */ "r9", |
| 270 | /* 0a */ "r10", |
| 271 | /* 0b */ "r11", |
| 272 | /* 0c */ "r12", |
| 273 | /* 0d */ "r13", |
| 274 | /* 0e */ "r14", |
| 275 | /* 0f */ "r15", |
| 276 | |
| 277 | /* 10 */ "r16", |
| 278 | /* 11 */ "r17", |
| 279 | /* 12 */ "r18", |
| 280 | /* 13 */ "r19", |
| 281 | /* 14 */ "r20", |
| 282 | /* 15 */ "r21", |
| 283 | /* 16 */ "r22", |
| 284 | /* 17 */ "r23", |
| 285 | /* 18 */ "r24", |
| 286 | /* 19 */ "r25", |
| 287 | /* 1a */ "r26(GP)", |
| 288 | /* 1b */ "r27(FP)", |
| 289 | /* 1c */ "r28(SP)", |
| 290 | /* 1d */ "r29(ILINK1)", |
| 291 | /* 1e */ "r30(ILINK2)", |
| 292 | /* 1f */ "r31(BLINK)", |
| 293 | |
| 294 | /* 20 */ "r32(ext)", |
| 295 | /* 21 */ "r33(ext)", |
| 296 | /* 22 */ "r34(ext)", |
| 297 | /* 23 */ "r35(ext)", |
| 298 | /* 24 */ "r36(ext)", |
| 299 | /* 25 */ "r37(ext)", |
| 300 | /* 26 */ "r38(ext)", |
| 301 | /* 27 */ "r39(ext)", |
| 302 | /* 28 */ "r40(ext)", |
| 303 | /* 29 */ "r41(ext)", |
| 304 | /* 2a */ "r42(ext)", |
| 305 | /* 2b */ "r43(ext)", |
| 306 | /* 2c */ "r44(ext)", |
| 307 | /* 2d */ "r45(ext)", |
| 308 | /* 2e */ "r46(ext)", |
| 309 | /* 2f */ "r47(ext)", |
| 310 | |
| 311 | /* 30 */ "r48(ext)", |
| 312 | /* 31 */ "r49(ext)", |
| 313 | /* 32 */ "r50(ext)", |
| 314 | /* 33 */ "r51(ext)", |
| 315 | /* 34 */ "r52(ext)", |
| 316 | /* 35 */ "r53(ext)", |
| 317 | /* 36 */ "r54(ext)", |
| 318 | /* 37 */ "r55(ext)", |
| 319 | /* 38 */ "r56(ext)", |
| 320 | /* 39 */ "r57(ext)", // MLO (result registers for optional multply functions) |
| 321 | /* 3a */ "r58(ext)", // MMID |
| 322 | /* 3b */ "r59(ext)", // MHI |
| 323 | /* 3c */ "r60(LP_COUNT)", |
| 324 | /* 3d */ "r61(reserved)", |
| 325 | /* 3e */ "r62(LIMM)", // use Long Immediate Data instead of register |
| 326 | /* 3f */ "r63(PCL)" |
| 327 | }; |
| 328 | #endif |
| 329 | |
| 212 | 330 | int arcompact_handle02_dasm(DASM_OPS_32) |
| 213 | 331 | { |
| 214 | 332 | // bitpos |
| 215 | | // 11111 111 11111111 0 000 0 00 00 0 000000 |
| 216 | | // fedcb a98 76543210 f edc b a9 87 6 543210 |
| 333 | // 1111 1111 1111 1111 0000 0000 0000 0000 |
| 334 | // fedc ba98 7654 3210 fedc ba98 7654 3210 |
| 217 | 335 | // 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; |
| 336 | // 0001 0bbb ssss ssss SBBB DaaZ ZXAA AAAA |
| 337 | |
| 338 | #if 0 |
| 339 | int A = (op & 0x0000003f >> 0); //op &= ~0x0000003f; |
| 340 | int X = (op & 0x00000040 >> 6); //op &= ~0x00000040; |
| 341 | int Z = (op & 0x00000180 >> 7); //op &= ~0x00000180; |
| 342 | int a = (op & 0x00000600 >> 9); //op &= ~0x00000600; |
| 343 | int D = (op & 0x00000800 >> 11);// op &= ~0x00000800; |
| 344 | int B = (op & 0x00007000 >> 12);// op &= ~0x00007000; |
| 345 | int S = (op & 0x00008000 >> 15);// op &= ~0x00008000; |
| 346 | int s = (op & 0x00ff0000 >> 16);// op &= ~0x00ff0000; |
| 347 | int b = (op & 0x07000000 >> 24);// op &= ~0x07000000; |
| 348 | |
| 349 | int breg = b | (B << 3); |
| 350 | int sdat = s | (S << 8); // todo - signed |
| 229 | 351 | #endif |
| 230 | 352 | |
| 231 | | print("LD r+o (%08x)", op ); |
| 353 | |
| 354 | output += sprintf( output, "LD"); |
| 355 | // output += sprintf( output, "%s", datasize[Z]); |
| 356 | // output += sprintf( output, "%s", dataextend[X]); |
| 357 | // output += sprintf( output, "%s", addressmode[a]); |
| 358 | // output += sprintf( output, "%s", cachebit[D]); |
| 359 | // output += sprintf( output, " "); |
| 360 | // output += sprintf( output, "%s, ", regnames[A]); |
| 361 | // output += sprintf( output, "["); |
| 362 | // output += sprintf( output, "%s(%d %d), ", regnames[breg], B, b); |
| 363 | // output += sprintf( output, "%d", sdat); |
| 364 | // output += sprintf( output, "]"); |
| 365 | |
| 232 | 366 | return 4; |
| 233 | 367 | } |
| 234 | 368 | |