From 53c1578555774ee719131bf80dec3bf82dc5ef9e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 22 Jan 2024 07:00:28 +1100 Subject: cpu/c33: Added synthetics for ext %rs prefix. --- src/devices/cpu/c33/c33dasm.cpp | 554 +++++++++++++++++++++++----------------- src/devices/cpu/c33/c33dasm.h | 22 +- 2 files changed, 326 insertions(+), 250 deletions(-) diff --git a/src/devices/cpu/c33/c33dasm.cpp b/src/devices/cpu/c33/c33dasm.cpp index 0eb4fca42d6..08daaf81155 100644 --- a/src/devices/cpu/c33/c33dasm.cpp +++ b/src/devices/cpu/c33/c33dasm.cpp @@ -72,39 +72,39 @@ std::pair const class_0_00_ops[32] = { { "jp.d %%r%1$u", 4 }, // 000 0011 1 10 00 { nullptr, 0 } }; -std::tuple const class_0_01_ops[32] = { - { "push %%r%1$u", false, false }, // 000 0000 000 01 - { "pop %%r%1$u", false, false }, // 000 0000 001 01 - { "pushs %%r%2$u", true, false }, // 000 0000 010 01 - { "pops %%r%2$u", true, false }, // 000 0000 011 01 - { "mac.w %%r%1$u", false, false }, // 000 0000 100 01 - { "mac.hw %%r%1$u", false, false }, // 000 0000 101 01 - { "macclr", false, true }, // 000 0000 110 01 - { "ld.cf", false, true }, // 000 0000 111 01 - { "divu.w %%r%1$u", false, false }, // 000 0001 000 01 - { "div.w %%r%1$u", false, false }, // 000 0001 001 01 - { "repeat %%r%1$u", false, false }, // 000 0001 010 01 - { "repeat %1$u", false, false }, // 000 0001 011 01 - { nullptr, false, false }, - { "add %%r%1$u,%%dp", false, false }, // 000 0001 101 01 - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false }, - { nullptr, false, false } }; +std::tuple const class_0_01_ops[32] = { + { "push %%r%1$u", nullptr, nullptr, false, false }, // 000 0000 000 01 + { "pop %%r%1$u", nullptr, nullptr, false, false }, // 000 0000 001 01 + { "pushs %%r%3$s", nullptr, nullptr, true, false }, // 000 0000 010 01 + { "pops %%r%3$s", nullptr, nullptr, true, false }, // 000 0000 011 01 + { "mac.w %%r%1$u", nullptr, nullptr, false, false }, // 000 0000 100 01 + { "mac.hw %%r%1$u", nullptr, nullptr, false, false }, // 000 0000 101 01 + { "macclr", nullptr, nullptr, false, true }, // 000 0000 110 01 + { "ld.cf", nullptr, nullptr, false, true }, // 000 0000 111 01 + { "divu.w %%r%1$u", nullptr, nullptr, false, false }, // 000 0001 000 01 + { "div.w %%r%1$u", nullptr, nullptr, false, false }, // 000 0001 001 01 + { "repeat %%r%1$u", nullptr, nullptr, false, false }, // 000 0001 010 01 + { "repeat %1$u", nullptr, nullptr, false, false }, // 000 0001 011 01 + { nullptr, nullptr, nullptr, false, false }, + { "add %%r%1$u,%%dp", "xadd %%r%1$u,%%dp,0x%2$x", "xadd %%r%1$u,%%dp,%%r%2$u", false, false }, // 000 0001 101 01 + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false }, + { nullptr, nullptr, nullptr, false, false } }; std::pair const class_0_jumps[16] = { { nullptr, nullptr }, @@ -124,39 +124,39 @@ std::pair const class_0_jumps[16] = { { "call%1$s 0x%2$x", "xcall%1$s 0x%2$x" }, // 000 1110 { "jp%1$s 0x%2$x", "xjp%1$s 0x%2$x" } }; // 000 1111 -std::pair const class_1_ops[32] = { - { "ld.b %%r%1$u,[%%r%2$u]", "xld.b %%r%1$u,[%%r%2$u + 0x%4$x]" }, // 001 000 00 - { "ld.b %%r%1$u,[%%r%2$u]+", nullptr }, // 001 000 01 - { "add %%r%1$u,%%r%2$u", "xadd %%r%1$u,%%r%2$u,0x%4$x" }, // 001 000 10 - { "srl %%r%1$u,%3$u", nullptr }, // 001 000 11 - { "ld.ub %%r%1$u,[%%r%2$u]", "xld.ub %%r%1$u,[%%r%2$u + 0x%4$x]" }, // 001 001 00 - { "ld.ub %%r%1$u,[%%r%2$u]+", nullptr }, // 001 001 01 - { "sub %%r%1$u,%%r%2$u", "xsub %%r%1$u,%%r%2$u,0x%4$x" }, // 001 001 10 - { "sll %%r%1$u,%3$u", nullptr }, // 001 001 11 - { "ld.h %%r%1$u,[%%r%2$u]", "xld.h %%r%1$u,[%%r%2$u + 0x%4$x]" }, // 001 010 00 - { "ld.h %%r%1$u,[%%r%2$u]+", nullptr }, // 001 010 01 - { "cmp %%r%1$u,%%r%2$u", nullptr }, // 001 010 10 - { "sra %%r%1$u,%3$u", nullptr }, // 001 010 11 - { "ld.uh %%r%1$u,[%%r%2$u]", "xld.uh %%r%1$u,[%%r%2$u + 0x%4$x]" }, // 001 011 00 - { "ld.uh %%r%1$u,[%%r%2$u]+", nullptr }, // 001 011 01 - { "ld.w %%r%1$u,%%r%2$u", nullptr }, // 001 011 10 - { "sla %%r%1$u,%3$u", nullptr }, // 001 011 11 - { "ld.w %%r%1$u,[%%r%2$u]", "xld.w %%r%1$u,[%%r%2$u + 0x%4$x]" }, // 001 100 00 - { "ld.w %%r%1$u,[%%r%2$u]+", nullptr }, // 001 100 01 - { "and %%r%1$u,%%r%2$u", "xand %%r%1$u,%%r%2$u,0x%4$x" }, // 001 100 10 - { "rr %%r%1$u,%3$u", nullptr }, // 001 100 11 - { "ld.b [%%r%2$u],%%r%1$u", "xld.b [%%r%2$u + 0x%4$x],%%r%1$u" }, // 001 101 00 - { "ld.b [%%r%2$u]+,%%r%1$u", nullptr }, // 001 101 01 - { "or %%r%1$u,%%r%2$u", "xoor %%r%1$u,%%r%2$u,0x%4$x" }, // 001 101 10 - { "rl %%r%1$u,%3$u", nullptr }, // 001 101 11 - { "ld.h [%%r%2$u],%%r%1$u", "xld.h [%%r%2$u + 0x%4$x],%%r%1$u" }, // 001 110 00 - { "ld.h [%%r%2$u]+,%%r%1$u", nullptr }, // 001 110 01 - { "xor %%r%1$u,%%r%2$u", "xxor %%r%1$u,%%r%2$u,0x%4$x" }, // 001 110 10 - { nullptr, nullptr }, - { "ld.w [%%r%2$u],%%r%1$u", "xld.w [%%r%2$u + 0x%4$x],%%r%1$u" }, // 001 111 00 - { "ld.w [%%r%2$u]+,%%r%1$u", nullptr }, // 001 111 01 - { "not %%r%1$u,%%r%2$u", nullptr }, // 001 111 10 - { nullptr, nullptr } }; +std::tuple const class_1_ops[32] = { + { "ld.b %%r%1$u,[%%r%2$u]", "xld.b %%r%1$u,[%%r%2$u + 0x%4$x]", "xld.b %%r%1$u,[%%r%2$u + %%r%4$u]" }, // 001 000 00 + { "ld.b %%r%1$u,[%%r%2$u]+", nullptr, nullptr }, // 001 000 01 + { "add %%r%1$u,%%r%2$u", "xadd %%r%1$u,%%r%2$u,0x%4$x", "xadd %%r%1$u,%%r%2$u,%%r%4$u" }, // 001 000 10 + { "srl %%r%1$u,%3$u", nullptr, "xsrl %%r%1$u,%%r%4$u,%3$u" }, // 001 000 11 + { "ld.ub %%r%1$u,[%%r%2$u]", "xld.ub %%r%1$u,[%%r%2$u + 0x%4$x]", "xld.ub %%r%1$u,[%%r%2$u + %%r%4$u]" }, // 001 001 00 + { "ld.ub %%r%1$u,[%%r%2$u]+", nullptr, nullptr }, // 001 001 01 + { "sub %%r%1$u,%%r%2$u", "xsub %%r%1$u,%%r%2$u,0x%4$x", "xsub %%r%1$u,%%r%2$u,%%r%4$u" }, // 001 001 10 + { "sll %%r%1$u,%3$u", nullptr, "xsll %%r%1$u,%%r%4$u,%3$u" }, // 001 001 11 + { "ld.h %%r%1$u,[%%r%2$u]", "xld.h %%r%1$u,[%%r%2$u + 0x%4$x]", "xld.h %%r%1$u,[%%r%2$u + %%r%4$u]" }, // 001 010 00 + { "ld.h %%r%1$u,[%%r%2$u]+", nullptr, nullptr }, // 001 010 01 + { "cmp %%r%1$u,%%r%2$u", nullptr, nullptr }, // 001 010 10 + { "sra %%r%1$u,%3$u", nullptr, "xsra %%r%1$u,%%r%4$u,%3$u" }, // 001 010 11 + { "ld.uh %%r%1$u,[%%r%2$u]", "xld.uh %%r%1$u,[%%r%2$u + 0x%4$x]", "xld.uh %%r%1$u,[%%r%2$u + %%r%4$u]" }, // 001 011 00 + { "ld.uh %%r%1$u,[%%r%2$u]+", nullptr, nullptr }, // 001 011 01 + { "ld.w %%r%1$u,%%r%2$u", nullptr, nullptr }, // 001 011 10 + { "sla %%r%1$u,%3$u", nullptr, "xsla %%r%1$u,%%r%4$u,%3$u" }, // 001 011 11 + { "ld.w %%r%1$u,[%%r%2$u]", "xld.w %%r%1$u,[%%r%2$u + 0x%4$x]", "xld.w %%r%1$u,[%%r%2$u + %%r%4$u]" }, // 001 100 00 + { "ld.w %%r%1$u,[%%r%2$u]+", nullptr, nullptr }, // 001 100 01 + { "and %%r%1$u,%%r%2$u", "xand %%r%1$u,%%r%2$u,0x%4$x", "xand %%r%1$u,%%r%2$u,%%r%4$u" }, // 001 100 10 + { "rr %%r%1$u,%3$u", nullptr, "xrr %%r%1$u,%%r%4$u,%3$u" }, // 001 100 11 + { "ld.b [%%r%2$u],%%r%1$u", "xld.b [%%r%2$u + 0x%4$x],%%r%1$u", "xld.b [%%r%2$u + %%r%4$u],%%r%1$u" }, // 001 101 00 + { "ld.b [%%r%2$u]+,%%r%1$u", nullptr, nullptr }, // 001 101 01 + { "or %%r%1$u,%%r%2$u", "xoor %%r%1$u,%%r%2$u,0x%4$x", "xoor %%r%1$u,%%r%2$u,%%r%4$u" }, // 001 101 10 + { "rl %%r%1$u,%3$u", nullptr, "xrl %%r%1$u,%%r%4$u,%3$u" }, // 001 101 11 + { "ld.h [%%r%2$u],%%r%1$u", "xld.h [%%r%2$u + 0x%4$x],%%r%1$u", "xld.h [%%r%2$u + %%r%4$u],%%r%1$u" }, // 001 110 00 + { "ld.h [%%r%2$u]+,%%r%1$u", nullptr, nullptr }, // 001 110 01 + { "xor %%r%1$u,%%r%2$u", "xxor %%r%1$u,%%r%2$u,0x%4$x", "xxor %%r%1$u,%%r%2$u,%%r%4$u" }, // 001 110 10 + { nullptr, nullptr, nullptr }, + { "ld.w [%%r%2$u],%%r%1$u", "xld.w [%%r%2$u + 0x%4$x],%%r%1$u", "xld.w [%%r%2$u + %%r%4$u],%%r%1$u" }, // 001 111 00 + { "ld.w [%%r%2$u]+,%%r%1$u", nullptr, nullptr }, // 001 111 01 + { "not %%r%1$u,%%r%2$u", nullptr, nullptr }, // 001 111 10 + { nullptr, nullptr, nullptr } }; char const *const class_1_ext_shifts[4] = { nullptr, @@ -189,90 +189,90 @@ std::pair class_1_ext_3[4] = { { "ext %%r%1$u,sll,%2$u", false } }; std::tuple const class_2_3_ops[16] = { - { "ld.b %%r%1$u,[%%sp + 0x%2$x]", "xld.b %%r%1$u,[%%sp + 0x%2$x]",1 }, // 010 000 - { "ld.ub %%r%1$u,[%%sp + 0x%2$x]", "xld.ub %%r%1$u,[%%sp + 0x%2$x]",1 }, // 010 001 - { "ld.h %%r%1$u,[%%sp + 0x%2$x]", "xld.h %%r%1$u,[%%sp + 0x%2$x]",2 }, // 010 010 - { "ld.uh %%r%1$u,[%%sp + 0x%2$x]", "xld.uh %%r%1$u,[%%sp + 0x%2$x]",2 }, // 010 011 - { "ld.w %%r%1$u,[%%sp + 0x%2$x]", "xld.w %%r%1$u,[%%sp + 0x%2$x]",4 }, // 010 100 - { "ld.b [%%sp + 0x%2$x],%%r%1$u", "xld.b [%%sp + 0x%2$x],%%r%1$u",1 }, // 010 101 - { "ld.h [%%sp + 0x%2$x],%%r%1$u", "xld.h [%%sp + 0x%2$x],%%r%1$u",2 }, // 010 110 - { "ld.w [%%sp + 0x%2$x],%%r%1$u", "xld.w [%%sp + 0x%2$x],%%r%1$u",4 }, // 010 111 - { "add %%r%1$u,0x%2$x", "xadd %%r%1$u,0x%2$x", 1 }, // 011 000 - { "sub %%r%1$u,0x%2$x", "xsub %%r%1$u,0x%2$x", 1 }, // 011 001 - { "cmp %%r%1$u,%5$s0x%4$x", "xcmp %%r%1$u,%5$s0x%4$x", 1 }, // 011 010 - { "ld.w %%r%1$u,%5$s0x%4$x", "xld.w %%r%1$u,%5$s0x%4$x", 1 }, // 011 011 - { "and %%r%1$u,0x%3$x", "xand %%r%1$u,0x%3$x", 1 }, // 011 100 - { "or %%r%1$u,0x%3$x", "xoor %%r%1$u,0x%3$x", 1 }, // 011 101 - { "xor %%r%1$u,0x%3$x", "xxor %%r%1$u,0x%3$x", 1 }, // 011 110 - { "not %%r%1$u,0x%3$x", "xnot %%r%1$u,0x%3$x", 1 } }; // 011 111 - -std::pair const class_4_ops[32] = { - { nullptr, false }, - { nullptr, false }, - { nullptr, false }, - { nullptr, false }, - { nullptr, false }, - { nullptr, false }, - { nullptr, false }, - { nullptr, false }, - { "srl %%r%1$u,%2$u", false }, // 100 010 00 - { "srl %%r%1$u,%%r%2$u", false }, // 100 010 01 - { "scan0 %%r%1$u,%%r%2$u", false }, // 100 010 10 - { "div0s %%r%2$u", true }, // 100 010 11 - { "sll %%r%1$u,%2$u", false }, // 100 011 00 - { "sll %%r%1$u,%%r%2$u", false }, // 100 011 01 - { "scan1 %%r%1$u,%%r%2$u", false }, // 100 011 10 - { "div0u %%r%2$u", true }, // 100 011 11 - { "sra %%r%1$u,%2$u", false }, // 100 100 00 - { "sra %%r%1$u,%%r%2$u", false }, // 100 100 01 - { "swap %%r%1$u,%%r%2$u", false }, // 100 100 10 - { "div1 %%r%2$u", true }, // 100 100 11 - { "sla %%r%1$u,%2$u", false }, // 100 101 00 - { "sla %%r%1$u,%%r%2$u", false }, // 100 101 01 - { "mirror %%r%1$u,%%r%2$u", false }, // 100 101 10 - { "div2s %%r%2$u", true }, // 100 101 11 - { "rr %%r%1$u,%2$u", false }, // 100 110 00 - { "rr %%r%1$u,%%r%2$u", false }, // 100 110 01 - { "swaph %%r%1$u,%%r%2$u", false }, // 100 110 10 - { "div3s %%r%2$u", true }, // 100 110 11 - { "rl %%r%1$u,%2$u", false }, // 100 111 00 - { "rl %%r%1$u,%%r%2$u", false }, // 100 111 01 - { "sat.b %%r%1$u,%%r%2$u", false }, // 100 111 10 - { "sat.ub %%r%1$u,%%r%2$u", false } }; // 100 111 11 - -std::tuple const class_5_ops[32] = { - { "ld.w %4$s,%%r%2$d", nullptr, 4, 1 }, // 101 000 00 - { "ld.b %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 000 01 - { "mlt.h %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 000 10 - { "mlt.hw %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 000 11 - { "ld.w %%r%1$d,%4$s", nullptr, 4, 2 }, // 101 001 00 - { "ld.ub %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 001 01 - { "mltu.h %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 001 10 - { "mac1.h %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 001 11 - { "btst [%%r%2$u],%1$u", "xbtst [%%r%2$u + 0x%3$x],%1$u", 3, 0 }, // 101 010 00 - { "ld.h %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 010 01 - { "mlt.w %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 010 10 - { "mac1.hw %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 010 11 - { "bclr [%%r%2$u],%1$u", "xbclr [%%r%2$u + 0x%3$x],%1$u", 3, 0 }, // 101 011 00 - { "ld.uh %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 011 01 - { "mltu.w %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 011 10 - { nullptr, nullptr, 0, 0 }, - { "bset [%%r%2$u],%1$u", "xbset [%%r%2$u + 0x%3$x],%1$u", 3, 0 }, // 101 100 00 - { "ld.c %%r%1$u,0x%2$x", nullptr, 4, 0 }, // 101 100 01 - { "mac %%r%2$u", nullptr, 0, 0 }, // 101 100 10 - { "mac1.w %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 100 11 - { "bnot [%%r%2$u],%1$u", "xbnot [%%r%2$u + 0x%3$x],%1$u", 3, 0 }, // 101 101 00 - { "ld.c 0x%2$x,%%r%1$u", nullptr, 4, 0 }, // 101 101 01 - { "sat.h %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 101 10 - { "sat.uh %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 101 11 - { "addc %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 110 00 - { "loop %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 110 01 - { "loop %%r%1$u,%2$u", nullptr, 4, 0 }, // 101 110 10 - { "loop %1$u,%2$u", nullptr, 4, 0 }, // 101 110 11 - { "sbc %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 111 00 - { "sat.w %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 111 01 - { "sat.uw %%r%1$u,%%r%2$u", nullptr, 4, 0 }, // 101 111 10 - { nullptr, nullptr, 0, 0 } }; + { "ld.b %%r%1$u,[%%sp + 0x%2$x]", "xld.b %%r%1$u,[%%sp + 0x%2$x]", 1 }, // 010 000 + { "ld.ub %%r%1$u,[%%sp + 0x%2$x]", "xld.ub %%r%1$u,[%%sp + 0x%2$x]", 1 }, // 010 001 + { "ld.h %%r%1$u,[%%sp + 0x%2$x]", "xld.h %%r%1$u,[%%sp + 0x%2$x]", 2 }, // 010 010 + { "ld.uh %%r%1$u,[%%sp + 0x%2$x]", "xld.uh %%r%1$u,[%%sp + 0x%2$x]", 2 }, // 010 011 + { "ld.w %%r%1$u,[%%sp + 0x%2$x]", "xld.w %%r%1$u,[%%sp + 0x%2$x]", 4 }, // 010 100 + { "ld.b [%%sp + 0x%2$x],%%r%1$u", "xld.b [%%sp + 0x%2$x],%%r%1$u", 1 }, // 010 101 + { "ld.h [%%sp + 0x%2$x],%%r%1$u", "xld.h [%%sp + 0x%2$x],%%r%1$u", 2 }, // 010 110 + { "ld.w [%%sp + 0x%2$x],%%r%1$u", "xld.w [%%sp + 0x%2$x],%%r%1$u", 4 }, // 010 111 + { "add %%r%1$u,0x%2$x", "xadd %%r%1$u,0x%2$x", 1 }, // 011 000 + { "sub %%r%1$u,0x%2$x", "xsub %%r%1$u,0x%2$x", 1 }, // 011 001 + { "cmp %%r%1$u,%5$s0x%4$x", "xcmp %%r%1$u,%5$s0x%4$x", 1 }, // 011 010 + { "ld.w %%r%1$u,%5$s0x%4$x", "xld.w %%r%1$u,%5$s0x%4$x", 1 }, // 011 011 + { "and %%r%1$u,0x%3$x", "xand %%r%1$u,0x%3$x", 1 }, // 011 100 + { "or %%r%1$u,0x%3$x", "xoor %%r%1$u,0x%3$x", 1 }, // 011 101 + { "xor %%r%1$u,0x%3$x", "xxor %%r%1$u,0x%3$x", 1 }, // 011 110 + { "not %%r%1$u,0x%3$x", "xnot %%r%1$u,0x%3$x", 1 } }; // 011 111 + +std::tuple const class_4_ops[32] = { + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { nullptr, nullptr, false }, + { "srl %%r%1$u,%2$u", "xsrl %%r%1$u,%%r%3$u,%2$u", false }, // 100 010 00 + { "srl %%r%1$u,%%r%2$u", "xsrl %%r%1$u,%%r%3$u,%%r%2$u", false }, // 100 010 01 + { "scan0 %%r%1$u,%%r%2$u", nullptr, false }, // 100 010 10 + { "div0s %%r%2$u", nullptr, true }, // 100 010 11 + { "sll %%r%1$u,%2$u", "xsll %%r%1$u,%%r%3$u,%2$u", false }, // 100 011 00 + { "sll %%r%1$u,%%r%2$u", "xsll %%r%1$u,%%r%3$u,%%r%2$u", false }, // 100 011 01 + { "scan1 %%r%1$u,%%r%2$u", nullptr, false }, // 100 011 10 + { "div0u %%r%2$u", nullptr, true }, // 100 011 11 + { "sra %%r%1$u,%2$u", "xsra %%r%1$u,%%r%3$u,%2$u", false }, // 100 100 00 + { "sra %%r%1$u,%%r%2$u", "xsra %%r%1$u,%%r%3$u,%%r%2$u", false }, // 100 100 01 + { "swap %%r%1$u,%%r%2$u", nullptr, false }, // 100 100 10 + { "div1 %%r%2$u", nullptr, true }, // 100 100 11 + { "sla %%r%1$u,%2$u", "xsla %%r%1$u,%%r%3$u,%2$u", false }, // 100 101 00 + { "sla %%r%1$u,%%r%2$u", "xsla %%r%1$u,%%r%3$u,%%r%2$u", false }, // 100 101 01 + { "mirror %%r%1$u,%%r%2$u", nullptr, false }, // 100 101 10 + { "div2s %%r%2$u", nullptr, true }, // 100 101 11 + { "rr %%r%1$u,%2$u", "xrr %%r%1$u,%%r%3$u,%2$u", false }, // 100 110 00 + { "rr %%r%1$u,%%r%2$u", "xrr %%r%1$u,%%r%3$u,%%r%2$u", false }, // 100 110 01 + { "swaph %%r%1$u,%%r%2$u", nullptr, false }, // 100 110 10 + { "div3s %%r%2$u", nullptr, true }, // 100 110 11 + { "rl %%r%1$u,%2$u", "xrl %%r%1$u,%%r%3$u,%2$u", false }, // 100 111 00 + { "rl %%r%1$u,%%r%2$u", "xrl %%r%1$u,%%r%3$u,%%r%2$u", false }, // 100 111 01 + { "sat.b %%r%1$u,%%r%2$u", nullptr, false }, // 100 111 10 + { "sat.ub %%r%1$u,%%r%2$u", nullptr, false } }; // 100 111 11 + +std::tuple const class_5_ops[32] = { + { "ld.w %4$s,%%r%2$d", nullptr, nullptr, 4, 1 }, // 101 000 00 + { "ld.b %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 000 01 + { "mlt.h %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 000 10 + { "mlt.hw %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 000 11 + { "ld.w %%r%1$d,%4$s", nullptr, nullptr, 4, 2 }, // 101 001 00 + { "ld.ub %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 001 01 + { "mltu.h %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 001 10 + { "mac1.h %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 001 11 + { "btst [%%r%2$u],%1$u", "xbtst [%%r%2$u + 0x%3$x],%1$u", nullptr, 3, 0 }, // 101 010 00 + { "ld.h %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 010 01 + { "mlt.w %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 010 10 + { "mac1.hw %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 010 11 + { "bclr [%%r%2$u],%1$u", "xbclr [%%r%2$u + 0x%3$x],%1$u", nullptr, 3, 0 }, // 101 011 00 + { "ld.uh %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 011 01 + { "mltu.w %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 011 10 + { nullptr, nullptr, nullptr, 0, 0 }, + { "bset [%%r%2$u],%1$u", "xbset [%%r%2$u + 0x%3$x],%1$u", nullptr, 3, 0 }, // 101 100 00 + { "ld.c %%r%1$u,0x%2$x", nullptr, nullptr, 4, 0 }, // 101 100 01 + { "mac %%r%2$u", nullptr, nullptr, 0, 0 }, // 101 100 10 + { "mac1.w %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 100 11 + { "bnot [%%r%2$u],%1$u", "xbnot [%%r%2$u + 0x%3$x],%1$u", nullptr, 3, 0 }, // 101 101 00 + { "ld.c 0x%2$x,%%r%1$u", nullptr, nullptr, 4, 0 }, // 101 101 01 + { "sat.h %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 101 10 + { "sat.uh %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 101 11 + { "adc %%r%1$u,%%r%2$u", nullptr, "xadc %%r%1$u,%%r%2$u,%%r%3$u", 4, 0 }, // 101 110 00 + { "loop %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 110 01 + { "loop %%r%1$u,%2$u", nullptr, nullptr, 4, 0 }, // 101 110 10 + { "loop %1$u,%2$u", nullptr, nullptr, 4, 0 }, // 101 110 11 + { "sbc %%r%1$u,%%r%2$u", nullptr, "xsbc %%r%1$u,%%r%2$u,%%r%3$u", 4, 0 }, // 101 111 00 + { "sat.w %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 111 01 + { "sat.uw %%r%1$u,%%r%2$u", nullptr, nullptr, 4, 0 }, // 101 111 10 + { nullptr, nullptr, nullptr, 0, 0 } }; std::tuple const class_7_ops[8] = { { "ld.b %%r%1$u,[%%dp + 0x%2$x]", "xld.b %%r%1$u,[%%dp + 0x%2$x]", 1 }, // 111 000 @@ -286,6 +286,65 @@ std::tuple const class_7_ops[8] = { } // anonymous namespace + +struct c33_disassembler::ext_info +{ + offs_t size() const + { + switch (type) + { + case ext_type::NONE: + return 0; + case ext_type::IMM13: + return 2; + case ext_type::IMM26: + return 4; + case ext_type::REG: + return 2; + } + + throw false; // something is very wrong if we get here + } + + unsigned bits() const + { + switch (type) + { + case ext_type::NONE: + return 0; + case ext_type::IMM13: + return 13; + case ext_type::IMM26: + return 26; + case ext_type::REG: + return 4; + } + + throw false; // something is very wrong if we get here + } + + char const *inst(char const *base, char const *ext_imm, char const *ext_reg) const + { + switch (type) + { + case ext_type::NONE: + return base; + case ext_type::IMM13: + case ext_type::IMM26: + return ext_imm; + case ext_type::REG: + return ext_reg; + } + + throw false; // something is very wrong if we get here + } + + ext_type type = ext_type::NONE; + u32 val = 0; + u16 op = 0; +}; + + c33_disassembler::c33_disassembler() { } @@ -305,64 +364,77 @@ offs_t c33_disassembler::disassemble( { u16 op; - u32 ext_imm = 0; - unsigned ext_count = 0; + ext_info ext; op = opcodes.r16(pc); if (BIT(op, 13, 3) == 6) { - ext_imm = BIT(op, 0, 13); - ext_count = 1; + ext.type = ext_type::IMM13; + ext.val = BIT(op, 0, 13); + ext.op = op; op = opcodes.r16(pc + 2); if (BIT(op, 13, 3) == 6) { - ext_imm = (ext_imm << 13) | BIT(op, 0, 13); - ext_count = 2; + ext.type = ext_type::IMM26; + ext.val = (ext.val << 13) | BIT(op, 0, 13); op = opcodes.r16(pc + 4); } } + else if ((op & 0b111'111'11'0000'1111) == 0b001'111'11'0000'0000) + { + ext.type = ext_type::REG; + ext.val = BIT(op, 4, 4); + ext.op = op; + op = opcodes.r16(pc + 2); + } + + return dasm(stream, pc, op, ext); +} + +offs_t c33_disassembler::dasm(std::ostream &stream, offs_t pc, u16 op, ext_info const &ext) const +{ switch (BIT(op, 13, 3)) { case 0: - if (offs_t const r = dasm_class_0(stream, pc, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_0(stream, pc, op, ext); r) return r; break; case 1: - if (offs_t const r = dasm_class_1(stream, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_1(stream, op, ext); r) return r; break; case 2: case 3: - if (offs_t const r = dasm_class_2_3(stream, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_2_3(stream, op, ext); r) return r; break; case 4: - if (offs_t const r = dasm_class_4(stream, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_4(stream, op, ext); r) return r; break; case 5: - if (offs_t const r = dasm_class_5(stream, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_5(stream, op, ext); r) return r; break; case 6: - if (offs_t const r = dasm_class_6(stream, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_6(stream, op, ext); r) return r; break; case 7: - if (offs_t const r = dasm_class_7(stream, op, ext_imm, ext_count); r) + if (offs_t const r = dasm_class_7(stream, op, ext); r) return r; break; }; - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return dasm(stream, pc, ext.op, ext_info()); stream << ""; return 2; } -offs_t c33_disassembler::dasm_class_0(std::ostream &stream, offs_t pc, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_0(std::ostream &stream, offs_t pc, u16 op, ext_info const &ext) const { switch (BIT(op, 9, 4)) { @@ -375,8 +447,8 @@ offs_t c33_disassembler::dasm_class_0(std::ostream &stream, offs_t pc, u16 op, u auto const [inst, target_bits] = class_0_00_ops[BIT(op, 6, 5)]; if (inst && ((4 == target_bits) || !BIT(op, target_bits, 4 - target_bits))) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, inst, BIT(op, 0, 4)); return 2; @@ -384,37 +456,42 @@ offs_t c33_disassembler::dasm_class_0(std::ostream &stream, offs_t pc, u16 op, u } else if (BIT(op, 4, 2) == 1) { - auto const [inst, use_special_reg, no_arg] = class_0_01_ops[BIT(op, 6, 5)]; + auto const [inst, inst_ext_imm, inst_ext_reg, use_special_reg, no_arg] = class_0_01_ops[BIT(op, 6, 5)]; char const *const special_reg = use_special_reg ? special_reg_names[BIT(op, 0, 4)] : nullptr; if (inst && (!use_special_reg || special_reg) && (!no_arg || !BIT(op, 0, 4))) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + char const *const fmt = ext.inst(inst, inst_ext_imm, inst_ext_reg); + if (!fmt) + return 0; - util::stream_format(stream, inst, BIT(op, 0, 4), special_reg); - return 2; + util::stream_format(stream, fmt, BIT(op, 0, 4), ext.val, special_reg); + return 2 + ext.size(); } } break; default: { - s32 imm = (BIT(ext_imm, 16, 10) << 22) | (BIT(ext_imm, 0, 13) << 9) | (BIT(op, 0, 8) << 1); - if (!ext_count) + auto const [inst, inst_ext_imm] = class_0_jumps[BIT(op, 9, 5)]; + char const *const fmt = ext.inst(inst, inst_ext_imm, nullptr); + if (!fmt) + return 0; + + s32 imm = (BIT(ext.val, 16, 10) << 22) | (BIT(ext.val, 0, 13) << 9) | (BIT(op, 0, 8) << 1); + if (ext_type::NONE == ext.type) imm = util::sext(imm, 9); - else if (1 == ext_count) + else if (ext_type::IMM13 == ext.type) imm = util::sext(imm, 22); - auto const [inst, inst_ext] = class_0_jumps[BIT(op, 9, 5)]; - util::stream_format(stream, ext_count ? inst_ext : inst, BIT(op, 8) ? ".d" : " ", pc + (ext_count * 2) + imm); - return 2 + (ext_count * 2); + util::stream_format(stream, fmt, BIT(op, 8) ? ".d" : " ", pc + ext.size() + imm); + return 2 + ext.size(); } } return 0; // catch invalid forms } -offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, ext_info const &ext) const { switch (BIT(op, 8, 5)) { @@ -424,8 +501,8 @@ offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, char const *const inst = class_1_ext_shifts[BIT(op, 2, 2)]; if (inst) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, inst, BIT(op, 0, 2)); return 2; @@ -436,8 +513,8 @@ offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, char const *const inst = class_1_ext_predicates[BIT(op, 4, 4)]; if (inst && !BIT(op, 0, 4)) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; stream << inst; return 2; @@ -450,8 +527,8 @@ offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, auto const [inst, no_imm] = class_1_ext_3[BIT(op, 2, 2)]; if (!no_imm || !BIT(op, 0, 2)) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, inst, BIT(op, 4, 4), BIT(op, 0, 2)); return 2; @@ -461,12 +538,13 @@ offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, default: { - auto const [inst, inst_ext] = class_1_ops[BIT(op, 8, 5)]; - if (offs_t const r = max_ext(stream, inst_ext ? 2 : 0, ext_imm, ext_count); r) - return r; + auto const [inst, inst_ext_imm, inst_ext_reg] = class_1_ops[BIT(op, 8, 5)]; + char const *const fmt = ext.inst(inst, inst_ext_imm, inst_ext_reg); + if (!fmt) + return 0; - util::stream_format(stream, ext_count ? inst_ext : inst, BIT(op, 0, 4), BIT(op, 4, 4), 0x10 | BIT(op, 4, 4), ext_imm); - return 2 + (ext_count * 2); + util::stream_format(stream, fmt, BIT(op, 0, 4), BIT(op, 4, 4), 0x10 | BIT(op, 4, 4), ext.val); + return 2 + ext.size(); } } @@ -474,46 +552,50 @@ offs_t c33_disassembler::dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, } -offs_t c33_disassembler::dasm_class_2_3(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_2_3(std::ostream &stream, u16 op, ext_info const &ext) const { - auto const [inst, inst_ext, mul] = class_2_3_ops[BIT(op, 10, 4)]; + auto const [inst, inst_ext_imm, mul] = class_2_3_ops[BIT(op, 10, 4)]; + char const *const fmt = ext.inst(inst, inst_ext_imm, nullptr); + if (!fmt) + return 0; u8 const reg = BIT(op, 0, 4); - u32 imm = (ext_imm << 6) | BIT(op, 4, 6); - s32 simm = util::sext(imm, 6 + (ext_count * 13)); + u32 imm = (ext.val << 6) | BIT(op, 4, 6); + s32 simm = util::sext(imm, 6 + ext.bits()); u32 abs = std::abs(simm); char const *const sign = (0 > simm) ? "-" : ""; - if (!ext_count) + if (ext_type::NONE == ext.type) { imm *= mul; simm *= mul; abs *= mul; } - util::stream_format(stream, ext_count ? inst_ext : inst, reg, imm, simm, abs, sign); - return 2 + (ext_count * 2); + util::stream_format(stream, fmt, reg, imm, simm, abs, sign); + return 2 + ext.size(); } -offs_t c33_disassembler::dasm_class_4(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_4(std::ostream &stream, u16 op, ext_info const &ext) const { if (BIT(op, 11, 2) == 0) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, BIT(op, 10) ? "sub %%sp,0x%1$x" : "add %%sp,0x%1$x", BIT(op, 0, 10) * 4); return 2; } else { - auto const [inst, no_dest] = class_4_ops[BIT(op, 8, 5)]; + auto const [inst, inst_ext_reg, no_dest] = class_4_ops[BIT(op, 8, 5)]; if (!no_dest || !BIT(op, 0, 4)) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + char const *const fmt = ext.inst(inst, nullptr, inst_ext_reg); + if (!fmt) + return 0; - util::stream_format(stream, inst, BIT(op, 0, 4), BIT(op, 4, 4)); - return 2; + util::stream_format(stream, fmt, BIT(op, 0, 4), BIT(op, 4, 4), ext.val); + return 2 + ext.size(); } } @@ -521,43 +603,44 @@ offs_t c33_disassembler::dasm_class_4(std::ostream &stream, u16 op, u32 ext_imm, } -offs_t c33_disassembler::dasm_class_5(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_5(std::ostream &stream, u16 op, ext_info const &ext) const { if (BIT(op, 6, 7) == 0b111'11'00) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, "do.c 0x%1$x", BIT(op, 0, 6)); return 2; } else if (BIT(op, 5, 8) == 0b111'11'01'0) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, "psrset %1$u", BIT(op, 0, 5)); return 2; } else if (BIT(op, 5, 8) == 0b111'11'10'0) { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, "psrclr %1$u", BIT(op, 0, 5)); return 2; } else { - auto const [inst, inst_ext, target_bits, special_reg_pos] = class_5_ops[BIT(op, 8, 5)]; + auto const [inst, inst_ext_imm, inst_ext_reg, target_bits, special_reg_pos] = class_5_ops[BIT(op, 8, 5)]; char const *const special_reg = special_reg_pos ? special_reg_names[BIT(op, (special_reg_pos - 1) * 4, 4)] : nullptr; if (inst && (!special_reg_pos || special_reg) && ((4 == target_bits) || !BIT(op, target_bits, 4 - target_bits))) { - if (offs_t const r = max_ext(stream, inst_ext ? 2 : 0, ext_imm, ext_count); r) - return r; + char const *const fmt = ext.inst(inst, inst_ext_imm, inst_ext_reg); + if (!fmt) + return 0; - util::stream_format(stream, ext_count ? inst_ext : inst, BIT(op, 0, 4), BIT(op, 4, 4), ext_imm, special_reg); - return 2 + (ext_count * 2); + util::stream_format(stream, fmt, BIT(op, 0, 4), BIT(op, 4, 4), ext.val, special_reg); + return 2 + ext.size(); } } @@ -565,38 +648,27 @@ offs_t c33_disassembler::dasm_class_5(std::ostream &stream, u16 op, u32 ext_imm, } -offs_t c33_disassembler::dasm_class_6(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_6(std::ostream &stream, u16 op, ext_info const &ext) const { - if (offs_t const r = max_ext(stream, 0, ext_imm, ext_count); r) - return r; + if (ext_type::NONE != ext.type) + return 0; util::stream_format(stream, "ext 0x%1$x", BIT(op, 0, 13)); return 2; } -offs_t c33_disassembler::dasm_class_7(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const +offs_t c33_disassembler::dasm_class_7(std::ostream &stream, u16 op, ext_info const &ext) const { - auto const [inst, inst_ext, mul] = class_7_ops[BIT(op, 10, 3)]; + auto const [inst, inst_ext_imm, mul] = class_7_ops[BIT(op, 10, 3)]; + char const *const fmt = ext.inst(inst, inst_ext_imm, nullptr); + if (!fmt) + return 0; u8 const reg = BIT(op, 0, 4); - u32 imm = (ext_imm << 6) | BIT(op, 4, 6); - if (!ext_count) + u32 imm = (ext.val << 6) | BIT(op, 4, 6); + if (ext_type::NONE == ext.type) imm *= mul; - util::stream_format(stream, ext_count ? inst_ext : inst, reg, imm); - return 2 + (ext_count * 2); -} - - -offs_t c33_disassembler::max_ext(std::ostream &stream, unsigned max, u32 ext_imm, unsigned ext_count) const -{ - if (max >= ext_count) - { - return 0; - } - else - { - util::stream_format(stream, "ext 0x%1$x", BIT(ext_imm, (ext_count - 1) * 13, 13)); - return 2; - } + util::stream_format(stream, fmt, reg, imm); + return 2 + ext.size(); } diff --git a/src/devices/cpu/c33/c33dasm.h b/src/devices/cpu/c33/c33dasm.h index 5f8254ad05d..4eee7652526 100644 --- a/src/devices/cpu/c33/c33dasm.h +++ b/src/devices/cpu/c33/c33dasm.h @@ -19,15 +19,19 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, data_buffer const &opcodes, data_buffer const ¶ms) override; private: - offs_t dasm_class_0(std::ostream &stream, offs_t pc, u16 op, u32 ext_imm, unsigned ext_count) const; - offs_t dasm_class_1(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const; - offs_t dasm_class_2_3(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const; - offs_t dasm_class_4(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const; - offs_t dasm_class_6(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const; - offs_t dasm_class_5(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const; - offs_t dasm_class_7(std::ostream &stream, u16 op, u32 ext_imm, unsigned ext_count) const; - - offs_t max_ext(std::ostream &stream, unsigned max, u32 ext_imm, unsigned ext_count) const; + enum class ext_type { NONE, IMM13, IMM26, REG }; + + struct ext_info; + + offs_t dasm(std::ostream &stream, offs_t pc, u16 op, ext_info const &ext) const; + + offs_t dasm_class_0(std::ostream &stream, offs_t pc, u16 op, ext_info const &ext) const; + offs_t dasm_class_1(std::ostream &stream, u16 op, ext_info const &ext) const; + offs_t dasm_class_2_3(std::ostream &stream, u16 op, ext_info const &ext) const; + offs_t dasm_class_4(std::ostream &stream, u16 op, ext_info const &ext) const; + offs_t dasm_class_6(std::ostream &stream, u16 op, ext_info const &ext) const; + offs_t dasm_class_5(std::ostream &stream, u16 op, ext_info const &ext) const; + offs_t dasm_class_7(std::ostream &stream, u16 op, ext_info const &ext) const; }; #endif // MAME_CPU_C33_C33DASM_H -- cgit v1.2.3