mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
unidasm: Add disassemblers for NEC/Renesas V850 family
This commit is contained in:
parent
b3e4af560a
commit
75a7445a98
@ -2017,6 +2017,15 @@ if (CPUS["V810"]~=null or _OPTIONS["with-tools"]) then
|
||||
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/v810/v810dasm.h")
|
||||
end
|
||||
|
||||
--------------------------------------------------
|
||||
-- NEC V850, disassembler only
|
||||
--------------------------------------------------
|
||||
|
||||
if (_OPTIONS["with-tools"]) then
|
||||
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/v850/v850dasm.cpp")
|
||||
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/v850/v850dasm.h")
|
||||
end
|
||||
|
||||
--------------------------------------------------
|
||||
-- NEC uPD7725
|
||||
--@src/devices/cpu/upd7725/upd7725.h,CPUS["UPD7725"] = true
|
||||
|
1028
src/devices/cpu/v850/v850dasm.cpp
Normal file
1028
src/devices/cpu/v850/v850dasm.cpp
Normal file
File diff suppressed because it is too large
Load Diff
86
src/devices/cpu/v850/v850dasm.h
Normal file
86
src/devices/cpu/v850/v850dasm.h
Normal file
@ -0,0 +1,86 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:AJR
|
||||
|
||||
#ifndef MAME_CPU_V850_V850DASM_H
|
||||
#define MAME_CPU_V850_V850DASM_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
|
||||
class v850_disassembler : public util::disasm_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
v850_disassembler();
|
||||
|
||||
// disassembler overrides
|
||||
virtual u32 opcode_alignment() const override;
|
||||
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override;
|
||||
|
||||
protected:
|
||||
// internal helpers
|
||||
virtual void format_system_reg(std::ostream &stream, u8 sreg);
|
||||
void format_imm5_signed(std::ostream &stream, u8 imm5);
|
||||
void format_imm16_signed(std::ostream &stream, u16 imm16);
|
||||
void format_disp16_reg(std::ostream &stream, u16 disp16, u8 reg);
|
||||
void format_disp8_ep(std::ostream &stream, u8 disp8);
|
||||
virtual offs_t dasm_000000(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_000010(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_000011(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_0001(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_010x(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_1100(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_1101(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_11110(std::ostream &stream, u16 opcode1, u16 opcode2, offs_t pc, const data_buffer &opcodes);
|
||||
virtual offs_t dasm_extended(std::ostream &stream, u16 opcode1, u16 opcode2, offs_t pc, const data_buffer &opcodes);
|
||||
|
||||
// static tables
|
||||
static const std::string_view s_regs[32];
|
||||
static const std::string_view s_dsp_ops[4];
|
||||
static const std::string_view s_rr_ops[8];
|
||||
static const std::string_view s_imm5_ops[8];
|
||||
static const std::string_view s_bit_ops[4];
|
||||
static const std::string_view s_conds[16];
|
||||
static const std::string_view s_bconds[16];
|
||||
};
|
||||
|
||||
class v850es_disassembler : public v850_disassembler
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
v850es_disassembler();
|
||||
|
||||
protected:
|
||||
void format_list12(std::ostream &stream, u16 list12);
|
||||
virtual void format_system_reg(std::ostream &stream, u8 sreg) override;
|
||||
virtual offs_t dasm_000010(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_000011(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_0001(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_010x(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_1100(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_11110(std::ostream &stream, u16 opcode1, u16 opcode2, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_extended(std::ostream &stream, u16 opcode1, u16 opcode2, offs_t pc, const data_buffer &opcodes) override;
|
||||
|
||||
static const std::string_view s_szx_ops[4];
|
||||
};
|
||||
|
||||
class v850e2_disassembler : public v850es_disassembler
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
v850e2_disassembler();
|
||||
|
||||
protected:
|
||||
void format_disp23_reg(std::ostream &stream, u32 disp23, u8 reg);
|
||||
void format_disp32_reg(std::ostream &stream, u32 disp32, u8 reg);
|
||||
virtual void format_system_reg(std::ostream &stream, u8 sreg) override;
|
||||
virtual offs_t dasm_000000(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_000010(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_010x(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_1101(std::ostream &stream, u16 opcode, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_11110(std::ostream &stream, u16 opcode1, u16 opcode2, offs_t pc, const data_buffer &opcodes) override;
|
||||
virtual offs_t dasm_extended(std::ostream &stream, u16 opcode1, u16 opcode2, offs_t pc, const data_buffer &opcodes) override;
|
||||
};
|
||||
|
||||
#endif // MAME_CPU_V850_V850DASM_H
|
@ -180,6 +180,7 @@ using util::BIT;
|
||||
#include "cpu/upd78k/upd78k3d.h"
|
||||
#include "cpu/v60/v60d.h"
|
||||
#include "cpu/v810/v810dasm.h"
|
||||
#include "cpu/v850/v850dasm.h"
|
||||
#include "cpu/vt50/vt50dasm.h"
|
||||
#include "cpu/vt61/vt61dasm.h"
|
||||
#include "cpu/we32000/we32100d.h"
|
||||
@ -616,6 +617,9 @@ static const dasm_table_entry dasm_table[] =
|
||||
{ "upi41", le, 0, []() -> util::disasm_interface * { return new mcs48_disassembler(true, false); } },
|
||||
{ "v60", le, 0, []() -> util::disasm_interface * { return new v60_disassembler; } },
|
||||
{ "v810", le, 0, []() -> util::disasm_interface * { return new v810_disassembler; } },
|
||||
{ "v850", le, 0, []() -> util::disasm_interface * { return new v850_disassembler; } },
|
||||
{ "v850es", le, 0, []() -> util::disasm_interface * { return new v850es_disassembler; } },
|
||||
{ "v850e2", le, 0, []() -> util::disasm_interface * { return new v850e2_disassembler; } },
|
||||
{ "vt50", le, 0, []() -> util::disasm_interface * { return new vt50_disassembler; } },
|
||||
{ "vt52", le, 0, []() -> util::disasm_interface * { return new vt52_disassembler; } },
|
||||
{ "vt61", le, -1, []() -> util::disasm_interface * { return new vt61_disassembler; } },
|
||||
|
Loading…
Reference in New Issue
Block a user