trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242440 | r242441 | |
| 360 | 360 | |
| 361 | 361 | if ((breg == LIMM_REG) && (c != LIMM_REG)) |
| 362 | 362 | { |
| 363 | | print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[breg], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 363 | print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[c], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 364 | 364 | } |
| 365 | 365 | else if ((c == LIMM_REG) && (breg != LIMM_REG)) |
| 366 | 366 | { |
| r242440 | r242441 | |
| 467 | 467 | int arcompact_handle03_dasm(DASM_OPS_32) |
| 468 | 468 | { |
| 469 | 469 | int size = 4; |
| 470 | UINT32 limm = 0; |
| 471 | int got_limm = 0; |
| 470 | 472 | // bitpos |
| 471 | 473 | // 1111 1111 1111 1111 0000 0000 0000 0000 |
| 472 | 474 | // fedc ba98 7654 3210 fedc ba98 7654 3210 |
| r242440 | r242441 | |
| 484 | 486 | int D = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 485 | 487 | int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; |
| 486 | 488 | |
| 487 | | UINT32 limm = 0; |
| 488 | 489 | if (breg == LIMM_REG) |
| 489 | 490 | { |
| 490 | 491 | GET_LIMM_32; |
| 491 | 492 | size = 8; |
| 493 | got_limm = 1; |
| 492 | 494 | } |
| 493 | 495 | |
| 494 | 496 | |
| r242440 | r242441 | |
| 504 | 506 | output += sprintf( output, "%03x", sdat); |
| 505 | 507 | output += sprintf( output, "] <- "); |
| 506 | 508 | |
| 507 | | output += sprintf( output, "%s", regnames[C]); |
| 509 | if (C == LIMM_REG) |
| 510 | { |
| 511 | if (!got_limm) |
| 512 | { |
| 513 | GET_LIMM_32; |
| 514 | size = 8; |
| 515 | } |
| 516 | output += sprintf(output, "(%08x)", limm); |
| 508 | 517 | |
| 518 | } |
| 519 | else |
| 520 | { |
| 521 | output += sprintf(output, "%s", regnames[C]); |
| 522 | } |
| 523 | |
| 509 | 524 | if (R) output += sprintf( output, "(reserved bit set)"); |
| 510 | 525 | |
| 511 | 526 | |
| r242440 | r242441 | |
| 567 | 582 | } |
| 568 | 583 | |
| 569 | 584 | output += sprintf( output, "(%08x) ", limm ); |
| 570 | | if (!ignore_dst) output += sprintf( output, "DST(%s)", regnames[A]); |
| 585 | if (ignore_dst == 0) |
| 586 | { |
| 587 | if (A != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[A]); |
| 588 | else output += sprintf(output, "<no dst>"); |
| 589 | } |
| 571 | 590 | else |
| 572 | 591 | { |
| 573 | | if (A) output += sprintf(output, "unused(%s)", regnames[A]); |
| 592 | if (ignore_dst == 1) { if (A) output += sprintf(output, "unused(%s)", regnames[A]); } |
| 593 | else { if (A != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[A]); } // mul operations expect A to be set to LIMM (no output) |
| 574 | 594 | } |
| 575 | 595 | } |
| 576 | 596 | else |
| 577 | 597 | { |
| 578 | 598 | output += sprintf( output, "C(%s) ", regnames[C]); |
| 579 | | if (!ignore_dst) output += sprintf( output, "DST(%s)", regnames[A]); |
| 599 | if (ignore_dst == 0) |
| 600 | { |
| 601 | if (A != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[A]); |
| 602 | else output += sprintf(output, "<no dst>"); |
| 603 | } |
| 580 | 604 | else |
| 581 | 605 | { |
| 582 | | if (A) output += sprintf(output, "unused(%s)", regnames[A]); |
| 606 | if (ignore_dst == 1) { if (A) output += sprintf(output, "unused(%s)", regnames[A]); } |
| 607 | else { if (A != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[A]); } // mul operations expect A to be set to LIMM (no output) |
| 583 | 608 | } |
| 584 | 609 | |
| 585 | 610 | } |
| r242440 | r242441 | |
| 591 | 616 | int A = (op & 0x0000003f) >> 0; op &= ~0x0000003f; |
| 592 | 617 | |
| 593 | 618 | output += sprintf( output, "U(%02x) ", U ); |
| 594 | | if (!ignore_dst) output += sprintf( output, "DST(%s)", regnames[A]); |
| 619 | if (ignore_dst == 0) |
| 620 | { |
| 621 | if (A != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[A]); |
| 622 | else output += sprintf(output, "<no dst>"); |
| 623 | } |
| 595 | 624 | else |
| 596 | 625 | { |
| 597 | | if (A) output += sprintf(output, "unused(%s)", regnames[A]); |
| 626 | if (ignore_dst == 1) { if (A) output += sprintf(output, "unused(%s)", regnames[A]); } |
| 627 | else { if (A != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[A]); } // mul operations expect A to be set to LIMM (no output) |
| 598 | 628 | } |
| 599 | 629 | } |
| 600 | 630 | else if (p == 2) |
| r242440 | r242441 | |
| 608 | 638 | int M = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 609 | 639 | int Q = (op & 0x0000001f) >> 0; op &= ~0x0000001f; |
| 610 | 640 | |
| 641 | |
| 611 | 642 | output += sprintf( output, " M(%d)", M); |
| 612 | 643 | output += sprintf( output, " Cond<%s> ", conditions[Q]); |
| 613 | 644 | |
| 614 | 645 | if (M == 0) |
| 615 | 646 | { |
| 616 | 647 | int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; |
| 617 | | output += sprintf( output, "C(%s)", regnames[C]); |
| 648 | |
| 649 | if (C == LIMM_REG) |
| 650 | { |
| 651 | if (!got_limm) |
| 652 | { |
| 653 | GET_LIMM_32; |
| 654 | size = 8; |
| 655 | } |
| 656 | output += sprintf(output, "(%08x)", limm); |
| 657 | } |
| 658 | else |
| 659 | { |
| 660 | output += sprintf(output, "C(%s)", regnames[C]); |
| 661 | } |
| 618 | 662 | |
| 619 | 663 | } |
| 620 | 664 | else if (M == 1) |
| r242440 | r242441 | |
| 972 | 1016 | int arcompact_handle05_01_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "LSR", 0,0); } |
| 973 | 1017 | int arcompact_handle05_02_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "ASR", 0,0); } |
| 974 | 1018 | int arcompact_handle05_03_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "ROR", 0,0); } |
| 975 | | int arcompact_handle05_04_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MUL64", 0,0); } // special |
| 976 | | int arcompact_handle05_05_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MULU64", 0,0);} // special |
| 1019 | int arcompact_handle05_04_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MUL64", 2,0); } // special |
| 1020 | int arcompact_handle05_05_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MULU64", 2,0);} // special |
| 977 | 1021 | int arcompact_handle05_06_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADDS", 0,0); } |
| 978 | 1022 | int arcompact_handle05_07_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUBS", 0,0); } |
| 979 | 1023 | int arcompact_handle05_08_dasm(DASM_OPS_32) { return arcompact_handle04_helper_dasm(DASM_PARAMS, "DIVAW", 0,0); } |