trunk/src/emu/cpu/i860/i860.c
| r21651 | r21652 | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | | /*************************************************************************** |
| 53 | | * Disassembler hook |
| 54 | | ***************************************************************************/ |
| 52 | extern CPU_DISASSEMBLE( i860 ); |
| 55 | 53 | |
| 56 | | static CPU_DISASSEMBLE( i860 ) |
| 57 | | { |
| 58 | | extern unsigned disasm_i860(char*, unsigned, UINT32); |
| 59 | | |
| 60 | | /* Hard-coded little endian for now. */ |
| 61 | | return disasm_i860(buffer, pc, (oprom[0] << 0) | |
| 62 | | (oprom[1] << 8) | |
| 63 | | (oprom[2] << 16) | |
| 64 | | (oprom[3] << 24)); |
| 65 | | } |
| 66 | | |
| 67 | | |
| 68 | 54 | /************************************************************************** |
| 69 | 55 | * The actual decode and execute code. |
| 70 | 56 | **************************************************************************/ |
trunk/src/emu/cpu/i860/i860dis.c
| r21651 | r21652 | |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | |
| 649 | | /* Entry point for disassembler. */ |
| 650 | | unsigned disasm_i860(char *buf, unsigned pc, UINT32 insn) |
| 649 | CPU_DISASSEMBLE( i860 ) |
| 651 | 650 | { |
| 651 | UINT32 insn = (oprom[0] << 0) | |
| 652 | (oprom[1] << 8) | |
| 653 | (oprom[2] << 16) | |
| 654 | (oprom[3] << 24); |
| 655 | |
| 652 | 656 | int unrecognized_op = 1; |
| 653 | 657 | int upper_6bits = (insn >> 26) & 0x3f; |
| 654 | 658 | char flags = decode_tbl[upper_6bits].flags; |
| 655 | 659 | if (flags & DEC_DECODED) |
| 656 | 660 | { |
| 657 | 661 | const char *s = decode_tbl[upper_6bits].mnemonic; |
| 658 | | decode_tbl[upper_6bits].insn_dis (buf, (char *)s, pc, insn); |
| 662 | decode_tbl[upper_6bits].insn_dis (buffer, (char *)s, pc, insn); |
| 659 | 663 | unrecognized_op = 0; |
| 660 | 664 | } |
| 661 | 665 | else if (flags & DEC_MORE) |
| r21651 | r21652 | |
| 667 | 671 | const char *s = fp_decode_tbl[insn & 0x7f].mnemonic; |
| 668 | 672 | if (fp_flags & DEC_DECODED) |
| 669 | 673 | { |
| 670 | | fp_decode_tbl[insn & 0x7f].insn_dis (buf, (char *)s, pc, insn); |
| 674 | fp_decode_tbl[insn & 0x7f].insn_dis (buffer, (char *)s, pc, insn); |
| 671 | 675 | unrecognized_op = 0; |
| 672 | 676 | } |
| 673 | 677 | } |
| r21651 | r21652 | |
| 678 | 682 | const char *s = core_esc_decode_tbl[insn & 0x3].mnemonic; |
| 679 | 683 | if (esc_flags & DEC_DECODED) |
| 680 | 684 | { |
| 681 | | core_esc_decode_tbl[insn & 0x3].insn_dis (buf, (char *)s, pc, insn); |
| 685 | core_esc_decode_tbl[insn & 0x3].insn_dis (buffer, (char *)s, pc, insn); |
| 682 | 686 | unrecognized_op = 0; |
| 683 | 687 | } |
| 684 | 688 | } |
| 685 | 689 | } |
| 686 | 690 | |
| 687 | 691 | if (unrecognized_op) |
| 688 | | sprintf (buf, ".long\t%#08x", insn); |
| 692 | sprintf (buffer, ".long\t%#08x", insn); |
| 689 | 693 | |
| 690 | 694 | /* Replace tabs with spaces */ |
| 691 | | i860_dasm_tab_replacer(buf, 10); |
| 695 | i860_dasm_tab_replacer(buffer, 10); |
| 692 | 696 | |
| 693 | 697 | /* Return number of bytes disassembled. */ |
| 694 | 698 | /* MAME dasm flags haven't been added yet */ |