diff --git a/src/devices/cpu/ns32000/ns32000dasm.cpp b/src/devices/cpu/ns32000/ns32000dasm.cpp index e14db3c6c2d..6f1e0d24e0f 100644 --- a/src/devices/cpu/ns32000/ns32000dasm.cpp +++ b/src/devices/cpu/ns32000/ns32000dasm.cpp @@ -177,6 +177,25 @@ std::string ns32000_disassembler::reglist(u8 imm) return result; } +std::string ns32000_disassembler::config(u8 imm) +{ + static char const *const cfg[] = { "I", "F", "M", "C", "FF", "FM", "FC", "P" }; + std::string result; + + for (unsigned i = 0; i < 8; i++) + { + if (BIT(imm, i)) + { + if (!result.empty()) + result.append(","); + + result.append(cfg[i]); + } + } + + return result; +} + offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_buffer const &opcodes, data_buffer const ¶ms) { uint32_t flags = SUPPORTED; @@ -295,7 +314,6 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b u16 const opword = opcodes.r16(pc + bytes); bytes += 2; char const *const options[] = { "", "B", "W", "W,B", "", "", "U", "U,B" }; - char const *const config[] = { "", "I", "F", "F,I", "M", "M,I", "M,F", "M,F,I", "C", "C,I", "C,F", "C,F,I", "C,M", "C,M,I", "C,M,F", "C,M,F,I" }; size_code const size = size_code(opword & 3); @@ -313,7 +331,7 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b else util::stream_format(stream, "CMPS%c %s", size_char[size], options[BIT(opword, 8, 3)]); break; - case 2: util::stream_format(stream, "SETCFG [%s]", config[BIT(opword, 7, 4)]); break; + case 2: util::stream_format(stream, "SETCFG [%s]", config(BIT(opword, 7, 8))); break; case 3: if (BIT(opword, 7)) util::stream_format(stream, "SKPST%c %s", size_char[size], options[BIT(opword, 8, 3)]); @@ -548,13 +566,35 @@ offs_t ns32000_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b } } break; - case 0xfe: // format 12 + case 0xfe: + // format 12: xxxx xyyy yyoo oo0f 1111 1110 + { + u16 const opword = opcodes.r16(pc + bytes); bytes += 2; + + addr_mode mode[] = { addr_mode(BIT(opword, 11, 5)), addr_mode(BIT(opword, 6, 5)) }; + size_code const size_f = BIT(opword, 0) ? SIZE_D : SIZE_Q; + + mode[0].size_f(size_f); + mode[1].size_f(size_f); + decode(mode, pc, opcodes, bytes); + + switch (BIT(opword, 2, 4)) + { + case 0x2: util::stream_format(stream, "POLY%c %s, %s", BIT(opword, 0) ? 'F' : 'L', mode[0].mode, mode[1].mode); break; + case 0x3: util::stream_format(stream, "DOT%c %s, %s", BIT(opword, 0) ? 'F' : 'L', mode[0].mode, mode[1].mode); break; + case 0x4: util::stream_format(stream, "SCALB%c %s, %s", BIT(opword, 0) ? 'F' : 'L', mode[0].mode, mode[1].mode); break; + case 0x5: util::stream_format(stream, "LOGB%c %s, %s", BIT(opword, 0) ? 'F' : 'L', mode[0].mode, mode[1].mode); break; + default: bytes = 1; break; + } + } + break; case 0x9e: // format 13 bytes = 1; break; case 0x1e: // format 14: xxxx xsss s0oo ooii 0001 1110 { + // TODO: different mmu registers for 32332 and 32532 char const *const mmureg[] = { "BPR0", "BPR1", "", "", "PF0", "PF1", "", "", "SC", "", "MSR", "BCNT", "PTB0", "PTB1", "", "EIA" }; u16 const opword = opcodes.r16(pc + bytes); bytes += 2; diff --git a/src/devices/cpu/ns32000/ns32000dasm.h b/src/devices/cpu/ns32000/ns32000dasm.h index 4992979114f..7b29504cb88 100644 --- a/src/devices/cpu/ns32000/ns32000dasm.h +++ b/src/devices/cpu/ns32000/ns32000dasm.h @@ -46,6 +46,7 @@ protected: std::string displacement_string(offs_t pc, data_buffer const &opcodes, unsigned &bytes, std::string const zero = ""); void decode(addr_mode *mode, offs_t pc, data_buffer const &opcodes, unsigned &bytes); std::string reglist(u8 imm); + std::string config(u8 imm); }; #endif // MAME_CPU_NS32000_NS32000DASM_H