From 7bf3044c32c26c5cbf5a4f0add665e302be47e11 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 6 Feb 2023 07:51:29 +1100 Subject: cpu/arcompact: Cleanup: * Moved common instruction field accessors used by the CPU core and disassembler to a shared base class and made them constexpr. * Got the inline member functions bodies file out of the public CPU header so they aren't pulled in by everything using it. * Got most of the disassembler handler declarations out of the public header so they can be changed withut excessive recompiling. --- scripts/src/cpu.lua | 2 + src/devices/cpu/arcompact/arcompact.cpp | 3 +- src/devices/cpu/arcompact/arcompact.h | 151 ++----- src/devices/cpu/arcompact/arcompact_common.h | 109 +++++ src/devices/cpu/arcompact/arcompact_execute.cpp | 3 +- .../cpu/arcompact/arcompact_execute_ops_00to01.cpp | 2 +- .../cpu/arcompact/arcompact_execute_ops_02to03.cpp | 2 +- .../cpu/arcompact/arcompact_execute_ops_04.cpp | 2 +- .../arcompact_execute_ops_04_2f_3f_zop.cpp | 2 +- .../arcompact/arcompact_execute_ops_04_2f_sop.cpp | 2 +- .../cpu/arcompact/arcompact_execute_ops_04_3x.cpp | 2 +- .../cpu/arcompact/arcompact_execute_ops_04_aux.cpp | 2 +- .../arcompact/arcompact_execute_ops_04_jumps.cpp | 2 +- .../arcompact/arcompact_execute_ops_04_loop.cpp | 2 +- .../cpu/arcompact/arcompact_execute_ops_05.cpp | 2 +- .../arcompact/arcompact_execute_ops_05_2f_sop.cpp | 2 +- .../cpu/arcompact/arcompact_execute_ops_06to0b.cpp | 2 +- .../arcompact/arcompact_execute_ops_0c_16bit.cpp | 2 +- .../arcompact/arcompact_execute_ops_0d_16bit.cpp | 2 +- .../arcompact/arcompact_execute_ops_0e_16bit.cpp | 2 +- .../arcompact_execute_ops_0f_00_07_16bit.cpp | 2 +- .../arcompact_execute_ops_0f_00_16bit.cpp | 2 +- .../arcompact/arcompact_execute_ops_0f_16bit.cpp | 2 +- .../arcompact_execute_ops_12to16_16bit.cpp | 2 +- .../arcompact/arcompact_execute_ops_17_16bit.cpp | 2 +- .../arcompact/arcompact_execute_ops_18_16bit.cpp | 2 +- .../arcompact/arcompact_execute_ops_19_16bit.cpp | 2 +- .../arcompact_execute_ops_1ato1c_16bit.cpp | 3 +- .../arcompact_execute_ops_1dto1f_16bit.cpp | 2 +- src/devices/cpu/arcompact/arcompact_helper.ipp | 9 + src/devices/cpu/arcompact/arcompactdasm.cpp | 452 ++++++++++----------- src/devices/cpu/arcompact/arcompactdasm.h | 356 +--------------- src/devices/cpu/arcompact/arcompactdasm_internal.h | 251 ++++++++++++ src/devices/cpu/arcompact/arcompactdasm_ops.cpp | 51 ++- .../cpu/arcompact/arcompactdasm_ops_00to01.cpp | 54 +-- .../cpu/arcompact/arcompactdasm_ops_02to03.cpp | 15 +- src/devices/cpu/arcompact/arcompactdasm_ops_04.cpp | 149 ++++--- .../arcompact/arcompactdasm_ops_04_2f_3f_zop.cpp | 13 +- .../cpu/arcompact/arcompactdasm_ops_04_2f_sop.cpp | 39 +- .../cpu/arcompact/arcompactdasm_ops_04_3x.cpp | 25 +- src/devices/cpu/arcompact/arcompactdasm_ops_05.cpp | 29 +- .../cpu/arcompact/arcompactdasm_ops_05_2f_sop.cpp | 31 +- .../cpu/arcompact/arcompactdasm_ops_06to0b.cpp | 15 +- .../cpu/arcompact/arcompactdasm_ops_16bit.cpp | 269 ++++++------ 44 files changed, 993 insertions(+), 1082 deletions(-) create mode 100644 src/devices/cpu/arcompact/arcompact_common.h create mode 100644 src/devices/cpu/arcompact/arcompactdasm_internal.h diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 996fdbc52d8..e40c49cc94f 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -152,8 +152,10 @@ if CPUS["ARCOMPACT"] then end if opt_tool(CPUS, "ARCOMPACT") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompact_common.h") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompactdasm.h") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompactdasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompactdasm_internal.h") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompactdasm_ops.cpp") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompactdasm_ops_00to01.cpp") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/arcompact/arcompactdasm_ops_02to03.cpp") diff --git a/src/devices/cpu/arcompact/arcompact.cpp b/src/devices/cpu/arcompact/arcompact.cpp index 54c19c4d173..7b13e7eafe2 100644 --- a/src/devices/cpu/arcompact/arcompact.cpp +++ b/src/devices/cpu/arcompact/arcompact.cpp @@ -19,7 +19,8 @@ \*********************************/ #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" + #include "arcompactdasm.h" diff --git a/src/devices/cpu/arcompact/arcompact.h b/src/devices/cpu/arcompact/arcompact.h index 85e1378a122..3069684449f 100644 --- a/src/devices/cpu/arcompact/arcompact.h +++ b/src/devices/cpu/arcompact/arcompact.h @@ -9,7 +9,10 @@ #pragma once -class arcompact_device : public cpu_device +#include "arcompact_common.h" + + +class arcompact_device : public cpu_device, protected arcompact_common { public: // construction/destruction @@ -113,101 +116,6 @@ private: m_regs[REG_LIMM] |= READ16((m_pc + 4)); } - // registers used in 16-bit opcodes have a limited range - // and can only address registers r0-r3 and r12-r15 - static uint8_t common16_get_and_expand_breg(uint16_t op) - { - uint8_t reg = ((op & 0x0700) >> 8); - if (reg>3) reg += 8; - return reg; - } - - static uint8_t common16_get_and_expand_creg(uint16_t op) - { - uint8_t reg = ((op & 0x00e0) >> 5); - if (reg>3) reg += 8; - return reg; - } - - static uint8_t common16_get_and_expand_areg(uint16_t op) - { - uint8_t reg = op & 0x0007; - if (reg>3) reg += 8; - return reg; - } - - static uint8_t common16_get_u3(uint16_t op) - { - return op & 0x0007; - } - - static uint8_t common16_get_u5(uint16_t op) - { - return op & 0x001f; - } - - static uint8_t common16_get_u8(uint16_t op) - { - return op & 0x00ff; - } - - static uint8_t common16_get_u7(uint16_t op) - { - return op & 0x007f; - } - - static uint32_t common16_get_s9(uint16_t op) - { - uint32_t s = util::sext(op, 9); - return s; - } - - static uint8_t common32_get_breg(uint32_t op) - { - int b_temp = (op & 0x07000000) >> 24; - int B_temp = (op & 0x00007000) >> 12; - return b_temp | (B_temp << 3); - } - - static bool common32_get_F(uint32_t op) - { - return (op & 0x00008000) ? true : false; - } - - static uint8_t common32_get_creg(uint32_t op) - { - return (op & 0x00000fc0) >> 6; - } - - static uint8_t common32_get_areg(uint32_t op) - { - return op & 0x0000003f; - } - - static uint8_t common32_get_p(uint32_t op) - { - return (op & 0x00c00000) >> 22; - } - - static uint8_t common32_get_areg_reserved(uint32_t op) - { - return op & 0x0000003f; - } - - static uint32_t common32_get_s12(uint32_t op) - { - int S_temp = op & 0x0000003f; - int s_temp = (op & 0x00000fc0) >> 6; - uint32_t S = s_temp | (S_temp<<6); - S = util::sext(S, 12); - return S; - } - - static uint32_t common32_get_u6(uint32_t op) - { - return (op & 0x00000fc0) >> 6; - } - int check_limm16(uint8_t hreg) { if (hreg == REG_LIMM) @@ -245,11 +153,6 @@ private: return h; } - static uint8_t common32_get_condition(uint32_t op) - { - return op & 0x0000001f; - } - void status32_set_e1() { m_status32 |= E1_FLAG; } void status32_clear_e1() { m_status32 &= ~E1_FLAG; } bool status32_check_e1() { return (m_status32 & E1_FLAG ? true : false); } @@ -379,10 +282,10 @@ private: uint32_t handleop32_FLAG(uint32_t op); // arcompact_execute_ops_04_jumps.cpp - inline uint32_t handle_jump_to_addr(bool delay, bool link, uint32_t address, uint32_t next_addr); - inline uint32_t handle_jump_to_register(bool delay, bool link, uint32_t reg, uint32_t next_addr, int flag); - inline uint32_t handleop32_Jcc_f_a_b_c_helper(uint32_t op, bool delay, bool link); - inline uint32_t handleop32_Jcc_cc_f_b_b_c_helper(uint32_t op, bool delay, bool link); + uint32_t handle_jump_to_addr(bool delay, bool link, uint32_t address, uint32_t next_addr); + uint32_t handle_jump_to_register(bool delay, bool link, uint32_t reg, uint32_t next_addr, int flag); + uint32_t handleop32_Jcc_f_a_b_c_helper(uint32_t op, bool delay, bool link); + uint32_t handleop32_Jcc_cc_f_b_b_c_helper(uint32_t op, bool delay, bool link); uint32_t handleop32_J(uint32_t op, bool delay, bool link); // arcompact_execute_ops_04_aux.cpp @@ -601,7 +504,7 @@ private: m_regs[REG_PCL] = m_pc & 0xfffffffc; // always 32-bit aligned } - inline uint32_t READ32(uint32_t address) + uint32_t READ32(uint32_t address) { if (address & 0x3) fatalerror("%08x: attempted unaligned READ32 on address %08x", m_pc, address); @@ -609,54 +512,54 @@ private: return m_program->read_dword(address); } - inline void WRITE32(uint32_t address, uint32_t data) + void WRITE32(uint32_t address, uint32_t data) { if (address & 0x3) fatalerror("%08x: attempted unaligned WRITE32 on address %08x", m_pc, address); m_program->write_dword(address, data); } - inline uint16_t READ16(uint32_t address) + uint16_t READ16(uint32_t address) { if (address & 0x1) fatalerror("%08x: attempted unaligned READ16 on address %08x", m_pc, address); return m_program->read_word(address); } - inline void WRITE16(uint32_t address, uint16_t data) + void WRITE16(uint32_t address, uint16_t data) { if (address & 0x1) fatalerror("%08x: attempted unaligned WRITE16 on address %08x", m_pc, address); m_program->write_word(address, data); } - inline uint8_t READ8(uint32_t address) + uint8_t READ8(uint32_t address) { return m_program->read_byte(address); } - inline void WRITE8(uint32_t address, uint8_t data) + void WRITE8(uint32_t address, uint8_t data) { m_program->write_byte(address, data); } - inline uint64_t READAUX(uint64_t address) { return m_io->read_dword(address); } - inline void WRITEAUX(uint64_t address, uint32_t data) { m_io->write_dword(address, data); } + uint64_t READAUX(uint64_t address) { return m_io->read_dword(address); } + void WRITEAUX(uint64_t address, uint32_t data) { m_io->write_dword(address, data); } // arcompact_helper.ipp - inline bool check_condition(uint8_t condition); - inline void do_flags_overflow(uint32_t result, uint32_t b, uint32_t c); - inline void do_flags_add(uint32_t result, uint32_t b, uint32_t c); - inline void do_flags_sub(uint32_t result, uint32_t b, uint32_t c); - inline void do_flags_nz(uint32_t result); + bool check_condition(uint8_t condition); + void do_flags_overflow(uint32_t result, uint32_t b, uint32_t c); + void do_flags_add(uint32_t result, uint32_t b, uint32_t c); + void do_flags_sub(uint32_t result, uint32_t b, uint32_t c); + void do_flags_nz(uint32_t result); using ophandler32 = uint32_t (*)(arcompact_device &obj, uint32_t src1, uint32_t src2, bool set_flags); using ophandler32_ff = void (*)(arcompact_device &obj, uint32_t src1, uint32_t src2); using ophandler32_mul = void (*)(arcompact_device &obj, uint32_t src1, uint32_t src2); using ophandler32_sop = uint32_t (*)(arcompact_device &obj, uint32_t src1, bool set_flags); - inline uint32_t handleop32_general(uint32_t op, ophandler32 ophandler); - inline uint32_t handleop32_general_MULx64(uint32_t op, ophandler32_mul ophandler); - inline uint32_t handleop32_general_nowriteback_forced_flag(uint32_t op, ophandler32_ff ophandler); - inline uint32_t handleop32_general_SOP_group(uint32_t op, ophandler32_sop ophandler); - inline void arcompact_handle_ld_helper(uint32_t op, uint8_t areg, uint8_t breg, uint32_t s, uint8_t X, uint8_t Z, uint8_t a); + uint32_t handleop32_general(uint32_t op, ophandler32 ophandler); + uint32_t handleop32_general_MULx64(uint32_t op, ophandler32_mul ophandler); + uint32_t handleop32_general_nowriteback_forced_flag(uint32_t op, ophandler32_ff ophandler); + uint32_t handleop32_general_SOP_group(uint32_t op, ophandler32_sop ophandler); + void arcompact_handle_ld_helper(uint32_t op, uint8_t areg, uint8_t breg, uint32_t s, uint8_t X, uint8_t Z, uint8_t a); // config uint32_t m_default_vector_base; @@ -692,6 +595,4 @@ private: DECLARE_DEVICE_TYPE(ARCA5, arcompact_device) -#include "arcompact_helper.ipp" - #endif // MAME_CPU_ARCOMPACT_ARCOMPACT_H diff --git a/src/devices/cpu/arcompact/arcompact_common.h b/src/devices/cpu/arcompact/arcompact_common.h new file mode 100644 index 00000000000..bf658f5cdf3 --- /dev/null +++ b/src/devices/cpu/arcompact/arcompact_common.h @@ -0,0 +1,109 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/*********************************\ + ARCompact Core +\*********************************/ + +#ifndef MAME_CPU_ARCOMPACT_ARCOMPACT_COMMON_H +#define MAME_CPU_ARCOMPACT_ARCOMPACT_COMMON_H + +#pragma once + + +class arcompact_common +{ +protected: + // registers used in 16-bit opcodes have a limited range + // and can only address registers r0-r3 and r12-r15 + static constexpr uint8_t common_expand_reg(uint8_t reg) + { + return (reg > 3) ? (reg + 8) : reg; + } + + static constexpr uint8_t common16_get_and_expand_breg(uint16_t op) + { + return common_expand_reg((op & 0x0700) >> 8); + } + + static constexpr uint8_t common16_get_and_expand_creg(uint16_t op) + { + return common_expand_reg((op & 0x00e0) >> 5); + } + + static constexpr uint8_t common16_get_and_expand_areg(uint16_t op) + { + return common_expand_reg(op & 0x0007); + } + + static constexpr uint32_t common16_get_u3(uint16_t op) + { + return op & 0x0007; + } + + static constexpr uint32_t common16_get_u5(uint16_t op) + { + return op & 0x001f; + } + + static constexpr uint32_t common16_get_u7(uint16_t op) + { + return op & 0x007f; + } + + static constexpr uint32_t common16_get_u8(uint16_t op) + { + return op & 0x00ff; + } + + static constexpr uint32_t common16_get_s9(uint16_t op) + { + return util::sext(op, 9); + } + + static constexpr uint8_t common32_get_areg(uint32_t op) + { + return op & 0x0000003f; + } + + static constexpr uint8_t common32_get_areg_reserved(uint32_t op) + { + return op & 0x0000003f; + } + + static constexpr uint8_t common32_get_breg(uint32_t op) + { + return ((op & 0x07000000) >> 24) | (((op & 0x00007000) >> 12) << 3); + } + + static constexpr uint8_t common32_get_creg(uint32_t op) + { + return (op & 0x00000fc0) >> 6; + } + + static constexpr uint8_t common32_get_condition(uint32_t op) + { + return op & 0x0000001f; + } + + static constexpr bool common32_get_F(uint32_t op) + { + return (op & 0x00008000) ? true : false; + } + + static constexpr uint8_t common32_get_p(uint32_t op) + { + return (op & 0x00c00000) >> 22; + } + + static constexpr uint32_t common32_get_u6(uint32_t op) + { + return (op & 0x00000fc0) >> 6; + } + + static constexpr uint32_t common32_get_s12(uint32_t op) + { + return util::sext(((op & 0x00000fc0) >> 6) | ((op & 0x0000003f) << 6), 12); + } +}; + +#endif // MAME_CPU_ARCOMPACT_ARCOMPACT_COMMON_H diff --git a/src/devices/cpu/arcompact/arcompact_execute.cpp b/src/devices/cpu/arcompact/arcompact_execute.cpp index 26d73da312c..d7da4fd1e2a 100644 --- a/src/devices/cpu/arcompact/arcompact_execute.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute.cpp @@ -2,8 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" -#include "arcompactdasm.h" +#include "arcompact_helper.ipp" /* diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_00to01.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_00to01.cpp index 0732bda7fa7..173920a34aa 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_00to01.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_00to01.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // helpers for below this group of opcodes diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_02to03.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_02to03.cpp index 5b0d8b7a219..4cffe51e49a 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_02to03.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_02to03.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04.cpp index 017a5911841..d6196a977c1 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ADD<.f> a,b,c 0010 0bbb 0000 0000 FBBB CCCC CCAA AAAA diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_3f_zop.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_3f_zop.cpp index a590ac7738a..96630ef7215 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_3f_zop.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_3f_zop.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I$$$ SS SSSS $$$ ss ssss diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_sop.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_sop.cpp index d95bafadac1..f3da17dd7a2 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_sop.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04_2f_sop.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I SS SSSS ss ssss diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04_3x.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04_3x.cpp index fa28bf94ff7..8395c2b2d9b 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04_3x.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04_3x.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I SS SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04_aux.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04_aux.cpp index f13956db514..427135dbece 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04_aux.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04_aux.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I SS SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04_jumps.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04_jumps.cpp index 49cb37969ca..98fa4c59c48 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04_jumps.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04_jumps.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" uint32_t arcompact_device::handle_jump_to_addr(bool delay, bool link, uint32_t address, uint32_t next_addr) { diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_04_loop.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_04_loop.cpp index a507c327b50..492c3de9533 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_04_loop.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_04_loop.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I SS SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_05.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_05.cpp index 23abed07547..34a4ca6aa93 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_05.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_05.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // IIII I SS SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_05_2f_sop.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_05_2f_sop.cpp index a5c1bf8db89..2757b131870 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_05_2f_sop.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_05_2f_sop.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // SWAP - Swap words (optional extension on ARCtangent-A5 / ARC600, built in on ARC700) diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_06to0b.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_06to0b.cpp index a13ae223e4e..2f6acef3e48 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_06to0b.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_06to0b.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" uint32_t arcompact_device::handleop32_ARC_EXT06(uint32_t op) { diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_0c_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_0c_16bit.cpp index eef4d5c9e1d..74930706e0d 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_0c_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_0c_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I S S diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_0d_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_0d_16bit.cpp index 6d74b73565c..6c19f582d02 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_0d_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_0d_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // ADD_S c,b,u3 0110 1bbb ccc0 0uuu diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_0e_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_0e_16bit.cpp index d281b4d5cd6..b37ade9e721 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_0e_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_0e_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I S S diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_07_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_07_16bit.cpp index 942eb6d126c..5ab05b0ff77 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_07_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_07_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I$$$ sssS SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_16bit.cpp index aea8df03be9..796a1fd8988 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_0f_00_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I sssS SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_0f_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_0f_16bit.cpp index 58a8acf6840..14b2223b3a0 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_0f_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_0f_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I S SSSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_12to16_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_12to16_16bit.cpp index a1034622d83..66a6ee6edac 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_12to16_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_12to16_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_17_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_17_16bit.cpp index 3146bc78426..d28b9e33ffe 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_17_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_17_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I SSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_18_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_18_16bit.cpp index b4ef609f44c..25ab85d8fcd 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_18_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_18_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I SSS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_19_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_19_16bit.cpp index 8a03a30e78f..c4d63efc95a 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_19_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_19_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII ISS diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_1ato1c_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_1ato1c_16bit.cpp index 90fed9733cc..165a4c646ef 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_1ato1c_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_1ato1c_16bit.cpp @@ -2,8 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" -#include "arcompactdasm.h" +#include "arcompact_helper.ipp" // ####################################################################################################################### // IIII I diff --git a/src/devices/cpu/arcompact/arcompact_execute_ops_1dto1f_16bit.cpp b/src/devices/cpu/arcompact/arcompact_execute_ops_1dto1f_16bit.cpp index 9f157ff7d37..c1c25f9724b 100644 --- a/src/devices/cpu/arcompact/arcompact_execute_ops_1dto1f_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute_ops_1dto1f_16bit.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood #include "emu.h" -#include "arcompact.h" +#include "arcompact_helper.ipp" inline uint32_t arcompact_device::branch_common(uint16_t op, bool cond, unsigned width) { diff --git a/src/devices/cpu/arcompact/arcompact_helper.ipp b/src/devices/cpu/arcompact/arcompact_helper.ipp index c84332095ff..635d142066b 100644 --- a/src/devices/cpu/arcompact/arcompact_helper.ipp +++ b/src/devices/cpu/arcompact/arcompact_helper.ipp @@ -1,5 +1,12 @@ // license:BSD-3-Clause // copyright-holders:David Haywood +#ifndef MAME_CPU_ARCOMPACT_ARCOMPACT_HELPER_IPP +#define MAME_CPU_ARCOMPACT_ARCOMPACT_HELPER_IPP + +#pragma once + +#include "arcompact.h" + inline bool arcompact_device::check_condition(uint8_t condition) { @@ -360,3 +367,5 @@ inline uint32_t arcompact_device::handleop32_general_SOP_group(uint32_t op, opha } return 0; } + +#endif // MAME_CPU_ARCOMPACT_ARCOMPACT_HELPER_IPP diff --git a/src/devices/cpu/arcompact/arcompactdasm.cpp b/src/devices/cpu/arcompact/arcompactdasm.cpp index 05e3fe41b6a..b9cf4354f80 100644 --- a/src/devices/cpu/arcompact/arcompactdasm.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm.cpp @@ -6,7 +6,7 @@ \*********************************/ #include "emu.h" -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" u32 arcompact_disassembler::opcode_alignment() const { @@ -566,14 +566,14 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // B<.d> s21 0000 0sss ssss sss0 SSSS SSSS SSNQ QQQQ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_B_cc_D_s21(stream, pc, op, opcodes); break; // Branch Conditionally + size = handle::dasm32_B_cc_D_s21(stream, pc, op, opcodes); break; // Branch Conditionally } case 0x01: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // B<.d> s25 0000 0sss ssss sss1 SSSS SSSS SSNR tttt // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_B_D_s25(stream, pc, op, opcodes); break; // Branch Unconditionally Far + size = handle::dasm32_B_D_s25(stream, pc, op, opcodes); break; // Branch Unconditionally Far } } break; @@ -595,14 +595,14 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BL<.cc><.d> s21 0000 1sss ssss ss00 SSSS SSSS SSNQ QQQQ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BL_cc_d_s21(stream, pc, op, opcodes); break; // Branch and Link Conditionally + size = handle::dasm32_BL_cc_d_s21(stream, pc, op, opcodes); break; // Branch and Link Conditionally } case 0x01: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BL<.d> s25 0000 1sss ssss ss10 SSSS SSSS SSNR tttt // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BL_d_s25(stream, pc, op, opcodes); break; // Branch and Link Unconditional Far + size = handle::dasm32_BL_d_s25(stream, pc, op, opcodes); break; // Branch and Link Unconditional Far } } break; @@ -626,7 +626,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BREQ b,limm,s9 0000 1bbb ssss sss1 SBBB 1111 1000 0000 (+ Limm) // BREQ limm,c,s9 0000 1110 ssss sss1 S111 CCCC CC00 0000 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BREQ_reg_reg(stream, pc, op, opcodes); break; // BREQ (reg-reg) + size = handle::dasm32_BREQ_reg_reg(stream, pc, op, opcodes); break; // BREQ (reg-reg) } case 0x01: { @@ -635,7 +635,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BRNE b,limm,s9 0000 1bbb ssss sss1 SBBB 1111 1000 0001 (+ Limm) // BRNE limm,c,s9 0000 1110 ssss sss1 S111 CCCC CC00 0001 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRNE_reg_reg(stream, pc, op, opcodes); break; // BRNE (reg-reg) + size = handle::dasm32_BRNE_reg_reg(stream, pc, op, opcodes); break; // BRNE (reg-reg) } case 0x02: { @@ -644,7 +644,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BRLT b,limm,s9 0000 1bbb ssss sss1 SBBB 1111 1000 0010 (+ Limm) // BRLT limm,c,s9 0000 1110 ssss sss1 S111 CCCC CC00 0010 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRLT_reg_reg(stream, pc, op, opcodes); break; // BRLT (reg-reg) + size = handle::dasm32_BRLT_reg_reg(stream, pc, op, opcodes); break; // BRLT (reg-reg) } case 0x03: { @@ -653,7 +653,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BRGE b,limm,s9 0000 1bbb ssss sss1 SBBB 1111 1000 0011 (+ Limm) // BRGE limm,c,s9 0000 1110 ssss sss1 S111 CCCC CC00 0011 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRGE_reg_reg(stream, pc, op, opcodes); break; // BRGE (reg-reg) + size = handle::dasm32_BRGE_reg_reg(stream, pc, op, opcodes); break; // BRGE (reg-reg) } case 0x04: { @@ -662,7 +662,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BRLO b,limm,s9 0000 1bbb ssss sss1 SBBB 1111 1000 0100 (+ Limm) // BRLO limm,c,s9 0000 1110 ssss sss1 S111 CCCC CC00 0100 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRLO_reg_reg(stream, pc, op, opcodes); break; // BRLO (reg-reg) + size = handle::dasm32_BRLO_reg_reg(stream, pc, op, opcodes); break; // BRLO (reg-reg) } case 0x05: { @@ -671,26 +671,26 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BRHS limm,c,s9 0000 1110 ssss sss1 S111 CCCC CC00 0101 (+ Limm) // BRHS<.d> b,c,s9 0000 1bbb ssss sss1 SBBB CCCC CCN0 0101 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRHS_reg_reg(stream, pc, op, opcodes); break; // BRHS (reg-reg) + size = handle::dasm32_BRHS_reg_reg(stream, pc, op, opcodes); break; // BRHS (reg-reg) } case 0x0e: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BBIT0<.d> b,c,s9 0000 1bbb ssss sss1 SBBB CCCC CCN0 1110 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BBIT0_reg_reg(stream, pc, op, opcodes); break; // BBIT0 (reg-reg) + size = handle::dasm32_BBIT0_reg_reg(stream, pc, op, opcodes); break; // BBIT0 (reg-reg) } case 0x0f: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BBIT1<.d> b,c,s9 0000 1bbb ssss sss1 SBBB CCCC CCN0 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BBIT1_reg_reg(stream, pc, op, opcodes); break; // BBIT1 (reg-reg) + size = handle::dasm32_BBIT1_reg_reg(stream, pc, op, opcodes); break; // BBIT1 (reg-reg) } default: { // 0x06 - 0x0d - size = handle_dasm_reserved(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // reserved + size = handle::dasm_reserved(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // reserved } } break; @@ -705,61 +705,61 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BREQ<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB UUUU UUN1 0000 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BREQ_reg_imm(stream, pc, op, opcodes); break; // BREQ (reg-imm) + size = handle::dasm32_BREQ_reg_imm(stream, pc, op, opcodes); break; // BREQ (reg-imm) } case 0x01: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BRNE<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB UUUU UUN1 0001 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRNE_reg_imm(stream, pc, op, opcodes); break; // BRNE (reg-imm) + size = handle::dasm32_BRNE_reg_imm(stream, pc, op, opcodes); break; // BRNE (reg-imm) } case 0x02: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BRLT<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB UUUU UUN1 0010 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRLT_reg_imm(stream, pc, op, opcodes); break; // BRLT (reg-imm) + size = handle::dasm32_BRLT_reg_imm(stream, pc, op, opcodes); break; // BRLT (reg-imm) } case 0x03: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BRGE<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB UUUU UUN1 0011 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRGE_reg_imm(stream, pc, op, opcodes); break; // BRGE (reg-imm) + size = handle::dasm32_BRGE_reg_imm(stream, pc, op, opcodes); break; // BRGE (reg-imm) } case 0x04: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BRLO<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB UUUU UUN1 0100 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRLO_reg_imm(stream, pc, op, opcodes); break; // BRLO (reg-imm) + size = handle::dasm32_BRLO_reg_imm(stream, pc, op, opcodes); break; // BRLO (reg-imm) } case 0x05: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BRHS<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB UUUU UUN1 0101 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRHS_reg_imm(stream, pc, op, opcodes); break; // BRHS (reg-imm) + size = handle::dasm32_BRHS_reg_imm(stream, pc, op, opcodes); break; // BRHS (reg-imm) } case 0x0e: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BBIT0<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB uuuu uuN1 1110 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BBIT0_reg_imm(stream, pc, op, opcodes); break; // BBIT0 (reg-imm) + size = handle::dasm32_BBIT0_reg_imm(stream, pc, op, opcodes); break; // BBIT0 (reg-imm) } case 0x0f: { // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BBIT1<.d> b,u6,s9 0000 1bbb ssss sss1 SBBB uuuu uuN1 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BBIT1_reg_imm(stream, pc, op, opcodes); break; // BBIT1 (reg-imm) + size = handle::dasm32_BBIT1_reg_imm(stream, pc, op, opcodes); break; // BBIT1 (reg-imm) } default: { // 0x06 - 0x0d - size = handle_dasm_reserved(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // reserved + size = handle::dasm_reserved(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // reserved } } } @@ -784,7 +784,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // 40020310: 1404 3410 // LD.AB r16 <- [r28_SP, 004] 0001 0100 0000 0100 0011 0100 0001 0000 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_LD_r_o(stream, pc, op, opcodes); break; // LD r+o + size = handle::dasm32_LD_r_o(stream, pc, op, opcodes); break; // LD r+o } case 0x03: { @@ -798,7 +798,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // 400202A6: 1CFC B408 // ST.AW [r28_SP, 1fc] <- r16 0001 1100 1111 1100 1011 0100 0000 1000 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ST_r_o(stream, pc, op, opcodes); break; // ST r+o + size = handle::dasm32_ST_r_o(stream, pc, op, opcodes); break; // ST r+o } case 0x04: // op a,b,c (basecase) { @@ -838,7 +838,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // // // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADD(stream, pc, op, opcodes); break; // ADD + size = handle::dasm32_ADD(stream, pc, op, opcodes); break; // ADD } case 0x01: { @@ -857,7 +857,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADC<.f> 0,b,limm 0010 0bbb 0000 0001 FBBB 1111 1011 1110 (+ Limm) // ADC<.cc><.f> 0,limm,c 0010 0110 1100 0001 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADC(stream, pc, op, opcodes); break; // ADC + size = handle::dasm32_ADC(stream, pc, op, opcodes); break; // ADC } case 0x02: { @@ -876,7 +876,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUB <.f> 0,b,limm 0010 0bbb 0000 0010 FBBB 1111 1011 1110 (+ Limm) // SUB <.cc><.f> 0,limm,c 0010 0110 1100 0010 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SUB(stream, pc, op, opcodes); break; // SUB + size = handle::dasm32_SUB(stream, pc, op, opcodes); break; // SUB } case 0x03: { @@ -895,7 +895,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SBC<.f> 0,b,limm 0010 0bbb 0000 0011 FBBB 1111 1011 1110 (+ Limm) // SBC<.cc><.f> 0,limm,c 0010 0110 1100 0011 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SBC(stream, pc, op, opcodes); break; // SBC + size = handle::dasm32_SBC(stream, pc, op, opcodes); break; // SBC } case 0x04: { @@ -914,7 +914,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // AND<.f> 0,b,limm 0010 0bbb 0000 0100 FBBB 1111 1011 1110 (+ Limm) // AND<.cc><.f> 0,limm,c 0010 0110 1100 0100 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_AND(stream, pc, op, opcodes); break; // AND + size = handle::dasm32_AND(stream, pc, op, opcodes); break; // AND } case 0x05: { @@ -933,7 +933,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // OR<.f> 0,b,limm 0010 0bbb 0000 0101 FBBB 1111 1011 1110 (+ Limm) // OR<.cc><.f> 0,limm,c 0010 0110 1100 010 1 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_OR(stream, pc, op, opcodes); break; // OR + size = handle::dasm32_OR(stream, pc, op, opcodes); break; // OR } case 0x06: { @@ -953,7 +953,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BIC<.f> 0,b,limm 0010 0bbb 0000 0110 FBBB 1111 1011 1110 (+ Limm) // BIC<.cc><.f> 0,limm,c 0010 0110 1100 0110 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BIC(stream, pc, op, opcodes); break; // BIC + size = handle::dasm32_BIC(stream, pc, op, opcodes); break; // BIC } case 0x07: { @@ -973,7 +973,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // XOR<.f> 0,b,limm 0010 0bbb 0000 0111 FBBB 1111 1011 1110 (+ Limm) // XOR<.cc><.f> 0,limm,c 0010 0110 1100 0111 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_XOR(stream, pc, op, opcodes); break; // XOR + size = handle::dasm32_XOR(stream, pc, op, opcodes); break; // XOR } case 0x08: { @@ -993,7 +993,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MAX<.f> 0,b,limm 0010 0bbb 0000 1000 FBBB 1111 1011 1110 (+ Limm) // MAX<.cc><.f> 0,limm,c 0010 0110 1100 1000 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MAX(stream, pc, op, opcodes); break; // MAX + size = handle::dasm32_MAX(stream, pc, op, opcodes); break; // MAX } case 0x09: { @@ -1013,7 +1013,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MIN<.f> 0,b,limm 0010 0bbb 0000 1001 FBBB 1111 1011 1110 (+ Limm) // MIN<.cc><.f> 0,limm,c 0010 0110 1100 1001 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MIN(stream, pc, op, opcodes); break; // MIN + size = handle::dasm32_MIN(stream, pc, op, opcodes); break; // MIN } case 0x0a: { @@ -1032,7 +1032,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // // NOP 0010 0110 0100 1010 0111 0000 0000 0000 (NOP is a custom encoded MOV where b is 'LIMM') // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MOV(stream, pc, op, opcodes); break; // MOV + size = handle::dasm32_MOV(stream, pc, op, opcodes); break; // MOV } case 0x0b: { @@ -1044,7 +1044,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // TST<.cc> b,limm 0010 0bbb 1100 1011 1BBB 1111 100Q QQQQ (+ Limm) // TST<.cc> limm,c 0010 0110 1100 1011 1111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_TST(stream, pc, op, opcodes); break; // TST + size = handle::dasm32_TST(stream, pc, op, opcodes); break; // TST } case 0x0c: { @@ -1056,7 +1056,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // CMP<.cc> b,limm 0010 0bbb 1100 1100 1BBB 1111 100Q QQQQ (+ Limm) // CMP<.cc> limm,c 0010 0110 1100 1100 1111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_CMP(stream, pc, op, opcodes); break; // CMP + size = handle::dasm32_CMP(stream, pc, op, opcodes); break; // CMP } case 0x0d: { @@ -1067,7 +1067,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // RCMP<.cc> b,limm 0010 0bbb 1100 1101 1BBB 1111 100Q QQQQ (+ Limm) // RCMP<.cc> limm,c 0010 0110 1100 1101 1111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_RCMP(stream, pc, op, opcodes); break; // RCMP + size = handle::dasm32_RCMP(stream, pc, op, opcodes); break; // RCMP } case 0x0e: { @@ -1092,7 +1092,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // // IIII I SS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_RSUB(stream, pc, op, opcodes); break; // RSUB + size = handle::dasm32_RSUB(stream, pc, op, opcodes); break; // RSUB } case 0x0f: { @@ -1107,7 +1107,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BSET<.f> 0,b,u6 0010 0bbb 0100 1111 FBBB uuuu uu11 1110 // BSET<.cc><.f> 0,limm,c 0010 0110 1100 1111 F110 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BSET(stream, pc, op, opcodes); break; // BSET + size = handle::dasm32_BSET(stream, pc, op, opcodes); break; // BSET } case 0x10: { @@ -1122,7 +1122,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BCLR<.f> 0,b,u6 0010 0bbb 0101 0000 FBBB uuuu uu11 1110 // BCLR<.cc><.f> 0,limm,c 0010 0110 1101 0000 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BCLR(stream, pc, op, opcodes); break; // BCLR + size = handle::dasm32_BCLR(stream, pc, op, opcodes); break; // BCLR } case 0x11: { @@ -1131,7 +1131,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BTST<.cc> b,u6 0010 0bbb 1101 0001 1BBB uuuu uu1Q QQQQ // BTST<.cc> limm,c 0010 0110 1101 0001 1111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BTST(stream, pc, op, opcodes); break; // BTST + size = handle::dasm32_BTST(stream, pc, op, opcodes); break; // BTST } case 0x12: { @@ -1146,7 +1146,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BXOR<.f> 0,b,u6 0010 0bbb 0101 0010 FBBB uuuu uu11 1110 // BXOR<.cc><.f> 0,limm,c 0010 0110 1101 0010 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BXOR(stream, pc, op, opcodes); break; // BXOR + size = handle::dasm32_BXOR(stream, pc, op, opcodes); break; // BXOR } case 0x13: { @@ -1161,7 +1161,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // BMSK<.f> 0,b,u6 0010 0bbb 0101 0011 FBBB uuuu uu11 1110 // BMSK<.cc><.f> 0,limm,c 0010 0110 1101 0011 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BMSK(stream, pc, op, opcodes); break; // BMSK + size = handle::dasm32_BMSK(stream, pc, op, opcodes); break; // BMSK } case 0x14: { @@ -1181,7 +1181,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADD1<.f> 0,b,limm 0010 0bbb 0001 0100 FBBB 1111 1011 1110 (+ Limm) // ADD1<.cc><.f> 0,limm,c 0010 0110 1101 0100 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADD1(stream, pc, op, opcodes); break; // ADD1 + size = handle::dasm32_ADD1(stream, pc, op, opcodes); break; // ADD1 } case 0x15: { @@ -1201,7 +1201,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADD2<.f> 0,b,limm 0010 0bbb 0001 0101 FBBB 1111 1011 1110 (+ Limm) // ADD2<.cc><.f> 0,limm,c 0010 0110 1101 0101 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADD2(stream, pc, op, opcodes); break; // ADD2 + size = handle::dasm32_ADD2(stream, pc, op, opcodes); break; // ADD2 } case 0x16: { @@ -1221,7 +1221,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADD3<.f> 0,b,limm 0010 0bbb 0001 0110 FBBB 1111 1011 1110 (+ Limm) // ADD3<.cc><.f> 0,limm,c 0010 0110 1101 0110 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADD3(stream, pc, op, opcodes); break; // ADD3 + size = handle::dasm32_ADD3(stream, pc, op, opcodes); break; // ADD3 } case 0x17: { @@ -1241,7 +1241,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUB1<.f> 0,b,limm 0010 0bbb 0001 0111 FBBB 1111 1011 1110 (+ Limm) // SUB1<.cc><.f> 0,limm,c 0010 0110 1101 0111 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SUB1(stream, pc, op, opcodes); break; // SUB1 + size = handle::dasm32_SUB1(stream, pc, op, opcodes); break; // SUB1 } case 0x18: { @@ -1261,7 +1261,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUB2<.f> 0,b,limm 0010 0bbb 0001 1000 FBBB 1111 1011 1110 (+ Limm) // SUB2<.cc><.f> 0,limm,c 0010 0110 1101 1000 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SUB2(stream, pc, op, opcodes); break; // SUB2 + size = handle::dasm32_SUB2(stream, pc, op, opcodes); break; // SUB2 } case 0x19: { @@ -1281,7 +1281,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUB3<.f> 0,limm,c 0010 0110 0001 1001 F111 CCCC CC11 1110 (+ Limm) // SUB3<.cc><.f> 0,limm,c 0010 0110 1101 1001 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SUB3(stream, pc, op, opcodes); break; // SUB3 + size = handle::dasm32_SUB3(stream, pc, op, opcodes); break; // SUB3 } case 0x1a: { @@ -1300,7 +1300,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MPY<.f> 0,b,u6 0010 0bbb 0101 1010 FBBB uuuu uu11 1110 // MPY<.cc><.f> 0,limm,c 0010 0110 1101 1010 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MPY(stream, pc, op, opcodes); break; // MPY * + size = handle::dasm32_MPY(stream, pc, op, opcodes); break; // MPY * } case 0x1b: { @@ -1319,7 +1319,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MPYH<.f> 0,b,u6 0010 0bbb 0101 1011 FBBB uuuu uu11 1110 // MPYH<.cc><.f> 0,limm,c 0010 0110 1101 1011 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MPYH(stream, pc, op, opcodes); break; // MPYH * + size = handle::dasm32_MPYH(stream, pc, op, opcodes); break; // MPYH * } case 0x1c: { @@ -1338,7 +1338,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MPYHU<.f> 0,b,u6 0010 0bbb 0101 1100 FBBB uuuu uu11 1110 // MPYHU<.cc><.f> 0,limm,c 0010 0110 1101 1100 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MPYHU(stream, pc, op, opcodes); break; // MPYHU * + size = handle::dasm32_MPYHU(stream, pc, op, opcodes); break; // MPYHU * } case 0x1d: { @@ -1356,7 +1356,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MPYU<.f> 0,b,u6 0010 0bbb 0101 1101 FBBB uuuu uu11 1110 // MPYU<.cc><.f> 0,limm,c 0010 0110 1101 1101 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MPYU(stream, pc, op, opcodes); break; // MPYU * + size = handle::dasm32_MPYU(stream, pc, op, opcodes); break; // MPYU * } case 0x20: { @@ -1375,7 +1375,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // J u6 0010 0RRR 0110 0000 0RRR uuuu uuRR RRRR // J s12 0010 0RRR 1010 0000 0RRR ssss ssSS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_Jcc(stream, pc, op, opcodes); break; // Jcc + size = handle::dasm32_Jcc(stream, pc, op, opcodes); break; // Jcc } case 0x21: { @@ -1390,7 +1390,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // J.D s12 0010 0RRR 1010 0001 0RRR ssss ssSS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_Jcc_D(stream, pc, op, opcodes); break; // Jcc.D + size = handle::dasm32_Jcc_D(stream, pc, op, opcodes); break; // Jcc.D } case 0x22: { @@ -1404,7 +1404,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // JL u6 0010 0RRR 0110 0010 0RRR uuuu uuRR RRRR // JL s12 0010 0RRR 1010 0010 0RRR ssss ssSS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_JLcc(stream, pc, op, opcodes); break; // JLcc + size = handle::dasm32_JLcc(stream, pc, op, opcodes); break; // JLcc } case 0x23: { @@ -1416,7 +1416,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // JL.D u6 0010 0RRR 0110 0011 0RRR uuuu uuRR RRRR // JL.D s12 0010 0RRR 1010 0011 0RRR ssss ssSS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_JLcc_D(stream, pc, op, opcodes); break; // JLcc.D + size = handle::dasm32_JLcc_D(stream, pc, op, opcodes); break; // JLcc.D } case 0x28: { @@ -1425,7 +1425,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // LP u7 0010 0RRR 1110 1000 0RRR uuuu uu1Q QQQQ // LP s13 0010 0RRR 1010 1000 0RRR ssss ssSS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_LP(stream, pc, op, opcodes); break; // LPcc + size = handle::dasm32_LP(stream, pc, op, opcodes); break; // LPcc } case 0x29: { @@ -1453,7 +1453,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // FLAG<.cc> u6 0010 0rrr 1110 1001 0RRR uuuu uu1Q QQQQ // // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_FLAG(stream, pc, op, opcodes); break; // FLAG + size = handle::dasm32_FLAG(stream, pc, op, opcodes); break; // FLAG } case 0x2a: { @@ -1464,7 +1464,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // LR b,[u6] 0010 0bbb 0110 1010 0BBB uuuu uu00 0000 // LR b,[s12] 0010 0bbb 1010 1010 0BBB ssss ssSS SSSS // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_LR(stream, pc, op, opcodes); break; // LR + size = handle::dasm32_LR(stream, pc, op, opcodes); break; // LR } case 0x2b: { @@ -1478,7 +1478,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SR limm,[u6] 0010 0110 0110 1011 0111 uuuu uu00 0000 // SR limm,[s12] 0010 0110 1010 1011 0111 ssss ssSS SSSS (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SR(stream, pc, op, opcodes); break; // SR + size = handle::dasm32_SR(stream, pc, op, opcodes); break; // SR } case 0x2f: // Sub Opcode { @@ -1497,7 +1497,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ASL<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0000 // ASL<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0000 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ASL_single(stream, pc, op, opcodes); break; // ASL + size = handle::dasm32_ASL_single(stream, pc, op, opcodes); break; // ASL } case 0x01: { @@ -1511,7 +1511,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ASR<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0001 // ASR<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0001 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ASR_single(stream, pc, op, opcodes); break; // ASR + size = handle::dasm32_ASR_single(stream, pc, op, opcodes); break; // ASR } case 0x02: { @@ -1525,7 +1525,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // LSR<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0010 // LSR<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0010 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_LSR_single(stream, pc, op, opcodes); break; // LSR + size = handle::dasm32_LSR_single(stream, pc, op, opcodes); break; // LSR } case 0x03: { @@ -1539,7 +1539,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ROR<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0011 // ROR<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0011 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ROR_single(stream, pc, op, opcodes); break; // ROR + size = handle::dasm32_ROR_single(stream, pc, op, opcodes); break; // ROR } case 0x04: { @@ -1553,7 +1553,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // RRC<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0100 // RRC<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0100 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_RRC(stream, pc, op, opcodes); break; // RCC + size = handle::dasm32_RRC(stream, pc, op, opcodes); break; // RCC } case 0x05: { @@ -1567,7 +1567,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SEXB<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0101 // SEXB<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0101 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SEXB(stream, pc, op, opcodes); break; // SEXB + size = handle::dasm32_SEXB(stream, pc, op, opcodes); break; // SEXB } case 0x06: { @@ -1581,7 +1581,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SEXW<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0110 // SEXW<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0110 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SEXW(stream, pc, op, opcodes); break; // SEXW + size = handle::dasm32_SEXW(stream, pc, op, opcodes); break; // SEXW } case 0x07: { @@ -1595,7 +1595,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // EXTB<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 0111 // EXTB<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 0111 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_EXTB(stream, pc, op, opcodes); break; // EXTB + size = handle::dasm32_EXTB(stream, pc, op, opcodes); break; // EXTB } case 0x08: { @@ -1609,7 +1609,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // EXTW<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 1000 // EXTW<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 1000 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_EXTW(stream, pc, op, opcodes); break; // EXTW + size = handle::dasm32_EXTW(stream, pc, op, opcodes); break; // EXTW } case 0x09: { @@ -1623,7 +1623,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ABS<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 1001 // ABS<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 1001 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ABS(stream, pc, op, opcodes); break; // ABS + size = handle::dasm32_ABS(stream, pc, op, opcodes); break; // ABS } case 0x0a: { @@ -1638,7 +1638,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // NOT<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 1010 (+ Limm) // // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_NOT(stream, pc, op, opcodes); break; // NOT + size = handle::dasm32_NOT(stream, pc, op, opcodes); break; // NOT } case 0x0b: { @@ -1652,7 +1652,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // RLC<.f> 0,u6 0010 0110 0110 1111 F111 uuuu uu00 1011 // RLC<.f> 0,limm 0010 0110 0010 1111 F111 1111 1000 1011 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_RLC(stream, pc, op, opcodes); break; // RLC + size = handle::dasm32_RLC(stream, pc, op, opcodes); break; // RLC } case 0x0c: { @@ -1662,7 +1662,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // EX<.di> b,[u6] 0010 0bbb 0110 1111 DBBB uuuu uu00 1100 // EX<.di> b,[limm] 0010 0bbb 0010 1111 DBBB 1111 1000 1100 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_EX(stream, pc, op, opcodes); break; // EX + size = handle::dasm32_EX(stream, pc, op, opcodes); break; // EX } case 0x3f: // ZOPs (Zero Operand Opcodes) { @@ -1678,7 +1678,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SLEEP 0010 0001 0110 1111 0000 uuuu uu11 1111 // SLEEP c 0010 0001 0010 1111 0000 CCCC CC11 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SLEEP(stream, pc, op, opcodes); break; // SLEEP + size = handle::dasm32_SLEEP(stream, pc, op, opcodes); break; // SLEEP } case 0x02: { @@ -1686,7 +1686,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ SS SSSS $$$ ss ssss // SWI/TRAP0 0010 0010 0110 1111 0000 0000 0011 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SWI(stream, pc, op, opcodes); break; // SWI / TRAP9 + size = handle::dasm32_SWI(stream, pc, op, opcodes); break; // SWI / TRAP9 } case 0x03: { @@ -1694,7 +1694,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ SS SSSS $$$ ss ssss // SYNC 0010 0011 0110 1111 0000 0000 0011 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SYNC(stream, pc, op, opcodes); break; // SYNC + size = handle::dasm32_SYNC(stream, pc, op, opcodes); break; // SYNC } case 0x04: { @@ -1702,7 +1702,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ SS SSSS $$$ ss ssss // RTIE 0010 0100 0110 1111 0000 0000 0011 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_RTIE(stream, pc, op, opcodes); break; // RTIE + size = handle::dasm32_RTIE(stream, pc, op, opcodes); break; // RTIE } case 0x05: { @@ -1710,13 +1710,13 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ SS SSSS $$$ ss ssss // BRK 0010 0101 0110 1111 0000 0000 0011 1111 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_BRK(stream, pc, op, opcodes); break; // BRK + size = handle::dasm32_BRK(stream, pc, op, opcodes); break; // BRK } default: { // 0x00, 0x06-0x3f - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // illegal + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // illegal } } break; @@ -1724,7 +1724,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons default: { // 0x0d - 0x3e - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; // illegal + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; // illegal } } break; @@ -1745,17 +1745,17 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // LD<.x><.di> 0,[limm,c] 0010 0110 RR11 0ZZX D111 CCCC CC11 1110 (+ Limm) (b is 62) // PREFETCH [limm,c] 0010 0110 RR11 0000 0111 CCCC CC11 1110 (+ Limm) (b is 62) (ZZXD is 0) (prefetch is an alias) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - case 0x30: size = handle_dasm32_LD_0(stream, pc, op, opcodes); break; // LD r-r - case 0x31: size = handle_dasm32_LD_1(stream, pc, op, opcodes); break; // LD r-r - case 0x32: size = handle_dasm32_LD_2(stream, pc, op, opcodes); break; // LD r-r - case 0x33: size = handle_dasm32_LD_3(stream, pc, op, opcodes); break; // LD r-r - case 0x34: size = handle_dasm32_LD_4(stream, pc, op, opcodes); break; // LD r-r - case 0x35: size = handle_dasm32_LD_5(stream, pc, op, opcodes); break; // LD r-r - case 0x36: size = handle_dasm32_LD_6(stream, pc, op, opcodes); break; // LD r-r - case 0x37: size = handle_dasm32_LD_7(stream, pc, op, opcodes); break; // LD r-r + case 0x30: size = handle::dasm32_LD_0(stream, pc, op, opcodes); break; // LD r-r + case 0x31: size = handle::dasm32_LD_1(stream, pc, op, opcodes); break; // LD r-r + case 0x32: size = handle::dasm32_LD_2(stream, pc, op, opcodes); break; // LD r-r + case 0x33: size = handle::dasm32_LD_3(stream, pc, op, opcodes); break; // LD r-r + case 0x34: size = handle::dasm32_LD_4(stream, pc, op, opcodes); break; // LD r-r + case 0x35: size = handle::dasm32_LD_5(stream, pc, op, opcodes); break; // LD r-r + case 0x36: size = handle::dasm32_LD_6(stream, pc, op, opcodes); break; // LD r-r + case 0x37: size = handle::dasm32_LD_7(stream, pc, op, opcodes); break; // LD r-r default: { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, op, opcodes); break; // illegal + size = handle::dasm_illegal(stream, pc, instruction, subinstr, op, opcodes); break; // illegal } } break; @@ -1783,7 +1783,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ASL<.f> 0,b,u6 0010 1bbb 0100 0000 FBBB uuuu uu11 1110 // ASL<.cc><.f> 0,limm,c 0010 1110 1100 0000 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ASL_multiple(stream, pc, op, opcodes); break; // ASL + size = handle::dasm32_ASL_multiple(stream, pc, op, opcodes); break; // ASL } case 0x01: { @@ -1801,7 +1801,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // LSR<.f> 0,b,u6 0010 1bbb 0100 0001 FBBB uuuu uu11 1110 // LSR<.cc><.f> 0,limm,c 0010 1110 1100 0001 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_LSR_multiple(stream, pc, op, opcodes); break; // LSR + size = handle::dasm32_LSR_multiple(stream, pc, op, opcodes); break; // LSR } case 0x02: { @@ -1819,7 +1819,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ASR<.f> 0,b,u6 0010 1bbb 0100 0010 FBBB uuuu uu11 1110 // ASR<.cc><.f> 0,limm,c 0010 1110 1100 0010 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ASR_multiple(stream, pc, op, opcodes); break; // ASR + size = handle::dasm32_ASR_multiple(stream, pc, op, opcodes); break; // ASR } case 0x03: { @@ -1837,7 +1837,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ROR<.f> 0,b,u6 0010 1bbb 0100 0011 FBBB uuuu uu11 1110 // ROR<.cc><.f> 0,limm,c 0010 1110 1100 0011 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ROR_multiple(stream, pc, op, opcodes); break; // ROR + size = handle::dasm32_ROR_multiple(stream, pc, op, opcodes); break; // ROR } case 0x04: { @@ -1852,7 +1852,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MUL64<.cc> <0,>limm,c 0010 1110 1100 0100 0111 CCCC CC0Q QQQQ (+ Limm) // MUL64<.cc> <0,>b,limm 0010 1bbb 1100 0100 0BBB 1111 100Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MUL64(stream, pc, op, opcodes); break; // MUL64 + size = handle::dasm32_MUL64(stream, pc, op, opcodes); break; // MUL64 } case 0x05: { @@ -1867,7 +1867,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MULU64<.cc> <0,>limm,c 0010 1110 1100 0101 0111 CCCC CC0Q QQQQ (+ Limm) // MULU64<.cc> <0,>b,limm 0010 1bbb 1100 0101 0BBB 1111 100Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_MULU64(stream, pc, op, opcodes); break; // MULU64 + size = handle::dasm32_MULU64(stream, pc, op, opcodes); break; // MULU64 } case 0x06: { @@ -1886,7 +1886,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADDS<.f> 0,b,limm 0010 1bbb 0000 0110 FBBB 1111 1011 1110 (+ Limm) // ADDS<.cc><.f> 0,limm,c 0010 1110 1100 0110 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADDS(stream, pc, op, opcodes); break; // ADDS + size = handle::dasm32_ADDS(stream, pc, op, opcodes); break; // ADDS } case 0x07: { @@ -1905,7 +1905,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUBS<.f> 0,b,limm 0010 1bbb 0000 0111 FBBB 1111 1011 1110 (+ Limm) // SUBS<.cc><.f> 0,limm,c 0010 1110 1100 0111 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SUBS(stream, pc, op, opcodes); break; // SUBS + size = handle::dasm32_SUBS(stream, pc, op, opcodes); break; // SUBS } case 0x08: { @@ -1923,7 +1923,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // DIVAW 0,b,u6 0010 1bbb 0100 1000 0BBB uuuu uu11 1110 // DIVAW<.cc> 0,limm,c 0010 1110 1100 1000 0111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_DIVAW(stream, pc, op, opcodes); break; // DIVAW + size = handle::dasm32_DIVAW(stream, pc, op, opcodes); break; // DIVAW } case 0x0a: { @@ -1941,7 +1941,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ASLS<.f> 0,b,u6 0010 1bbb 0100 1010 FBBB uuuu uu11 1110 // ASLS<.cc><.f> 0,limm,c 0010 1110 1100 1010 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ASLS(stream, pc, op, opcodes); break; // ASLS + size = handle::dasm32_ASLS(stream, pc, op, opcodes); break; // ASLS } case 0x0b: { @@ -1959,7 +1959,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ASRS<.f> 0,b,u6 0010 1bbb 0100 1011 FBBB uuuu uu11 1110 // ASRS<.cc><.f> 0,limm,c 0010 1110 1100 1011 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ASRS(stream, pc, op, opcodes); break; // ASRS + size = handle::dasm32_ASRS(stream, pc, op, opcodes); break; // ASRS } case 0x0c: { @@ -2005,7 +2005,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADDSDW<.f> 0,b,u6 0010 1bbb 0110 1000 FBBB uuuu uu11 1110 // ADDSDW<.cc><.f> 0,limm,c 0010 1110 1110 1000 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ADDSDW(stream, pc, op, opcodes); break; // ADDSDW + size = handle::dasm32_ADDSDW(stream, pc, op, opcodes); break; // ADDSDW } case 0x29: { @@ -2023,7 +2023,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUBSDW<.f> 0,b,u6 0010 1bbb 0110 1001 FBBB uuuu uu11 1110 // SUBSDW<.cc><.f> 0,limm,c 0010 1110 1110 1001 F111 CCCC CC0Q QQQQ (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SUBSDW(stream, pc, op, opcodes); break; // SUBSDW + size = handle::dasm32_SUBSDW(stream, pc, op, opcodes); break; // SUBSDW } case 0x2f: // SOPs { @@ -2041,7 +2041,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SWAP<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0000 // SWAP<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0000 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SWAP(stream, pc, op, opcodes); break; // SWAP + size = handle::dasm32_SWAP(stream, pc, op, opcodes); break; // SWAP } case 0x01: { @@ -2054,7 +2054,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // NORM<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0001 // NORM<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0001 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_NORM(stream, pc, op, opcodes); break; // NORM + size = handle::dasm32_NORM(stream, pc, op, opcodes); break; // NORM } case 0x02: { @@ -2067,7 +2067,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SAT16<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0010 // SAT16<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0010 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_SAT16(stream, pc, op, opcodes); break; // SAT16 + size = handle::dasm32_SAT16(stream, pc, op, opcodes); break; // SAT16 } case 0x03: { @@ -2080,7 +2080,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // RND16<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0011 // RND16<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0011 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_RND16(stream, pc, op, opcodes); break; // RND16 + size = handle::dasm32_RND16(stream, pc, op, opcodes); break; // RND16 } case 0x04: { @@ -2093,7 +2093,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ABSSW<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0100 // ABSSW<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0100 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ABSSW(stream, pc, op, opcodes); break; // ABSSW + size = handle::dasm32_ABSSW(stream, pc, op, opcodes); break; // ABSSW } case 0x05: { @@ -2106,7 +2106,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ABSS<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0101 // ABSS<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0101 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_ABSS(stream, pc, op, opcodes); break; // ABSS + size = handle::dasm32_ABSS(stream, pc, op, opcodes); break; // ABSS } case 0x06: { @@ -2119,7 +2119,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // NEGSW<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0110 // NEGSW<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0110 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_NEGSW(stream, pc, op, opcodes); break; // NEGSW + size = handle::dasm32_NEGSW(stream, pc, op, opcodes); break; // NEGSW } case 0x07: { @@ -2132,7 +2132,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // NEGS<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 0111 // NEGS<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 0111 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_NEGS(stream, pc, op, opcodes); break; // NEGS + size = handle::dasm32_NEGS(stream, pc, op, opcodes); break; // NEGS } case 0x08: { @@ -2145,7 +2145,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // NORMW<.f> 0,u6 0010 1110 0110 1111 F111 uuuu uu00 1000 // NORMW<.f> 0,limm 0010 1110 0010 1111 F111 1111 1000 1000 (+ Limm) // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - size = handle_dasm32_NORMW(stream, pc, op, opcodes); break; // NORMW + size = handle::dasm32_NORMW(stream, pc, op, opcodes); break; // NORMW } case 0x3f: // ZOPs (Zero Operand Opcodes) { @@ -2156,32 +2156,32 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons { default: { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // illegal + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; // illegal } } break; } default: { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; // illegal + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; // illegal } } break; } default: { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, op, opcodes); break; // illegal + size = handle::dasm_illegal(stream, pc, instruction, subinstr, op, opcodes); break; // illegal } } break; } - case 0x06: size = handle_dasm32_ARC_EXT06(stream, pc, op, opcodes); break; // op a,b,c (06 ARC ext) - case 0x07: size = handle_dasm32_USER_EXT07(stream, pc, op, opcodes); break; // op a,b,c (07 User ext) - case 0x08: size = handle_dasm32_USER_EXT08(stream, pc, op, opcodes); break; // op a,b,c (08 User ext) - case 0x09: size = handle_dasm32_MARKET_EXT09(stream, pc, op, opcodes); break; // op a,b,c (09 Market ext) - case 0x0a: size = handle_dasm32_MARKET_EXT0a(stream, pc, op, opcodes); break; // op a,b,c (0a Market ext) - case 0x0b: size = handle_dasm32_MARKET_EXT0b(stream, pc, op, opcodes); break; // op a,b,c (0b Market ext) + case 0x06: size = handle::dasm32_ARC_EXT06(stream, pc, op, opcodes); break; // op a,b,c (06 ARC ext) + case 0x07: size = handle::dasm32_USER_EXT07(stream, pc, op, opcodes); break; // op a,b,c (07 User ext) + case 0x08: size = handle::dasm32_USER_EXT08(stream, pc, op, opcodes); break; // op a,b,c (08 User ext) + case 0x09: size = handle::dasm32_MARKET_EXT09(stream, pc, op, opcodes); break; // op a,b,c (09 Market ext) + case 0x0a: size = handle::dasm32_MARKET_EXT0a(stream, pc, op, opcodes); break; // op a,b,c (0a Market ext) + case 0x0b: size = handle::dasm32_MARKET_EXT0b(stream, pc, op, opcodes); break; // op a,b,c (0b Market ext) } } else @@ -2203,7 +2203,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // LD_S a,[b,c] 0110 0bbb ccc0 0aaa // ####################################################################################################################### - size = handle_dasm_LD_S_a_b_c(stream, pc, op, opcodes); break; // LD_S a,[b,c] + size = handle::dasm_LD_S_a_b_c(stream, pc, op, opcodes); break; // LD_S a,[b,c] } case 0x01: { @@ -2211,7 +2211,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // LDB_S a,[b,c] 0110 0bbb ccc0 1aaa // ####################################################################################################################### - size = handle_dasm_LDB_S_a_b_c(stream, pc, op, opcodes); break; // LDB_S a,[b,c] + size = handle::dasm_LDB_S_a_b_c(stream, pc, op, opcodes); break; // LDB_S a,[b,c] } case 0x02: { @@ -2219,7 +2219,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // LDW_S a,[b,c] 0110 0bbb ccc1 0aaa // ####################################################################################################################### - size = handle_dasm_LDW_S_a_b_c(stream, pc, op, opcodes); break; // LDW_S a,[b,c] + size = handle::dasm_LDW_S_a_b_c(stream, pc, op, opcodes); break; // LDW_S a,[b,c] } case 0x03: { @@ -2227,7 +2227,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // ADD_S a,b,c 0110 0bbb ccc1 1aaa // ####################################################################################################################### - size = handle_dasm_ADD_S_a_b_c(stream, pc, op, opcodes); break; // ADD_S a,b,c + size = handle::dasm_ADD_S_a_b_c(stream, pc, op, opcodes); break; // ADD_S a,b,c } } break; @@ -2243,14 +2243,14 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ####################################################################################################################### // ADD_S c,b,u3 0110 1bbb ccc0 0uuu // ####################################################################################################################### - size = handle_dasm_ADD_S_c_b_u3(stream, pc, op, opcodes); break; // ADD_S c,b,u3 + size = handle::dasm_ADD_S_c_b_u3(stream, pc, op, opcodes); break; // ADD_S c,b,u3 } case 0x01: { // ####################################################################################################################### // SUB_S c,b,u3 0110 1bbb ccc0 1uuu // ####################################################################################################################### - size = handle_dasm_SUB_S_c_b_u3(stream, pc, op, opcodes); break; // SUB_S c,b,u3 + size = handle::dasm_SUB_S_c_b_u3(stream, pc, op, opcodes); break; // SUB_S c,b,u3 } case 0x02: { @@ -2258,7 +2258,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // ASL_S c,b,u3 0110 1bbb ccc1 0uuu // ####################################################################################################################### - size = handle_dasm_ASL_S_c_b_u3(stream, pc, op, opcodes); break; // ASL_S c,b,u3 + size = handle::dasm_ASL_S_c_b_u3(stream, pc, op, opcodes); break; // ASL_S c,b,u3 } case 0x03: { @@ -2266,7 +2266,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // ASR_S c,b,u3 0110 1bbb ccc1 1uuu // ####################################################################################################################### - size = handle_dasm_ASR_S_c_b_u3(stream, pc, op, opcodes); break; // ASR_S c,b,u3 + size = handle::dasm_ASR_S_c_b_u3(stream, pc, op, opcodes); break; // ASR_S c,b,u3 } } break; @@ -2285,7 +2285,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // ADD_S b,b,h 0111 0bbb hhh0 0HHH // ADD_S b,b,limm 0111 0bbb 1100 0111 (+ Limm) // ####################################################################################################################### - size = handle_dasm_ADD_S_b_b_h_or_limm(stream, pc, op, opcodes); break; // ADD_S b,b,h or ADD_S b,b,limm + size = handle::dasm_ADD_S_b_b_h_or_limm(stream, pc, op, opcodes); break; // ADD_S b,b,h or ADD_S b,b,limm } case 0x01: { @@ -2294,7 +2294,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // MOV_S b,h 0111 0bbb hhh0 1HHH // MOV_S b,limm 0111 0bbb 1100 1111 (+ Limm) // ####################################################################################################################### - size = handle_dasm_MOV_S_b_h_or_limm(stream, pc, op, opcodes); break; // MOV_S b,h or MOV_S b,limm + size = handle::dasm_MOV_S_b_h_or_limm(stream, pc, op, opcodes); break; // MOV_S b,h or MOV_S b,limm } case 0x02: { @@ -2303,7 +2303,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // CMP_S b,h 0111 0bbb hhh1 0HHH // CMP_S b,limm 0111 0bbb 1101 0111 (+ Limm) // ####################################################################################################################### - size = handle_dasm_CMP_S_b_h_or_limm(stream, pc, op, opcodes); break; // CMP_S b,h or CMP_S b,limm + size = handle::dasm_CMP_S_b_h_or_limm(stream, pc, op, opcodes); break; // CMP_S b,h or CMP_S b,limm } case 0x03: { @@ -2311,7 +2311,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S S // MOV_S h,b 0111 0bbb hhh1 1HHH // ####################################################################################################################### - size = handle_dasm_MOV_S_h_b(stream, pc, op, opcodes); break; // MOV_S h,b + size = handle::dasm_MOV_S_h_b(stream, pc, op, opcodes); break; // MOV_S h,b } } break; @@ -2334,7 +2334,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I sssS SSSS // J_S [b] 0111 1bbb 0000 0000 // ####################################################################################################################### - size = handle_dasm_J_S_b(stream, pc, op, opcodes); break; // J_S [b] + size = handle::dasm_J_S_b(stream, pc, op, opcodes); break; // J_S [b] } case 0x01: { @@ -2342,7 +2342,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I sssS SSSS // J_S.D [b] 0111 1bbb 0010 0000 // ####################################################################################################################### - size = handle_dasm_J_S_D_b(stream, pc, op, opcodes); break; // J_S.D [b] + size = handle::dasm_J_S_D_b(stream, pc, op, opcodes); break; // J_S.D [b] } case 0x02: { @@ -2350,7 +2350,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I sssS SSSS // JL_S [b] 0111 1bbb 0100 0000 // ####################################################################################################################### - size = handle_dasm_JL_S_b(stream, pc, op, opcodes); break; // JL_S [b] + size = handle::dasm_JL_S_b(stream, pc, op, opcodes); break; // JL_S [b] } case 0x03: { @@ -2358,7 +2358,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I sssS SSSS // JL_S.D [b] 0111 1bbb 0110 0000 // ####################################################################################################################### - size = handle_dasm_JL_S_D_b(stream, pc, op, opcodes); break; // JL_S.D [b] + size = handle::dasm_JL_S_D_b(stream, pc, op, opcodes); break; // JL_S.D [b] } case 0x06: { @@ -2366,7 +2366,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // SUB_S.NE b,b,b 0111 1bbb 1100 0000 // IIII I sssS SSSS // ####################################################################################################################### - size = handle_dasm_SUB_S_NE_b_b_b(stream, pc, op, opcodes); break; // SUB_S.NE b,b,b + size = handle::dasm_SUB_S_NE_b_b_b(stream, pc, op, opcodes); break; // SUB_S.NE b,b,b } case 0x07: // ZOPs { @@ -2380,7 +2380,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ sssS SSSS // NOP_S 0111 1000 1110 0000 // ####################################################################################################################### - size = handle_dasm_NOP_S(stream, pc, op, opcodes); break; // NOP_S + size = handle::dasm_NOP_S(stream, pc, op, opcodes); break; // NOP_S } case 0x01: { @@ -2388,7 +2388,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ sssS SSSS // UNIMP_S 0111 1001 1110 0000 // ####################################################################################################################### - size = handle_dasm_UNIMP_S(stream, pc, op, opcodes); break; // UNIMP_S + size = handle::dasm_UNIMP_S(stream, pc, op, opcodes); break; // UNIMP_S } case 0x04: { @@ -2396,7 +2396,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ sssS SSSS // JEQ_S [blink] 0111 1100 1110 0000 // ####################################################################################################################### - size = handle_dasm_JEQ_S_blink(stream, pc, op, opcodes); break; // JEQ_S [BLINK] + size = handle::dasm_JEQ_S_blink(stream, pc, op, opcodes); break; // JEQ_S [BLINK] } case 0x05: { @@ -2404,7 +2404,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ sssS SSSS // JNE_S [blink] 0111 1101 1110 0000 // ####################################################################################################################### - size = handle_dasm_JNE_S_blink(stream, pc, op, opcodes); break; // JNE_S [BLINK] + size = handle::dasm_JNE_S_blink(stream, pc, op, opcodes); break; // JNE_S [BLINK] } case 0x06: { @@ -2412,7 +2412,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ sssS SSSS // J_S [blink] 0111 1110 1110 0000 // ####################################################################################################################### - size = handle_dasm_J_S_blink(stream, pc, op, opcodes); break; // J_S [BLINK] + size = handle::dasm_J_S_blink(stream, pc, op, opcodes); break; // J_S [BLINK] } case 0x07: { @@ -2420,19 +2420,19 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I$$$ sssS SSSS // J_S.D [blink] 0111 1111 1110 0000 // ####################################################################################################################### - size = handle_dasm_J_S_D_blink(stream, pc, op, opcodes); break; // J_S.D [BLINK] + size = handle::dasm_J_S_D_blink(stream, pc, op, opcodes); break; // J_S.D [BLINK] } default: // 0x02, 0x03 { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, subinstr3, op, opcodes); break; } } break; } default: // 0x04, 0x05 { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; } } break; @@ -2443,7 +2443,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // SUB_S b,b,c 0111 1bbb ccc0 0010 // ####################################################################################################################### - size = handle_dasm_SUB_S_b_b_c(stream, pc, op, opcodes); break; // SUB_S b,b,c + size = handle::dasm_SUB_S_b_b_c(stream, pc, op, opcodes); break; // SUB_S b,b,c } case 0x04: { @@ -2451,7 +2451,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // AND_S b,b,c 0111 1bbb ccc0 0100 // ####################################################################################################################### - size = handle_dasm_AND_S_b_b_c(stream, pc, op, opcodes); break; // AND_S b,b,c + size = handle::dasm_AND_S_b_b_c(stream, pc, op, opcodes); break; // AND_S b,b,c } case 0x05: { @@ -2459,7 +2459,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // OR_S b,b,c 0111 1bbb ccc0 0101 // ####################################################################################################################### - size = handle_dasm_OR_S_b_b_c(stream, pc, op, opcodes); break; // OR_S b,b,c + size = handle::dasm_OR_S_b_b_c(stream, pc, op, opcodes); break; // OR_S b,b,c } case 0x06: { @@ -2467,7 +2467,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // BIC_S b,b,c 0111 1bbb ccc0 0110 // ####################################################################################################################### - size = handle_dasm_BIC_S_b_b_c(stream, pc, op, opcodes); break; // BIC_S b,b,c + size = handle::dasm_BIC_S_b_b_c(stream, pc, op, opcodes); break; // BIC_S b,b,c } case 0x07: { @@ -2475,7 +2475,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // XOR_S b,b,c 0111 1bbb ccc0 0111 // ####################################################################################################################### - size = handle_dasm_XOR_S_b_b_c(stream, pc, op, opcodes); break; // XOR_S b,b,c + size = handle::dasm_XOR_S_b_b_c(stream, pc, op, opcodes); break; // XOR_S b,b,c } case 0x0b: { @@ -2483,7 +2483,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // TST_S b,c 0111 1bbb ccc0 1011 // ####################################################################################################################### - size = handle_dasm_TST_S_b_c(stream, pc, op, opcodes); break; // TST_S b,c + size = handle::dasm_TST_S_b_c(stream, pc, op, opcodes); break; // TST_S b,c } case 0x0c: { @@ -2491,7 +2491,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // MUL64_S <0,>b,c 0111 1bbb ccc0 1100 // ####################################################################################################################### - size = handle_dasm_MUL64_S_0_b_c(stream, pc, op, opcodes); break; // MUL64_S <0,>b,c + size = handle::dasm_MUL64_S_0_b_c(stream, pc, op, opcodes); break; // MUL64_S <0,>b,c } case 0x0d: { @@ -2500,7 +2500,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // SEXB_S b,c 0111 1bbb ccc0 1101 // ####################################################################################################################### - size = handle_dasm_SEXB_S_b_c(stream, pc, op, opcodes); break; // SEXB_S b,c + size = handle::dasm_SEXB_S_b_c(stream, pc, op, opcodes); break; // SEXB_S b,c } case 0x0e: { @@ -2508,7 +2508,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // SEXW_S b,c 0111 1bbb ccc0 1110 // ####################################################################################################################### - size = handle_dasm_SEXW_S_b_c(stream, pc, op, opcodes); break; // SEXW_S b,c + size = handle::dasm_SEXW_S_b_c(stream, pc, op, opcodes); break; // SEXW_S b,c } case 0x0f: { @@ -2516,7 +2516,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // EXTB_S b,c 0111 1bbb ccc0 1111 // ####################################################################################################################### - size = handle_dasm_EXTB_S_b_c(stream, pc, op, opcodes); break; // EXTB_S b,c + size = handle::dasm_EXTB_S_b_c(stream, pc, op, opcodes); break; // EXTB_S b,c } case 0x10: { @@ -2524,7 +2524,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // EXTW_S b,c 0111 1bbb ccc1 0000 // ####################################################################################################################### - size = handle_dasm_EXTW_S_b_c(stream, pc, op, opcodes); break; // EXTW_S b,c + size = handle::dasm_EXTW_S_b_c(stream, pc, op, opcodes); break; // EXTW_S b,c } case 0x11: { @@ -2532,7 +2532,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ABS_S b,c 0111 1bbb ccc1 0001 // ####################################################################################################################### - size = handle_dasm_ABS_S_b_c(stream, pc, op, opcodes); break; // ABS_S b,c + size = handle::dasm_ABS_S_b_c(stream, pc, op, opcodes); break; // ABS_S b,c } case 0x12: { @@ -2540,7 +2540,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // NOT_S b,c 0111 1bbb ccc1 0010 // ####################################################################################################################### - size = handle_dasm_NOT_S_b_c(stream, pc, op, opcodes); break; // NOT_S b,c + size = handle::dasm_NOT_S_b_c(stream, pc, op, opcodes); break; // NOT_S b,c } case 0x13: { @@ -2548,7 +2548,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // NEG_S b,c 0111 1bbb ccc1 0011 // ####################################################################################################################### - size = handle_dasm_NEG_S_b_c(stream, pc, op, opcodes); break; // NEG_S b,c + size = handle::dasm_NEG_S_b_c(stream, pc, op, opcodes); break; // NEG_S b,c } case 0x14: { @@ -2556,7 +2556,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ADD1_S b,b,c 0111 1bbb ccc1 0100 // ####################################################################################################################### - size = handle_dasm_ADD1_S_b_b_c(stream, pc, op, opcodes); break; // ADD1_S b,b,c + size = handle::dasm_ADD1_S_b_b_c(stream, pc, op, opcodes); break; // ADD1_S b,b,c } case 0x15: { @@ -2564,7 +2564,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ADD2_S b,b,c 0111 1bbb ccc1 0101 // ####################################################################################################################### - size = handle_dasm_ADD2_S_b_b_c(stream, pc, op, opcodes); break; // ADD2_S b,b,c + size = handle::dasm_ADD2_S_b_b_c(stream, pc, op, opcodes); break; // ADD2_S b,b,c } case 0x16: { @@ -2572,7 +2572,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ADD3_S b,b,c 0111 1bbb ccc1 0110 // ####################################################################################################################### - size = handle_dasm_ADD3_S_b_b_c(stream, pc, op, opcodes); break; // ADD3_S b,b,c + size = handle::dasm_ADD3_S_b_b_c(stream, pc, op, opcodes); break; // ADD3_S b,b,c } case 0x18: { @@ -2580,7 +2580,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ASL_S b,b,c 0111 1bbb ccc1 1000 // ####################################################################################################################### - size = handle_dasm_ASL_S_b_b_c_multiple(stream, pc, op, opcodes); break; // ASL_S b,b,c (multiple) + size = handle::dasm_ASL_S_b_b_c_multiple(stream, pc, op, opcodes); break; // ASL_S b,b,c (multiple) } case 0x19: { @@ -2588,7 +2588,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // LSR_S b,b,c 0111 1bbb ccc1 1001 // ####################################################################################################################### - size = handle_dasm_LSR_S_b_b_c_multiple(stream, pc, op, opcodes); break; // LSR_S b,b,c (multiple) + size = handle::dasm_LSR_S_b_b_c_multiple(stream, pc, op, opcodes); break; // LSR_S b,b,c (multiple) } case 0x1a: { @@ -2596,7 +2596,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ASR_S b,b,c 0111 1bbb ccc1 1010 // ####################################################################################################################### - size = handle_dasm_ASR_S_b_b_c_multiple(stream, pc, op, opcodes); break; // ASR_S b,b,c (multiple) + size = handle::dasm_ASR_S_b_b_c_multiple(stream, pc, op, opcodes); break; // ASR_S b,b,c (multiple) } case 0x1b: { @@ -2604,7 +2604,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ASL_S b,c 0111 1bbb ccc1 1011 // ####################################################################################################################### - size = handle_dasm_ASL_S_b_c_single(stream, pc, op, opcodes); break; // ASL_S b,c (single) + size = handle::dasm_ASL_S_b_c_single(stream, pc, op, opcodes); break; // ASL_S b,c (single) } case 0x1c: { @@ -2612,7 +2612,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // ASR_S b,c 0111 1bbb ccc1 1100 // ####################################################################################################################### - size = handle_dasm_ASR_S_b_c_single(stream, pc, op, opcodes); break; // ASR_S b,c (single) + size = handle::dasm_ASR_S_b_c_single(stream, pc, op, opcodes); break; // ASR_S b,c (single) } case 0x1d: { @@ -2620,7 +2620,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // LSR_S b,c 0111 1bbb ccc1 1101 // ####################################################################################################################### - size = handle_dasm_LSR_S_b_c_single(stream, pc, op, opcodes); break; // LSR_S b,c (single) + size = handle::dasm_LSR_S_b_c_single(stream, pc, op, opcodes); break; // LSR_S b,c (single) } case 0x1e: { @@ -2628,7 +2628,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I S SSSS // TRAP_S u6 0111 1uuu uuu1 1110 // ####################################################################################################################### - size = handle_dasm_TRAP_S_u6(stream, pc, op, opcodes); break; // TRAP_S u6 (not a5?) + size = handle::dasm_TRAP_S_u6(stream, pc, op, opcodes); break; // TRAP_S u6 (not a5?) } case 0x1f: { @@ -2639,16 +2639,16 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII Isss sssS SSSS // BRK_S 0111 1111 1111 1111 // ####################################################################################################################### - size = handle_dasm_BRK_S(stream, pc, op, opcodes); break; // BRK_S ( 0x7fff only? ) // BRK_S ( 0x7fff only? ) + size = handle::dasm_BRK_S(stream, pc, op, opcodes); break; // BRK_S ( 0x7fff only? ) // BRK_S ( 0x7fff only? ) } else { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; + size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; } } default: // 0x01, 0x03, 0x08, 0x09, 0x0a, 0x17 { - size = handle_dasm_illegal(stream, pc, instruction, subinstr, op, opcodes); break; + size = handle::dasm_illegal(stream, pc, instruction, subinstr, op, opcodes); break; } } break; @@ -2659,7 +2659,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // LD_S c,[b,u7] 1000 0bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_LD_S_c_b_u7(stream, pc, op, opcodes); break; // LD_S c,[b,u7] + size = handle::dasm_LD_S_c_b_u7(stream, pc, op, opcodes); break; // LD_S c,[b,u7] } case 0x11: { @@ -2667,7 +2667,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // LDB_S c,[b,u5] 1000 1bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_LDB_S_c_b_u5(stream, pc, op, opcodes); break; // LDB_S c,[b,u5] + size = handle::dasm_LDB_S_c_b_u5(stream, pc, op, opcodes); break; // LDB_S c,[b,u5] } case 0x12: { @@ -2675,7 +2675,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // LDW_S c,[b,u6] 1001 0bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_LDW_S_c_b_u6(stream, pc, op, opcodes); break; // LDW_S c,[b,u6] + size = handle::dasm_LDW_S_c_b_u6(stream, pc, op, opcodes); break; // LDW_S c,[b,u6] } case 0x13: { @@ -2683,7 +2683,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // LDW_S.X c,[b,u6] 1001 1bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_LDW_S_X_c_b_u6(stream, pc, op, opcodes); break; // LDW_S.X c,[b,u6] + size = handle::dasm_LDW_S_X_c_b_u6(stream, pc, op, opcodes); break; // LDW_S.X c,[b,u6] } case 0x14: { @@ -2691,7 +2691,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // ST_S c,[b,u7] 1010 0bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_ST_S_c_b_u7(stream, pc, op, opcodes); break; // ST_S c,[b,u7] + size = handle::dasm_ST_S_c_b_u7(stream, pc, op, opcodes); break; // ST_S c,[b,u7] } case 0x15: { @@ -2699,7 +2699,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // STB_S c,[b,u5] 1010 1bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_STB_S_c_b_u5(stream, pc, op, opcodes); break; // STB_S + size = handle::dasm_STB_S_c_b_u5(stream, pc, op, opcodes); break; // STB_S } case 0x16: { @@ -2707,7 +2707,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // STW_S c,[b,u6] 1011 0bbb cccu uuuu // ####################################################################################################################### - size = handle_dasm_STW_S_c_b_u6(stream, pc, op, opcodes); break; // STW_S + size = handle::dasm_STW_S_c_b_u6(stream, pc, op, opcodes); break; // STW_S } case 0x17: // Shift/Sub/Bit { @@ -2721,7 +2721,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // ASL_S b,b,u5 1011 1bbb 000u uuuu // ####################################################################################################################### - size = handle_dasm_ASL_S_b_b_u5(stream, pc, op, opcodes); break; // ASL_S b,b,u5 + size = handle::dasm_ASL_S_b_b_u5(stream, pc, op, opcodes); break; // ASL_S b,b,u5 } case 0x01: { @@ -2729,7 +2729,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // LSR_S b,b,u5 1011 1bbb 001u uuuu // ####################################################################################################################### - size = handle_dasm_LSR_S_b_b_u5(stream, pc, op, opcodes); break; // LSR_S b,b,u5 + size = handle::dasm_LSR_S_b_b_u5(stream, pc, op, opcodes); break; // LSR_S b,b,u5 } case 0x02: { @@ -2737,7 +2737,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // ASR_S b,b,u5 1011 1bbb 010u uuuu // ####################################################################################################################### - size = handle_dasm_ASR_S_b_b_u5(stream, pc, op, opcodes); break; // ASR_S b,b,u5 + size = handle::dasm_ASR_S_b_b_u5(stream, pc, op, opcodes); break; // ASR_S b,b,u5 } case 0x03: { @@ -2745,7 +2745,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // SUB_S b,b,u5 1011 1bbb 011u uuuu // ####################################################################################################################### - size = handle_dasm_SUB_S_b_b_u5(stream, pc, op, opcodes); break; // SUB_S b,b,u5 + size = handle::dasm_SUB_S_b_b_u5(stream, pc, op, opcodes); break; // SUB_S b,b,u5 } case 0x04: { @@ -2753,7 +2753,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // BSET_S b,b,u5 1011 1bbb 100u uuuu // ####################################################################################################################### - size = handle_dasm_BSET_S_b_b_u5(stream, pc, op, opcodes); break; // BSET_S b,b,u5 + size = handle::dasm_BSET_S_b_b_u5(stream, pc, op, opcodes); break; // BSET_S b,b,u5 } case 0x05: { @@ -2761,7 +2761,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // BCLR_S b,b,u5 1011 1bbb 101u uuuu // ####################################################################################################################### - size = handle_dasm_BCLR_S_b_b_u5(stream, pc, op, opcodes); break; // BCLR_S b,b,u5 + size = handle::dasm_BCLR_S_b_b_u5(stream, pc, op, opcodes); break; // BCLR_S b,b,u5 } case 0x06: { @@ -2769,7 +2769,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // BMSK_S b,b,u5 1011 1bbb 110u uuuu // ####################################################################################################################### - size = handle_dasm_BMSK_S_b_b_u5(stream, pc, op, opcodes); break; // BMSK_S b,b,u5 + size = handle::dasm_BMSK_S_b_b_u5(stream, pc, op, opcodes); break; // BMSK_S b,b,u5 } case 0x07: { @@ -2777,7 +2777,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // BTST_S b,u5 1011 1bbb 111u uuuu // ####################################################################################################################### - size = handle_dasm_BTST_S_b_u5(stream, pc, op, opcodes); break; // BTST_S b,u5 + size = handle::dasm_BTST_S_b_u5(stream, pc, op, opcodes); break; // BTST_S b,u5 } } break; @@ -2794,7 +2794,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // LD_S b,[sp,u7] 1100 0bbb 000u uuuu // ####################################################################################################################### - size = handle_dasm_LD_S_b_sp_u7(stream, pc, op, opcodes); break; // LD_S b,[sp,u7] + size = handle::dasm_LD_S_b_sp_u7(stream, pc, op, opcodes); break; // LD_S b,[sp,u7] } case 0x01: { @@ -2802,7 +2802,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // LDB_S b,[sp,u7] 1100 0bbb 001u uuuu // ####################################################################################################################### - size = handle_dasm_LDB_S_b_sp_u7(stream, pc, op, opcodes); break; // LDB_S b,[sp,u7] + size = handle::dasm_LDB_S_b_sp_u7(stream, pc, op, opcodes); break; // LDB_S b,[sp,u7] } case 0x02: { @@ -2810,7 +2810,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // ST_S b,[sp,u7] 1100 0bbb 010u uuuu // ####################################################################################################################### - size = handle_dasm_ST_S_b_sp_u7(stream, pc, op, opcodes); break; // ST_S b,[sp,u7] + size = handle::dasm_ST_S_b_sp_u7(stream, pc, op, opcodes); break; // ST_S b,[sp,u7] } case 0x03: { @@ -2818,7 +2818,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // STB_S b,[sp,u7] 1100 0bbb 011u uuuu // ####################################################################################################################### - size = handle_dasm_STB_S_b_sp_u7(stream, pc, op, opcodes); break; // STB_S b,[sp,u7] + size = handle::dasm_STB_S_b_sp_u7(stream, pc, op, opcodes); break; // STB_S b,[sp,u7] } case 0x04: { @@ -2826,7 +2826,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSS // ADD_S b,sp,u7 1100 0bbb 100u uuuu // ####################################################################################################################### - size = handle_dasm_ADD_S_b_sp_u7(stream, pc, op, opcodes); break; // ADD_S b,sp,u7 + size = handle::dasm_ADD_S_b_sp_u7(stream, pc, op, opcodes); break; // ADD_S b,sp,u7 } case 0x05: // subtable 18_05 @@ -2840,7 +2840,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII Isss SSS // ADD_S sp,sp,u7 1100 0000 101u uuuu // ####################################################################################################################### - size = handle_dasm_ADD_S_sp_sp_u7(stream, pc, op, opcodes); break; // ADD_S sp,sp,u7 + size = handle::dasm_ADD_S_sp_sp_u7(stream, pc, op, opcodes); break; // ADD_S sp,sp,u7 } case 0x01: { @@ -2848,9 +2848,9 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII Isss SSS // SUB_S sp,sp,u7 1100 0001 101u uuuu // ####################################################################################################################### - size = handle_dasm_SUB_S_sp_sp_u7(stream, pc, op, opcodes); break; // SUB_S sp,sp,u7 + size = handle::dasm_SUB_S_sp_sp_u7(stream, pc, op, opcodes); break; // SUB_S sp,sp,u7 } - default: size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; + default: size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; } break; } @@ -2865,7 +2865,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSSs ssss // POP_S b 1100 0bbb 1100 0001 // ####################################################################################################################### - size = handle_dasm_POP_S_b(stream, pc, op, opcodes); break; // POP_S b + size = handle::dasm_POP_S_b(stream, pc, op, opcodes); break; // POP_S b } case 0x11: { @@ -2873,9 +2873,9 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSSs ssss // POP_S blink 1100 0RRR 1101 0001 // ####################################################################################################################### - size = handle_dasm_POP_S_blink(stream, pc, op, opcodes); break; // POP_S blink + size = handle::dasm_POP_S_blink(stream, pc, op, opcodes); break; // POP_S blink } - default: size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; + default: size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; } break; } @@ -2891,7 +2891,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSSs ssss // PUSH_S b 1100 0bbb 1110 0001 // ####################################################################################################################### - size = handle_dasm_PUSH_S_b(stream, pc, op, opcodes); break; // PUSH_S b + size = handle::dasm_PUSH_S_b(stream, pc, op, opcodes); break; // PUSH_S b } case 0x11: { @@ -2899,9 +2899,9 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I SSSs ssss // PUSH_S blink 1100 0RRR 1111 0001 // ####################################################################################################################### - size = handle_dasm_PUSH_S_blink(stream, pc, op, opcodes); break; // PUSH_S blink + size = handle::dasm_PUSH_S_blink(stream, pc, op, opcodes); break; // PUSH_S blink } - default: size = handle_dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; + default: size = handle::dasm_illegal(stream, pc, instruction, subinstr, subinstr2, op, opcodes); break; } } } @@ -2920,7 +2920,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // LD_S r0,[gp,s11] 1100 100s ssss ssss // ####################################################################################################################### - size = handle_dasm_LD_S_r0_gp_s11(stream, pc, op, opcodes); break; // LD_S r0,[gp,s11] + size = handle::dasm_LD_S_r0_gp_s11(stream, pc, op, opcodes); break; // LD_S r0,[gp,s11] } case 0x01: { @@ -2928,7 +2928,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // LDB_S r0,[gp,s9] 1100 101s ssss ssss // ####################################################################################################################### - size = handle_dasm_LDB_S_r0_gp_s9(stream, pc, op, opcodes); break; // LDB_S r0,[gp,s9] + size = handle::dasm_LDB_S_r0_gp_s9(stream, pc, op, opcodes); break; // LDB_S r0,[gp,s9] } case 0x02: { @@ -2936,7 +2936,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // LDW_S r0,[gp,s10] 1100 110s ssss ssss // ####################################################################################################################### - size = handle_dasm_LDW_S_r0_gp_s10(stream, pc, op, opcodes); break; // LDW_S r0,[gp,s10] + size = handle::dasm_LDW_S_r0_gp_s10(stream, pc, op, opcodes); break; // LDW_S r0,[gp,s10] } case 0x03: { @@ -2944,7 +2944,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // ADD_S r0,gp,s11 1100 111s ssss ssss // ####################################################################################################################### - size = handle_dasm_ADD_S_r0_gp_s11(stream, pc, op, opcodes); break; // ADD_S r0,gp,s11 + size = handle::dasm_ADD_S_r0_gp_s11(stream, pc, op, opcodes); break; // ADD_S r0,gp,s11 } } break; @@ -2955,7 +2955,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // LD_S b,[pcl,u10] 1101 0bbb uuuu uuuu // ####################################################################################################################### - size = handle_dasm_LD_S_b_pcl_u10(stream, pc, op, opcodes); break; // LD_S b,[pcl,u10] + size = handle::dasm_LD_S_b_pcl_u10(stream, pc, op, opcodes); break; // LD_S b,[pcl,u10] } case 0x1b: @@ -2964,7 +2964,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // MOV_S b,u8 1101 1bbb uuuu uuuu // ####################################################################################################################### - size = handle_dasm_MOV_S_b_u8(stream, pc, op, opcodes); break; // MOV_S b, u8 + size = handle::dasm_MOV_S_b_u8(stream, pc, op, opcodes); break; // MOV_S b, u8 } case 0x1c: // ADD_S/CMP_S @@ -2979,7 +2979,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I s // ADD_S b,b,u7 1110 0bbb 0uuu uuuu // ####################################################################################################################### - size = handle_dasm_ADD_S_b_b_u7(stream, pc, op, opcodes); break; // ADD_S b, b, u7 + size = handle::dasm_ADD_S_b_b_u7(stream, pc, op, opcodes); break; // ADD_S b, b, u7 } case 0x01: { @@ -2987,7 +2987,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I s // CMP_S b,u7 1110 0bbb 1uuu uuuu // ####################################################################################################################### - size = handle_dasm_CMP_S_b_u7(stream, pc, op, opcodes); break; // CMP_S b, u7 + size = handle::dasm_CMP_S_b_u7(stream, pc, op, opcodes); break; // CMP_S b, u7 } } break; @@ -3004,7 +3004,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I s // BREQ_S b,0,s8 1110 1bbb 0sss ssss // ####################################################################################################################### - size = handle_dasm_BREQ_S_b_0_s8(stream, pc, op, opcodes); break; // BREQ_S b,0,s8 + size = handle::dasm_BREQ_S_b_0_s8(stream, pc, op, opcodes); break; // BREQ_S b,0,s8 } case 0x01: { @@ -3012,7 +3012,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I s // BRNE_S b,0,s8 1110 1bbb 1sss ssss // ####################################################################################################################### - size = handle_dasm_BRNE_S_b_0_s8(stream, pc, op, opcodes); break; // BRNE_S b,0,s8 + size = handle::dasm_BRNE_S_b_0_s8(stream, pc, op, opcodes); break; // BRNE_S b,0,s8 } } break; @@ -3029,7 +3029,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // B_S s10 1111 000s ssss ssss // ####################################################################################################################### - size = handle_dasm_B_S_s10(stream, pc, op, opcodes); break; // B_S s10 + size = handle::dasm_B_S_s10(stream, pc, op, opcodes); break; // B_S s10 } case 0x01: { @@ -3037,7 +3037,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // BEQ_S s10 1111 001s ssss ssss // ####################################################################################################################### - size = handle_dasm_BEQ_S_s10(stream, pc, op, opcodes); break; // BEQ_S s10 + size = handle::dasm_BEQ_S_s10(stream, pc, op, opcodes); break; // BEQ_S s10 } case 0x02: { @@ -3045,7 +3045,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISS // BNE_S s10 1111 010s ssss ssss // ####################################################################################################################### - size = handle_dasm_BNE_S_s10(stream, pc, op, opcodes); break; // BNE_S s10 + size = handle::dasm_BNE_S_s10(stream, pc, op, opcodes); break; // BNE_S s10 } case 0x03: // Bcc_S { @@ -3059,7 +3059,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BGT_S s7 1111 0110 00ss ssss // ####################################################################################################################### - size = handle_dasm_BGT_S_s7(stream, pc, op, opcodes); break; // BGT_S s7 + size = handle::dasm_BGT_S_s7(stream, pc, op, opcodes); break; // BGT_S s7 } case 0x01: { @@ -3067,7 +3067,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BGE_S s7 1111 0110 01ss ssss // ####################################################################################################################### - size = handle_dasm_BGE_S_s7(stream, pc, op, opcodes); break; // BGE_S s7 + size = handle::dasm_BGE_S_s7(stream, pc, op, opcodes); break; // BGE_S s7 } case 0x02: { @@ -3075,7 +3075,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BLT_S s7 1111 0110 10ss ssss // ####################################################################################################################### - size = handle_dasm_BLT_S_s7(stream, pc, op, opcodes); break; // BLT_S s7 + size = handle::dasm_BLT_S_s7(stream, pc, op, opcodes); break; // BLT_S s7 } case 0x03: { @@ -3083,7 +3083,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BLE_S s7 1111 0110 11ss ssss // ####################################################################################################################### - size = handle_dasm_BLE_S_s7(stream, pc, op, opcodes); break; // BLE_S s7 + size = handle::dasm_BLE_S_s7(stream, pc, op, opcodes); break; // BLE_S s7 } case 0x04: { @@ -3091,7 +3091,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BHI_S s7 1111 0111 00ss ssss // ####################################################################################################################### - size = handle_dasm_BHI_S_s7(stream, pc, op, opcodes); break; // BHI_S s7 + size = handle::dasm_BHI_S_s7(stream, pc, op, opcodes); break; // BHI_S s7 } case 0x05: { @@ -3099,7 +3099,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BHS_S s7 1111 0111 01ss ssss // ####################################################################################################################### - size = handle_dasm_BHS_S_s7(stream, pc, op, opcodes); break; // BHS_S s7 + size = handle::dasm_BHS_S_s7(stream, pc, op, opcodes); break; // BHS_S s7 } case 0x06: { @@ -3107,7 +3107,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BLO_S s7 1111 0111 10ss ssss // ####################################################################################################################### - size = handle_dasm_BLO_S_s7(stream, pc, op, opcodes); break; // BLO_S s7 + size = handle::dasm_BLO_S_s7(stream, pc, op, opcodes); break; // BLO_S s7 } case 0x07: @@ -3116,7 +3116,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII ISSs ss // BLS_S s7 1111 0111 11ss ssss // ####################################################################################################################### - size = handle_dasm_BLS_S_s7(stream, pc, op, opcodes); break; // BLS_S s7 + size = handle::dasm_BLS_S_s7(stream, pc, op, opcodes); break; // BLS_S s7 } } } @@ -3129,7 +3129,7 @@ offs_t arcompact_disassembler::disassemble(std::ostream &stream, offs_t pc, cons // IIII I // BL_S s13 1111 1sss ssss ssss // ####################################################################################################################### - size = handle_dasm_BL_S_s13(stream, pc, op, opcodes); break; // BL_S s13 + size = handle::dasm_BL_S_s13(stream, pc, op, opcodes); break; // BL_S s13 } } } diff --git a/src/devices/cpu/arcompact/arcompactdasm.h b/src/devices/cpu/arcompact/arcompactdasm.h index d8e41560a00..e95423b26b7 100644 --- a/src/devices/cpu/arcompact/arcompactdasm.h +++ b/src/devices/cpu/arcompact/arcompactdasm.h @@ -5,13 +5,15 @@ \*********************************/ - #ifndef MAME_CPU_ARCOMPACT_ARCOMPACTDASM_H #define MAME_CPU_ARCOMPACT_ARCOMPACTDASM_H #pragma once -class arcompact_disassembler : public util::disasm_interface +#include "arcompact_common.h" + + +class arcompact_disassembler : public util::disasm_interface, protected arcompact_common { public: arcompact_disassembler() = default; @@ -32,18 +34,10 @@ public: static const char *const opcodes_04[0x40]; private: + class handle; static const int DASM_REG_LIMM = 62; - // registers used in 16-bit opcodes have a limited range - // and can only address registers r0-r3 and r12-r15 - static constexpr uint8_t expand_reg(uint8_t reg) - { - if (reg>3) - return reg + 8; - return reg; - } - static uint32_t dasm_get_limm_32bit_opcode(uint32_t pc, const data_buffer &opcodes) { return (opcodes.r16(pc + 4) << 16) | opcodes.r16(pc + 6); @@ -61,114 +55,6 @@ private: return h; } - static uint8_t dasm_common32_get_condition(uint32_t& op) - { - uint8_t condition = op & 0x0000001f; - return condition; - } - - static uint8_t dasm_common32_get_breg(uint32_t &op) - { - int b_temp = (op & 0x07000000) >> 24; - int B_temp = (op & 0x00007000) >> 12; - int breg = b_temp | (B_temp << 3); - return breg; - } - - static uint8_t dasm_common32_get_creg(uint32_t& op) - { - int creg = (op & 0x00000fc0) >> 6; - return creg; - } - - static uint8_t dasm_common32_get_areg(uint32_t& op) - { - int areg = op & 0x0000003f; - return areg; - } - - static uint8_t dasm_common32_get_areg_reserved(uint32_t &op) - { - int ares = op & 0x0000003f; - return ares; - } - - static uint32_t dasm_common32_get_u6(uint32_t &op) - { - int u = (op & 0x00000fc0) >> 6; - return u; - } - - static bool dasm_common32_get_F(uint32_t &op) - { - bool F = (op & 0x00008000) ? true : false; - return F; - } - - static uint8_t dasm_common32_get_p(uint32_t &op) - { - int p = (op & 0x00c00000) >> 22; - return p; - } - - static uint32_t dasm_common32_get_s12(uint32_t& op) - { - int S_temp = op & 0x0000003f; - int s_temp = (op & 0x00000fc0) >> 6; - int S = s_temp | (S_temp << 6); - S = util::sext(S, 12); - return S; - } - - static uint8_t dasm_common16_get_breg(uint16_t &op) - { - uint8_t breg = ((op & 0x0700) >> 8); - return breg; - } - - static uint8_t dasm_common16_get_creg(uint16_t& op) - { - uint8_t creg = ((op & 0x00e0) >> 5); - return creg; - } - - static uint8_t dasm_common16_get_areg(uint16_t& op) - { - uint8_t areg = op & 0x0007; - return areg; - } - - static uint32_t dasm_common16_get_u3(uint16_t& op) - { - uint32_t u = op & 0x0007; - return u; - } - - static uint32_t dasm_common16_get_u5(uint16_t& op) - { - uint32_t u = op & 0x001f; - return u; - } - - static uint32_t dasm_common16_get_u8(uint16_t& op) - { - uint32_t u = op & 0x00ff; - return u; - } - - static uint32_t dasm_common16_get_u7(uint16_t& op) - { - uint32_t u = op & 0x007f; - return u; - } - - static uint32_t dasm_common16_get_s9(uint16_t& op) - { - uint32_t s = op & 0x01ff; - s = util::sext(s, 9); - return s; - } - static void output_aux_regname(std::ostream& stream, uint32_t auxreg); static int handle04_MOV_f_a_b_c_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); @@ -205,236 +91,6 @@ private: static int handle1e_03_0x_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext); static uint32_t get_01_01_01_address_offset(uint32_t op); - static int handle_dasm32_B_cc_D_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_B_D_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BL_cc_d_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BL_d_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BREQ_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRNE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRLT_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRGE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRLO_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRHS_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BBIT0_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BBIT1_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BREQ_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRNE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRLT_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRGE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRLO_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRHS_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BBIT0_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BBIT1_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_r_o(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ST_r_o(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - - // ALU Operations, 0x04, [0x00-0x1F] - static int handle_dasm32_ADD(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ADC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SBC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_AND(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_OR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BIC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_XOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MAX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MIN(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MOV(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_TST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_CMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_RCMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_RSUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BSET(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BCLR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BTST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BXOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BMSK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ADD1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ADD2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ADD3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SUB1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SUB2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SUB3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MPY(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MPYH(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MPYHU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MPYU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - // - static int handle_dasm32_Jcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_Jcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_JLcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_JLcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_FLAG(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ASL_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ASR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LSR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ROR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_RRC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SEXB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SEXW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_EXTB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_EXTW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ABS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_NOT(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_RLC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_EX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SLEEP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SWI(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SYNC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_RTIE(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_BRK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_0(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_4(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_5(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_6(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LD_7(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ASL_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_LSR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ASR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ROR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MUL64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MULU64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ADDS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SUBS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_DIVAW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ASLS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ASRS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ADDSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SUBSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SWAP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_NORM(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_SAT16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_RND16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ABSSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ABSS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_NEGSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_NEGS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_NORMW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_ARC_EXT06(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_USER_EXT07(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_USER_EXT08(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MARKET_EXT09(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MARKET_EXT0a(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - static int handle_dasm32_MARKET_EXT0b(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); - - static int handle_dasm_LD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDB_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDW_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SUB_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASL_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASR_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_b_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_MOV_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_CMP_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_MOV_S_h_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_J_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_J_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_JL_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_JL_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SUB_S_NE_b_b_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_NOP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_UNIMP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_JEQ_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_JNE_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_J_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_J_S_D_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SUB_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_AND_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_OR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BIC_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_XOR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_TST_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_MUL64_S_0_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SEXB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SEXW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_EXTB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_EXTW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ABS_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_NOT_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_NEG_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD1_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD2_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD3_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASL_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LSR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASL_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LSR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_TRAP_S_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BRK_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LD_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDW_S_X_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ST_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_STB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_STW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASL_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LSR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ASR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SUB_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BSET_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BCLR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BMSK_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BTST_S_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ST_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_STB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_SUB_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_POP_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_POP_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_PUSH_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_PUSH_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDB_S_r0_gp_s9(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LDW_S_r0_gp_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_LD_S_b_pcl_u10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_MOV_S_b_u8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_ADD_S_b_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_CMP_S_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BREQ_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BRNE_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_B_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BEQ_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BNE_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BGT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BGE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BLT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BLE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BHI_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BHS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BLO_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BLS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_BL_S_s13(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); - - /************************************************************************************************************************************ - * * - * illegal opcode handlers (disassembly) * - * * - ************************************************************************************************************************************/ - - static int handle_dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint16_t op, const data_buffer &opcodes); - static int handle_dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint16_t op, const data_buffer &opcodes); - - static int handle_dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint32_t op, const data_buffer &opcodes); - static int handle_dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint32_t op, const data_buffer &opcodes); - static int handle_dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer &opcodes); - - static int handle_dasm_reserved(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer &opcodes); }; -#endif +#endif // MAME_CPU_ARCOMPACT_ARCOMPACTDASM_H diff --git a/src/devices/cpu/arcompact/arcompactdasm_internal.h b/src/devices/cpu/arcompact/arcompactdasm_internal.h new file mode 100644 index 00000000000..e5c766bc98b --- /dev/null +++ b/src/devices/cpu/arcompact/arcompactdasm_internal.h @@ -0,0 +1,251 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/*********************************\ + ARCompact disassembler + +\*********************************/ + +#ifndef MAME_CPU_ARCOMPACT_ARCOMPACTDASM_INTERNAL_H +#define MAME_CPU_ARCOMPACT_ARCOMPACTDASM_INTERNAL_H + +#pragma once + +#include "arcompactdasm.h" + + +class arcompact_disassembler::handle +{ +public: + static int dasm32_B_cc_D_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_B_D_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BL_cc_d_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BL_d_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BREQ_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRNE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRLT_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRGE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRLO_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRHS_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BBIT0_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BBIT1_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BREQ_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRNE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRLT_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRGE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRLO_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRHS_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BBIT0_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BBIT1_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_r_o(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ST_r_o(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + + // ALU Operations, 0x04, [0x00-0x1F] + static int dasm32_ADD(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ADC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SBC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_AND(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_OR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BIC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_XOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MAX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MIN(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MOV(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_TST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_CMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_RCMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_RSUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BSET(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BCLR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BTST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BXOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BMSK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ADD1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ADD2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ADD3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SUB1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SUB2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SUB3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MPY(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MPYH(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MPYHU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MPYU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + // + static int dasm32_Jcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_Jcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_JLcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_JLcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_FLAG(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ASL_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ASR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LSR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ROR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_RRC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SEXB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SEXW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_EXTB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_EXTW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ABS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_NOT(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_RLC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_EX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SLEEP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SWI(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SYNC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_RTIE(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_BRK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_0(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_4(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_5(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_6(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LD_7(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ASL_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_LSR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ASR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ROR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MUL64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MULU64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ADDS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SUBS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_DIVAW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ASLS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ASRS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ADDSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SUBSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SWAP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_NORM(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_SAT16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_RND16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ABSSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ABSS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_NEGSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_NEGS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_NORMW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_ARC_EXT06(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_USER_EXT07(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_USER_EXT08(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MARKET_EXT09(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MARKET_EXT0a(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + static int dasm32_MARKET_EXT0b(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes); + + static int dasm_LD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDB_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDW_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SUB_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASL_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASR_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_b_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_MOV_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_CMP_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_MOV_S_h_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_J_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_J_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_JL_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_JL_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SUB_S_NE_b_b_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_NOP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_UNIMP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_JEQ_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_JNE_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_J_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_J_S_D_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SUB_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_AND_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_OR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BIC_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_XOR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_TST_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_MUL64_S_0_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SEXB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SEXW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_EXTB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_EXTW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ABS_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_NOT_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_NEG_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD1_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD2_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD3_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASL_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LSR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASL_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LSR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_TRAP_S_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BRK_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LD_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDW_S_X_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ST_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_STB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_STW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASL_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LSR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ASR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SUB_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BSET_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BCLR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BMSK_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BTST_S_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ST_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_STB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_SUB_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_POP_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_POP_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_PUSH_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_PUSH_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDB_S_r0_gp_s9(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LDW_S_r0_gp_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_LD_S_b_pcl_u10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_MOV_S_b_u8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_ADD_S_b_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_CMP_S_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BREQ_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BRNE_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_B_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BEQ_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BNE_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BGT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BGE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BLT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BLE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BHI_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BHS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BLO_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BLS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + static int dasm_BL_S_s13(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes); + + /************************************************************************************************************************************ + * * + * illegal opcode handlers (disassembly) * + * * + ************************************************************************************************************************************/ + + static int dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint16_t op, const data_buffer &opcodes); + static int dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint16_t op, const data_buffer &opcodes); + static int dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint16_t op, const data_buffer &opcodes); + + static int dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint32_t op, const data_buffer &opcodes); + static int dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint32_t op, const data_buffer &opcodes); + static int dasm_illegal(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer &opcodes); + + static int dasm_reserved(std::ostream &stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer &opcodes); +}; + +#endif // MAME_CPU_ARCOMPACT_ARCOMPACTDASM_INTERNAL_H diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops.cpp index 4097d798901..b5d5af50ee2 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops.cpp @@ -6,8 +6,7 @@ \*********************************/ #include "emu.h" - -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" /************************************************************************************************************************************ @@ -25,10 +24,10 @@ int arcompact_disassembler::handle04_f_a_b_c_helper_dasm(std::ostream &stream, o uint32_t limm = 0; int got_limm = 0; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint8_t creg = dasm_common32_get_creg(op); - uint8_t areg = dasm_common32_get_areg(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint8_t creg = common32_get_creg(op); + uint8_t areg = common32_get_areg(op); util::stream_format(stream, "%s%s", optext, flagbit[F ? 1:0]); @@ -94,10 +93,10 @@ int arcompact_disassembler::handle04_f_a_b_u6_helper_dasm(std::ostream &stream, uint32_t limm = 0; // int got_limm = 0; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint32_t u = dasm_common32_get_u6(op); - uint8_t areg = dasm_common32_get_areg(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint32_t u = common32_get_u6(op); + uint8_t areg = common32_get_areg(op); util::stream_format(stream, "%s%s", optext, flagbit[F ? 1:0]); @@ -149,9 +148,9 @@ int arcompact_disassembler::handle04_f_b_b_s12_helper_dasm(std::ostream &stream, uint32_t limm; //int got_limm = 0; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint32_t S = dasm_common32_get_s12(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint32_t S = common32_get_s12(op); util::stream_format(stream, "%s%s", optext, flagbit[F ? 1:0]); @@ -181,10 +180,10 @@ int arcompact_disassembler::handle04_cc_f_b_b_c_helper_dasm(std::ostream &stream uint32_t limm = 0; int got_limm = 0; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint8_t condition = dasm_common32_get_condition(op); - uint8_t creg = dasm_common32_get_creg(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint8_t condition = common32_get_condition(op); + uint8_t creg = common32_get_creg(op); util::stream_format(stream, "%s%s%s", optext, conditions[condition], flagbit[F ? 1:0]); @@ -227,10 +226,10 @@ int arcompact_disassembler::handle04_cc_f_b_b_u6_helper_dasm(std::ostream &strea uint32_t limm; //int got_limm = 0; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint8_t condition = dasm_common32_get_condition(op); - uint32_t u = dasm_common32_get_u6(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint8_t condition = common32_get_condition(op); + uint32_t u = common32_get_u6(op); util::stream_format(stream, "%s%s%s", optext, conditions[condition], flagbit[F ? 1:0]); @@ -270,7 +269,7 @@ int arcompact_disassembler::handle04_p11_helper_dasm(std::ostream &stream, offs_ int arcompact_disassembler::handle04_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes, const char* optext, int ignore_dst, int b_reserved) { - uint8_t p = dasm_common32_get_p(op); + uint8_t p = common32_get_p(op); switch (p) { @@ -284,25 +283,25 @@ int arcompact_disassembler::handle04_helper_dasm(std::ostream &stream, offs_t pc } -int arcompact_disassembler::handle_dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint32_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint32_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%08x)\n", param1, param2, op); return 4; } -int arcompact_disassembler::handle_dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint32_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint32_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%08x)\n", param1, param2, param3, op); return 4; } -int arcompact_disassembler::handle_dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%08x)\n", param1, param2, param3, param4, op); return 4; } -int arcompact_disassembler::handle_dasm_reserved(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_reserved(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint32_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%08x)\n", param1, param2, param3, param4, op); return 4; diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_00to01.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_00to01.cpp index 475d0a440ab..a9993507b60 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_00to01.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_00to01.cpp @@ -5,7 +5,7 @@ \*********************************/ #include "emu.h" -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" inline uint32_t arcompact_disassembler::get_01_01_01_address_offset(uint32_t op) @@ -16,7 +16,7 @@ inline uint32_t arcompact_disassembler::get_01_01_01_address_offset(uint32_t op) return address; } -int arcompact_disassembler::handle_dasm32_B_cc_D_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_B_cc_D_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; // Branch Conditionally @@ -25,13 +25,13 @@ int arcompact_disassembler::handle_dasm32_B_cc_D_s21(std::ostream &stream, offs_ address |= ((op & 0x0000ffc0) >> 6) << 10; address = util::sext(address, 20); int n = (op & 0x00000020) >> 5; - uint8_t condition = dasm_common32_get_condition(op); + uint8_t condition = common32_get_condition(op); util::stream_format(stream, "B%s%s 0x%08x", conditions[condition], delaybit[n], (pc&0xfffffffc) + (address * 2)); return size; } -int arcompact_disassembler::handle_dasm32_B_D_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_B_D_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; // Branch Unconditionally Far @@ -47,7 +47,7 @@ int arcompact_disassembler::handle_dasm32_B_D_s25(std::ostream &stream, offs_t p return size; } -int arcompact_disassembler::handle_dasm32_BL_cc_d_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BL_cc_d_s21(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; @@ -59,13 +59,13 @@ int arcompact_disassembler::handle_dasm32_BL_cc_d_s21(std::ostream &stream, offs int n = (op & 0x00000020) >> 5; - uint8_t condition = dasm_common32_get_condition(op); + uint8_t condition = common32_get_condition(op); util::stream_format(stream, "BL%s%s 0x%08x", conditions[condition], delaybit[n], (pc&0xfffffffc) + (address *2)); return size; } -int arcompact_disassembler::handle_dasm32_BL_d_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BL_d_s25(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; // Branch and Link Unconditionally Far @@ -92,8 +92,8 @@ int arcompact_disassembler::handle01_01_00_helper(std::ostream &stream, offs_t p // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii uint32_t address = get_01_01_01_address_offset(op); - uint8_t creg = dasm_common32_get_creg(op); - uint8_t breg = dasm_common32_get_breg(op); + uint8_t creg = common32_get_creg(op); + uint8_t breg = common32_get_breg(op); int n = (op & 0x00000020) >> 5; if ((breg != DASM_REG_LIMM) && (creg != DASM_REG_LIMM)) @@ -125,42 +125,42 @@ int arcompact_disassembler::handle01_01_00_helper(std::ostream &stream, offs_t p // register - register cases -int arcompact_disassembler::handle_dasm32_BREQ_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BREQ_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BREQ"); } -int arcompact_disassembler::handle_dasm32_BRNE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRNE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BRNE"); } -int arcompact_disassembler::handle_dasm32_BRLT_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRLT_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BRLT"); } -int arcompact_disassembler::handle_dasm32_BRGE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRGE_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BRGE"); } -int arcompact_disassembler::handle_dasm32_BRLO_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRLO_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BRLO"); } -int arcompact_disassembler::handle_dasm32_BRHS_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRHS_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BRHS"); } -int arcompact_disassembler::handle_dasm32_BBIT0_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BBIT0_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BBIT0"); } -int arcompact_disassembler::handle_dasm32_BBIT1_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BBIT1_reg_reg(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_00_helper( stream, pc, op, opcodes, "BBIT1"); } @@ -176,8 +176,8 @@ int arcompact_disassembler::handle01_01_01_helper(std::ostream &stream, offs_t p // 0000 1bbb ssss sss1 SBBB uuuu uuN1 iiii uint32_t address = get_01_01_01_address_offset(op); - uint32_t u = dasm_common32_get_u6(op); - uint8_t breg = dasm_common32_get_breg(op); + uint32_t u = common32_get_u6(op); + uint8_t breg = common32_get_breg(op); int n = (op & 0x00000020) >> 5; util::stream_format(stream, "%s%s %s, 0x%02x 0x%08x", optext, delaybit[n], regnames[breg], u, (pc&0xfffffffc) + (address * 2)); @@ -186,42 +186,42 @@ int arcompact_disassembler::handle01_01_01_helper(std::ostream &stream, offs_t p } // register -immediate cases -int arcompact_disassembler::handle_dasm32_BREQ_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BREQ_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BREQ"); } -int arcompact_disassembler::handle_dasm32_BRNE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRNE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BRNE"); } -int arcompact_disassembler::handle_dasm32_BRLT_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRLT_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BRLT"); } -int arcompact_disassembler::handle_dasm32_BRGE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRGE_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BRGE"); } -int arcompact_disassembler::handle_dasm32_BRLO_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRLO_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BRLO"); } -int arcompact_disassembler::handle_dasm32_BRHS_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRHS_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BRHS"); } -int arcompact_disassembler::handle_dasm32_BBIT0_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BBIT0_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BBIT0"); } -int arcompact_disassembler::handle_dasm32_BBIT1_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BBIT1_reg_imm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle01_01_01_helper(stream, pc, op, opcodes, "BBIT1"); } diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_02to03.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_02to03.cpp index 43023debcee..73b4ff6af49 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_02to03.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_02to03.cpp @@ -6,11 +6,10 @@ \*********************************/ #include "emu.h" +#include "arcompactdasm_internal.h" -#include "arcompactdasm.h" - -int arcompact_disassembler::handle_dasm32_LD_r_o(std::ostream& stream, offs_t pc, uint32_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm32_LD_r_o(std::ostream& stream, offs_t pc, uint32_t op, const data_buffer& opcodes) { // bitpos // 1111 1111 1111 1111 0000 0000 0000 0000 @@ -19,14 +18,14 @@ int arcompact_disassembler::handle_dasm32_LD_r_o(std::ostream& stream, offs_t pc // 0001 0bbb ssss ssss SBBB DaaZ ZXAA AAAA int size = 4; - uint8_t areg = dasm_common32_get_areg(op); + uint8_t areg = common32_get_areg(op); int X = (op & 0x00000040) >> 6; int Z = (op & 0x00000180) >> 7; int a = (op & 0x00000600) >> 9; int D = (op & 0x00000800) >> 11; int S = (op & 0x00008000) >> 15; int s = (op & 0x00ff0000) >> 16; - uint8_t breg = dasm_common32_get_breg(op); + uint8_t breg = common32_get_breg(op); uint32_t sdat = s | (S << 8); sdat = util::sext(sdat, 9); @@ -52,7 +51,7 @@ int arcompact_disassembler::handle_dasm32_LD_r_o(std::ostream& stream, offs_t pc return size; } -int arcompact_disassembler::handle_dasm32_ST_r_o(std::ostream& stream, offs_t pc, uint32_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm32_ST_r_o(std::ostream& stream, offs_t pc, uint32_t op, const data_buffer& opcodes) { int size = 4; uint32_t limm = 0; @@ -65,14 +64,14 @@ int arcompact_disassembler::handle_dasm32_ST_r_o(std::ostream& stream, offs_t pc int S = (op & 0x00008000) >> 15; int s = (op & 0x00ff0000) >> 16; - uint8_t breg = dasm_common32_get_breg(op); + uint8_t breg = common32_get_breg(op); uint32_t sdat = s | (S << 8); sdat = util::sext(sdat, 9); int Z = (op & 0x00000006) >> 1; int a = (op & 0x00000018) >> 3; int D = (op & 0x00000020) >> 5; - uint8_t creg = dasm_common32_get_creg(op); + uint8_t creg = common32_get_creg(op); if (breg == DASM_REG_LIMM) { diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_04.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_04.cpp index cd193591226..dac2dd6352e 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_04.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_04.cpp @@ -8,8 +8,7 @@ \*********************************/ #include "emu.h" - -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" // MOV is a special case because 'a' is completely ignored even where @@ -19,9 +18,9 @@ int arcompact_disassembler::handle04_MOV_f_a_b_c_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint8_t creg = dasm_common32_get_creg(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint8_t creg = common32_get_creg(op); util::stream_format(stream, "MOV%s %s,", flagbit[F ? 1:0], regnames[breg]); if (creg == DASM_REG_LIMM) { @@ -39,9 +38,9 @@ int arcompact_disassembler::handle04_MOV_f_a_b_c_helper_dasm(std::ostream &strea int arcompact_disassembler::handle04_MOV_f_a_b_u6_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint32_t u = dasm_common32_get_u6(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint32_t u = common32_get_u6(op); // if there's no destination and no flags being set, this is a NOP if ((F == 0) & (breg == DASM_REG_LIMM)) { @@ -57,9 +56,9 @@ int arcompact_disassembler::handle04_MOV_f_a_b_u6_helper_dasm(std::ostream &stre int arcompact_disassembler::handle04_MOV_f_b_b_s12_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint32_t S = dasm_common32_get_s12(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint32_t S = common32_get_s12(op); util::stream_format(stream, "MOV%s %s, 0x%08x", flagbit[F ? 1:0], regnames[breg], S); return 4; } @@ -67,10 +66,10 @@ int arcompact_disassembler::handle04_MOV_f_b_b_s12_helper_dasm(std::ostream &str int arcompact_disassembler::handle04_MOV_cc_f_b_b_c_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { int size = 4; - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint8_t condition = dasm_common32_get_condition(op); - uint8_t creg = dasm_common32_get_creg(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint8_t condition = common32_get_condition(op); + uint8_t creg = common32_get_creg(op); util::stream_format(stream, "MOV%s%s %s, ", conditions[condition], flagbit[F ? 1:0], regnames[breg]); if (creg == DASM_REG_LIMM) { @@ -87,10 +86,10 @@ int arcompact_disassembler::handle04_MOV_cc_f_b_b_c_helper_dasm(std::ostream &st int arcompact_disassembler::handle04_MOV_cc_f_b_b_u6_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); - uint8_t condition = dasm_common32_get_condition(op); - uint32_t u = dasm_common32_get_u6(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); + uint8_t condition = common32_get_condition(op); + uint32_t u = common32_get_u6(op); util::stream_format(stream, "MOV%s%s %s, 0x%08x", conditions[condition], flagbit[F ? 1:0], regnames[breg], u); return 4; } @@ -109,7 +108,7 @@ int arcompact_disassembler::handle04_MOV_p11_helper_dasm(std::ostream &stream, o int arcompact_disassembler::handle04_MOV_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { - uint8_t p = dasm_common32_get_p(op); + uint8_t p = common32_get_p(op); switch (p) { case 0x00: return handle04_MOV_f_a_b_c_helper_dasm(stream, pc, op, opcodes); @@ -122,180 +121,180 @@ int arcompact_disassembler::handle04_MOV_helper_dasm(std::ostream &stream, offs_ } -int arcompact_disassembler::handle_dasm32_ADD(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADD(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADD", 0,0); } -int arcompact_disassembler::handle_dasm32_ADC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADC", 0,0); } -int arcompact_disassembler::handle_dasm32_SUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SUB", 0,0); } -int arcompact_disassembler::handle_dasm32_SBC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SBC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SBC", 0,0); } -int arcompact_disassembler::handle_dasm32_AND(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_AND(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "AND", 0,0); } -int arcompact_disassembler::handle_dasm32_OR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_OR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "OR", 0,0); } -int arcompact_disassembler::handle_dasm32_BIC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BIC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "BIC", 0,0); } -int arcompact_disassembler::handle_dasm32_XOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_XOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "XOR", 0,0); } -int arcompact_disassembler::handle_dasm32_MAX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MAX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MAX", 0,0); } -int arcompact_disassembler::handle_dasm32_MIN(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MIN(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MIN", 0,0); } -int arcompact_disassembler::handle_dasm32_MOV(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MOV(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_MOV_helper_dasm(stream, pc, op, opcodes); } -int arcompact_disassembler::handle_dasm32_TST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_TST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "TST", 1,0); } -int arcompact_disassembler::handle_dasm32_CMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_CMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "CMP", 1,0); } -int arcompact_disassembler::handle_dasm32_RCMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_RCMP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "RCMP", 1,0); } -int arcompact_disassembler::handle_dasm32_RSUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_RSUB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "RSUB", 0,0); } -int arcompact_disassembler::handle_dasm32_BSET(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BSET(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "BSET", 0,0); } -int arcompact_disassembler::handle_dasm32_BCLR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BCLR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "BCLR", 0,0); } -int arcompact_disassembler::handle_dasm32_BTST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BTST(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "BTST", 0,0); } -int arcompact_disassembler::handle_dasm32_BXOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BXOR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "BXOR", 0,0); } -int arcompact_disassembler::handle_dasm32_BMSK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BMSK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "BMSK", 0,0); } -int arcompact_disassembler::handle_dasm32_ADD1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADD1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADD1", 0,0); } -int arcompact_disassembler::handle_dasm32_ADD2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADD2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADD2", 0,0); } -int arcompact_disassembler::handle_dasm32_ADD3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADD3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADD3", 0,0); } -int arcompact_disassembler::handle_dasm32_SUB1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SUB1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SUB1", 0,0); } -int arcompact_disassembler::handle_dasm32_SUB2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SUB2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SUB2", 0,0); } -int arcompact_disassembler::handle_dasm32_SUB3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SUB3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SUB3", 0,0); } -int arcompact_disassembler::handle_dasm32_MPY(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MPY(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MPY", 0,0); } // * -int arcompact_disassembler::handle_dasm32_MPYH(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MPYH(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MPYH", 0,0); } // * -int arcompact_disassembler::handle_dasm32_MPYHU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MPYHU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MPYHU", 0,0); } // * -int arcompact_disassembler::handle_dasm32_MPYU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MPYU(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MPYU", 0,0); } // * -int arcompact_disassembler::handle_dasm32_Jcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_Jcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "J", 1,1); } -int arcompact_disassembler::handle_dasm32_Jcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_Jcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "J.D", 1,1); } -int arcompact_disassembler::handle_dasm32_JLcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_JLcc(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "JL", 1,1); } -int arcompact_disassembler::handle_dasm32_JLcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_JLcc_D(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "JL.D", 1,1); } -int arcompact_disassembler::handle_dasm32_LP(std::ostream& stream, offs_t pc, uint32_t op, const data_buffer& opcodes) // LPcc (loop setup) +int arcompact_disassembler::handle::dasm32_LP(std::ostream& stream, offs_t pc, uint32_t op, const data_buffer& opcodes) // LPcc (loop setup) { - //uint8_t breg = dasm_common32_get_breg(op); // breg is reserved - uint8_t p = dasm_common32_get_p(op); + //uint8_t breg = common32_get_breg(op); // breg is reserved + uint8_t p = common32_get_p(op); if (p == 0x00) { @@ -307,13 +306,13 @@ int arcompact_disassembler::handle_dasm32_LP(std::ostream& stream, offs_t pc, ui } else if (p == 0x02) // Loop unconditional { // 0010 0RRR 1010 1000 0RRR ssss ssSS SSSS - uint32_t S = dasm_common32_get_s12(op); + uint32_t S = common32_get_s12(op); util::stream_format(stream, "LP (start %08x, end %08x)", pc + 4, (pc & 0xfffffffc) + S * 2); } else if (p == 0x03) // Loop conditional { // 0010 0RRR 1110 1000 0RRR uuuu uu1Q QQQQ - uint32_t u = dasm_common32_get_u6(op); - uint8_t condition = dasm_common32_get_condition(op); + uint32_t u = common32_get_u6(op); + uint8_t condition = common32_get_condition(op); util::stream_format(stream, "LP<%s> (start %08x, end %08x)", conditions[condition], pc + 4, (pc & 0xfffffffc) + u * 2); } @@ -333,7 +332,7 @@ void arcompact_disassembler::output_aux_regname(std::ostream& stream, uint32_t a util::stream_format(stream, "[%03x]", auxreg); } -int arcompact_disassembler::handle_dasm32_LR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) // Load FROM Auxiliary register TO register +int arcompact_disassembler::handle::dasm32_LR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) // Load FROM Auxiliary register TO register { // pp F // 0010 0bbb 0010 1010 0BBB CCCC CCRR RRRR @@ -344,9 +343,9 @@ int arcompact_disassembler::handle_dasm32_LR(std::ostream &stream, offs_t pc, ui uint32_t limm = 0; int got_limm = 0; - uint8_t p = dasm_common32_get_p(op); - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); + uint8_t p = common32_get_p(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); util::stream_format(stream, "LR"); if (F) util::stream_format(stream, "."); @@ -363,7 +362,7 @@ int arcompact_disassembler::handle_dasm32_LR(std::ostream &stream, offs_t pc, ui if (p == 0) { - uint8_t creg = dasm_common32_get_creg(op); + uint8_t creg = common32_get_creg(op); if (creg == DASM_REG_LIMM) { if (!got_limm) @@ -381,12 +380,12 @@ int arcompact_disassembler::handle_dasm32_LR(std::ostream &stream, offs_t pc, ui } else if (p == 1) { - uint32_t u = dasm_common32_get_u6(op); + uint32_t u = common32_get_u6(op); output_aux_regname(stream, u); } else if (p == 2) { - uint32_t S = dasm_common32_get_s12(op); + uint32_t S = common32_get_s12(op); output_aux_regname(stream, S); } else if (p == 3) @@ -397,7 +396,7 @@ int arcompact_disassembler::handle_dasm32_LR(std::ostream &stream, offs_t pc, ui return size; } -int arcompact_disassembler::handle_dasm32_SR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) // Store TO Auxiliary register FROM register +int arcompact_disassembler::handle::dasm32_SR(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) // Store TO Auxiliary register FROM register { // code at ~ 40073DFE in leapster bios is manually setting up a loop this way // rather than using the lPcc opcode @@ -405,9 +404,9 @@ int arcompact_disassembler::handle_dasm32_SR(std::ostream &stream, offs_t pc, ui uint32_t limm = 0; int got_limm = 0; - uint8_t p = dasm_common32_get_p(op); - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); + uint8_t p = common32_get_p(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); util::stream_format(stream, "SR"); if (F) util::stream_format(stream, "."); @@ -428,7 +427,7 @@ int arcompact_disassembler::handle_dasm32_SR(std::ostream &stream, offs_t pc, ui if (p == 0) { - uint8_t creg = dasm_common32_get_creg(op); + uint8_t creg = common32_get_creg(op); if (creg == DASM_REG_LIMM) { @@ -447,12 +446,12 @@ int arcompact_disassembler::handle_dasm32_SR(std::ostream &stream, offs_t pc, ui } else if (p == 1) { - uint32_t u = dasm_common32_get_u6(op); + uint32_t u = common32_get_u6(op); output_aux_regname(stream, u); } else if (p == 2) { - uint32_t S = dasm_common32_get_s12(op); + uint32_t S = common32_get_s12(op); output_aux_regname(stream, S); } else if (p == 3) @@ -463,7 +462,7 @@ int arcompact_disassembler::handle_dasm32_SR(std::ostream &stream, offs_t pc, ui } -int arcompact_disassembler::handle_dasm32_FLAG(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_FLAG(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { // leapster bios uses formats for FLAG that are explicitly defined and are considered redundant return handle04_helper_dasm(stream, pc, op, opcodes, "FLAG", 1,1); diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_3f_zop.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_3f_zop.cpp index e4628a71524..4a15ba2670a 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_3f_zop.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_3f_zop.cpp @@ -8,34 +8,33 @@ \*********************************/ #include "emu.h" +#include "arcompactdasm_internal.h" -#include "arcompactdasm.h" - -int arcompact_disassembler::handle_dasm32_SLEEP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SLEEP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "SLEEP (%08x)", op); return 4; } -int arcompact_disassembler::handle_dasm32_SWI(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SWI(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "SWI / TRAP0 (%08x)", op); return 4; } -int arcompact_disassembler::handle_dasm32_SYNC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SYNC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "SYNC (%08x)", op); return 4; } -int arcompact_disassembler::handle_dasm32_RTIE(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_RTIE(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "RTIE (%08x)", op); return 4; } -int arcompact_disassembler::handle_dasm32_BRK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_BRK(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "BRK (%08x)", op); return 4; diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_sop.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_sop.cpp index 1caf849734d..2ed964b10ac 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_sop.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_04_2f_sop.cpp @@ -8,8 +8,7 @@ \*********************************/ #include "emu.h" - -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" int arcompact_disassembler::handle04_2f_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes, const char* optext) { @@ -17,9 +16,9 @@ int arcompact_disassembler::handle04_2f_helper_dasm(std::ostream &stream, offs_t // 0010 0bbb pp10 1111 FBBB CCCC CCII IIII int size = 4; - uint8_t p = dasm_common32_get_p(op); - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); + uint8_t p = common32_get_p(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); util::stream_format(stream, "%s%s", optext, flagbit[F]); @@ -35,7 +34,7 @@ int arcompact_disassembler::handle04_2f_helper_dasm(std::ostream &stream, offs_t if (p == 0) { - uint8_t creg = dasm_common32_get_creg(op); + uint8_t creg = common32_get_creg(op); if (creg == DASM_REG_LIMM) { @@ -51,7 +50,7 @@ int arcompact_disassembler::handle04_2f_helper_dasm(std::ostream &stream, offs_t } else if (p == 1) { - uint32_t u = dasm_common32_get_u6(op); + uint32_t u = common32_get_u6(op); util::stream_format(stream, "0x%02x ", u); } @@ -67,67 +66,67 @@ int arcompact_disassembler::handle04_2f_helper_dasm(std::ostream &stream, offs_t return size; } -int arcompact_disassembler::handle_dasm32_ASL_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ASL_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "ASL"); } -int arcompact_disassembler::handle_dasm32_ASR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ASR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "ASR"); } -int arcompact_disassembler::handle_dasm32_LSR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LSR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "LSR"); } -int arcompact_disassembler::handle_dasm32_ROR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ROR_single(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "ROR"); } -int arcompact_disassembler::handle_dasm32_RRC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_RRC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "RCC"); } -int arcompact_disassembler::handle_dasm32_SEXB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SEXB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "SEXB"); } -int arcompact_disassembler::handle_dasm32_SEXW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SEXW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "SEXW"); } -int arcompact_disassembler::handle_dasm32_EXTB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_EXTB(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "EXTB"); } -int arcompact_disassembler::handle_dasm32_EXTW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_EXTW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "EXTW"); } -int arcompact_disassembler::handle_dasm32_ABS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ABS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "ABS"); } -int arcompact_disassembler::handle_dasm32_NOT(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_NOT(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "NOT"); } -int arcompact_disassembler::handle_dasm32_RLC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_RLC(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "RLC"); } -int arcompact_disassembler::handle_dasm32_EX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_EX(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_2f_helper_dasm(stream, pc, op, opcodes, "EX"); } diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_04_3x.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_04_3x.cpp index c1596d7ac24..8a58055d52a 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_04_3x.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_04_3x.cpp @@ -6,8 +6,7 @@ \*********************************/ #include "emu.h" - -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" // format on these is.. @@ -22,10 +21,10 @@ int arcompact_disassembler::handle04_3x_helper_dasm(std::ostream& stream, offs_t util::stream_format(stream, "LD%s%s", datasize[dsize], dataextend[extend]); int mode = (op & 0x00c00000) >> 22; - uint8_t breg = dasm_common32_get_breg(op); + uint8_t breg = common32_get_breg(op); int D = (op & 0x00008000) >> 15; - uint8_t creg = dasm_common32_get_creg(op); - uint8_t areg = dasm_common32_get_areg(op); + uint8_t creg = common32_get_creg(op); + uint8_t areg = common32_get_areg(op); util::stream_format(stream, "%s%s %s. ", addressmode[mode], cachebit[D], regnames[areg]); @@ -59,44 +58,44 @@ int arcompact_disassembler::handle04_3x_helper_dasm(std::ostream& stream, offs_t return size; } -int arcompact_disassembler::handle_dasm32_LD_0(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_0(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,0,0); } // ZZ value of 0x0 with X of 1 is illegal -int arcompact_disassembler::handle_dasm32_LD_1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_1(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,0,1); } -int arcompact_disassembler::handle_dasm32_LD_2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_2(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,1,0); } -int arcompact_disassembler::handle_dasm32_LD_3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_3(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,1,1); } -int arcompact_disassembler::handle_dasm32_LD_4(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_4(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,2,0); } -int arcompact_disassembler::handle_dasm32_LD_5(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_5(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,2,1); } // ZZ value of 0x3 is illegal -int arcompact_disassembler::handle_dasm32_LD_6(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_6(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,3,0); } -int arcompact_disassembler::handle_dasm32_LD_7(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LD_7(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_3x_helper_dasm(stream, pc, op, opcodes,3,1); } diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_05.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_05.cpp index 6d9fe4962ec..8aa37d809c4 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_05.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_05.cpp @@ -5,70 +5,69 @@ \*********************************/ #include "emu.h" +#include "arcompactdasm_internal.h" -#include "arcompactdasm.h" - -int arcompact_disassembler::handle_dasm32_ASL_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ASL_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ASL", 0,0); } -int arcompact_disassembler::handle_dasm32_LSR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_LSR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "LSR", 0,0); } -int arcompact_disassembler::handle_dasm32_ASR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ASR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ASR", 0,0); } -int arcompact_disassembler::handle_dasm32_ROR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ROR_multiple(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ROR", 0,0); } -int arcompact_disassembler::handle_dasm32_MUL64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MUL64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MUL64", 2,0); } -int arcompact_disassembler::handle_dasm32_MULU64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MULU64(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "MULU64", 2,0); } -int arcompact_disassembler::handle_dasm32_ADDS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADDS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADDS", 0,0); } -int arcompact_disassembler::handle_dasm32_SUBS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SUBS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SUBS", 0,0); } -int arcompact_disassembler::handle_dasm32_DIVAW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_DIVAW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "DIVAW", 0,0); } -int arcompact_disassembler::handle_dasm32_ASLS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ASLS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ASLS", 0,0); } -int arcompact_disassembler::handle_dasm32_ASRS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ASRS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ASRS", 0,0); } -int arcompact_disassembler::handle_dasm32_ADDSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ADDSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "ADDSDW", 0,0); } -int arcompact_disassembler::handle_dasm32_SUBSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SUBSDW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle04_helper_dasm(stream, pc, op, opcodes, "SUBSDW", 0,0); } diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_05_2f_sop.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_05_2f_sop.cpp index 20aae625211..fea99652db6 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_05_2f_sop.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_05_2f_sop.cpp @@ -6,8 +6,7 @@ \*********************************/ #include "emu.h" - -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" int arcompact_disassembler::handle05_2f_0x_helper_dasm(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes, const char* optext) { @@ -19,15 +18,15 @@ int arcompact_disassembler::handle05_2f_0x_helper_dasm(std::ostream &stream, off int size = 4; - uint8_t p = dasm_common32_get_p(op); - uint8_t breg = dasm_common32_get_breg(op); - bool F = dasm_common32_get_F(op); + uint8_t p = common32_get_p(op); + uint8_t breg = common32_get_breg(op); + bool F = common32_get_F(op); util::stream_format(stream, "%s%s %s, ", optext, flagbit[F], regnames[breg]); if (p == 0) { - uint8_t creg = dasm_common32_get_creg(op); + uint8_t creg = common32_get_creg(op); if (creg == DASM_REG_LIMM) { @@ -44,7 +43,7 @@ int arcompact_disassembler::handle05_2f_0x_helper_dasm(std::ostream &stream, off } else if (p == 1) { - uint32_t u = dasm_common32_get_u6(op); + uint32_t u = common32_get_u6(op); util::stream_format(stream, "0x%02x ", u); } else if (p == 2) @@ -59,47 +58,47 @@ int arcompact_disassembler::handle05_2f_0x_helper_dasm(std::ostream &stream, off return size; } -int arcompact_disassembler::handle_dasm32_SWAP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SWAP(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "SWAP"); } -int arcompact_disassembler::handle_dasm32_NORM(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_NORM(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "NORM"); } -int arcompact_disassembler::handle_dasm32_SAT16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_SAT16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "SAT16"); } -int arcompact_disassembler::handle_dasm32_RND16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_RND16(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "RND16"); } -int arcompact_disassembler::handle_dasm32_ABSSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ABSSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "ABSSW"); } -int arcompact_disassembler::handle_dasm32_ABSS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ABSS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "ABSS"); } -int arcompact_disassembler::handle_dasm32_NEGSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_NEGSW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "NEGSW"); } -int arcompact_disassembler::handle_dasm32_NEGS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_NEGS(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "NEGS"); } -int arcompact_disassembler::handle_dasm32_NORMW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_NORMW(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { return handle05_2f_0x_helper_dasm(stream, pc, op, opcodes, "NORMW"); } diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_06to0b.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_06to0b.cpp index 0c999da25a2..9f436ceb970 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_06to0b.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_06to0b.cpp @@ -6,40 +6,39 @@ \*********************************/ #include "emu.h" +#include "arcompactdasm_internal.h" -#include "arcompactdasm.h" - -int arcompact_disassembler::handle_dasm32_ARC_EXT06(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_ARC_EXT06(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "op a,b,c (06 ARC ext) (%08x)", op ); return 4; } -int arcompact_disassembler::handle_dasm32_USER_EXT07(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_USER_EXT07(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "op a,b,c (07 User ext) (%08x)", op ); return 4; } -int arcompact_disassembler::handle_dasm32_USER_EXT08(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_USER_EXT08(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "op a,b,c (08 User ext) (%08x)", op ); return 4; } -int arcompact_disassembler::handle_dasm32_MARKET_EXT09(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MARKET_EXT09(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "op a,b,c (09 Market ext) (%08x)", op ); return 4; } -int arcompact_disassembler::handle_dasm32_MARKET_EXT0a(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MARKET_EXT0a(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "op a,b,c (0a Market ext) (%08x)", op ); return 4; } -int arcompact_disassembler::handle_dasm32_MARKET_EXT0b(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm32_MARKET_EXT0b(std::ostream &stream, offs_t pc, uint32_t op, const data_buffer &opcodes) { util::stream_format( stream, "op a,b,c (0b Market ext) (%08x)", op ); return 4; diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops_16bit.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops_16bit.cpp index a4dfaabcb45..2f8ca7618d7 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops_16bit.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops_16bit.cpp @@ -5,64 +5,63 @@ \*********************************/ #include "emu.h" - -#include "arcompactdasm.h" +#include "arcompactdasm_internal.h" int arcompact_disassembler::handle0c_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext, int format) { - uint8_t areg = expand_reg(dasm_common16_get_areg(op)); - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint8_t creg = expand_reg(dasm_common16_get_creg(op)); + uint8_t areg = common16_get_and_expand_areg(op); + uint8_t breg = common16_get_and_expand_breg(op); + uint8_t creg = common16_get_and_expand_creg(op); if (format == 0) util::stream_format(stream, "%s %s <- [%s, %s]", optext, regnames[areg], regnames[breg], regnames[creg]); else util::stream_format(stream, "%s %s <- %s, %s", optext, regnames[areg], regnames[breg], regnames[creg]); return 2; } -int arcompact_disassembler::handle_dasm_LD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0c_helper_dasm(stream, pc, op, opcodes, "LD_S", 0); } -int arcompact_disassembler::handle_dasm_LDB_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDB_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0c_helper_dasm(stream, pc, op, opcodes, "LDB_S", 0); } -int arcompact_disassembler::handle_dasm_LDW_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDW_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0c_helper_dasm(stream, pc, op, opcodes, "LDW_S", 0); } -int arcompact_disassembler::handle_dasm_ADD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_a_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0c_helper_dasm(stream, pc, op, opcodes, "ADD_S", 1); } int arcompact_disassembler::handle0d_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext) { - uint32_t u = dasm_common16_get_u3(op); - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint8_t creg = expand_reg(dasm_common16_get_creg(op)); + uint32_t u = common16_get_u3(op); + uint8_t breg = common16_get_and_expand_breg(op); + uint8_t creg = common16_get_and_expand_creg(op); util::stream_format(stream, "%s %s <- [%s, 0x%02x]", optext, regnames[creg], regnames[breg], u); return 2; } -int arcompact_disassembler::handle_dasm_ADD_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0d_helper_dasm(stream, pc, op, opcodes, "ADD_S"); } -int arcompact_disassembler::handle_dasm_SUB_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SUB_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0d_helper_dasm(stream, pc, op, opcodes, "SUB_S"); } -int arcompact_disassembler::handle_dasm_ASL_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASL_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0d_helper_dasm(stream, pc, op, opcodes, "ASL_S"); } -int arcompact_disassembler::handle_dasm_ASR_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASR_S_c_b_u3(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0d_helper_dasm(stream, pc, op, opcodes, "ASR_S"); } @@ -71,7 +70,7 @@ int arcompact_disassembler::handle0e_0x_helper_dasm(std::ostream &stream, offs_t { int size = 2; uint8_t h = dasm_group_0e_get_h(op); - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); + uint8_t breg = common16_get_and_expand_breg(op); if (h == DASM_REG_LIMM) { uint32_t limm; @@ -89,91 +88,91 @@ int arcompact_disassembler::handle0e_0x_helper_dasm(std::ostream &stream, offs_t return size; } -int arcompact_disassembler::handle_dasm_ADD_S_b_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_b_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0e_0x_helper_dasm(stream, pc, op, opcodes, "ADD_S", 0); } -int arcompact_disassembler::handle_dasm_MOV_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_MOV_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0e_0x_helper_dasm(stream, pc, op, opcodes, "MOV_S", 0); } -int arcompact_disassembler::handle_dasm_CMP_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_CMP_S_b_h_or_limm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0e_0x_helper_dasm(stream, pc, op, opcodes, "CMP_S", 0); } -int arcompact_disassembler::handle_dasm_MOV_S_h_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_MOV_S_h_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0e_0x_helper_dasm(stream, pc, op, opcodes, "MOV_S", 1); } int arcompact_disassembler::handle0f_00_0x_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); + uint8_t breg = common16_get_and_expand_breg(op); util::stream_format( stream, "%s %s", optext, regnames[breg]); return 2; } -int arcompact_disassembler::handle_dasm_J_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_J_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_00_0x_helper_dasm(stream, pc, op, opcodes, "J_S"); } -int arcompact_disassembler::handle_dasm_J_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_J_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_00_0x_helper_dasm(stream, pc, op, opcodes, "J_S.D"); } -int arcompact_disassembler::handle_dasm_JL_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_JL_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_00_0x_helper_dasm(stream, pc, op, opcodes, "JL_S"); } -int arcompact_disassembler::handle_dasm_JL_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_JL_S_D_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_00_0x_helper_dasm(stream, pc, op, opcodes, "JL_S.D"); } -int arcompact_disassembler::handle_dasm_SUB_S_NE_b_b_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SUB_S_NE_b_b_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_00_0x_helper_dasm(stream, pc, op, opcodes, "SUB_S.NE"); } // Zero parameters (ZOP) -int arcompact_disassembler::handle_dasm_NOP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_NOP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format(stream, "NOP_S"); return 2; } -int arcompact_disassembler::handle_dasm_UNIMP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_UNIMP_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { // Unimplemented Instruction, same as illegal, but recommended to fill blank space util::stream_format( stream, "UNIMP_S"); return 2; } -int arcompact_disassembler::handle_dasm_JEQ_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_JEQ_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format( stream, "JEQ_S [blink]"); return 2; } -int arcompact_disassembler::handle_dasm_JNE_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_JNE_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format( stream, "JNE_S [blink]"); return 2; } -int arcompact_disassembler::handle_dasm_J_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_J_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format( stream, "J_S [blink]"); return 2; } -int arcompact_disassembler::handle_dasm_J_S_D_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_J_S_D_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format( stream, "J_S.D [blink]"); return 2; @@ -181,8 +180,8 @@ int arcompact_disassembler::handle_dasm_J_S_D_blink(std::ostream &stream, offs_t int arcompact_disassembler::handle0f_0x_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext, int nodst) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint8_t creg = expand_reg(dasm_common16_get_creg(op)); + uint8_t breg = common16_get_and_expand_breg(op); + uint8_t creg = common16_get_and_expand_creg(op); if (nodst==0) util::stream_format(stream, "%s %s <- %s", optext, regnames[breg], regnames[creg]); else if (nodst==1) util::stream_format(stream, "%s , %s, %s", optext, regnames[breg], regnames[creg]); @@ -191,129 +190,129 @@ int arcompact_disassembler::handle0f_0x_helper_dasm(std::ostream &stream, offs_t return 2; } -int arcompact_disassembler::handle_dasm_SUB_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SUB_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "SUB_S",0); } -int arcompact_disassembler::handle_dasm_AND_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_AND_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "AND_S",0); } -int arcompact_disassembler::handle_dasm_OR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_OR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "OR_S",0); } -int arcompact_disassembler::handle_dasm_BIC_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BIC_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "BIC_S",0); } -int arcompact_disassembler::handle_dasm_XOR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_XOR_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "XOR_S",0); } -int arcompact_disassembler::handle_dasm_TST_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_TST_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "TST_S",1); } -int arcompact_disassembler::handle_dasm_MUL64_S_0_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_MUL64_S_0_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "MUL64_S",2); } // actual destination is special multiply registers -int arcompact_disassembler::handle_dasm_SEXB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SEXB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "SEXB_S",0); } -int arcompact_disassembler::handle_dasm_SEXW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SEXW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "SEXW_S",0); } -int arcompact_disassembler::handle_dasm_EXTB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_EXTB_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "EXTB_S",0); } -int arcompact_disassembler::handle_dasm_EXTW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_EXTW_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "EXTW_S",0); } -int arcompact_disassembler::handle_dasm_ABS_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ABS_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ABS_S",0); } -int arcompact_disassembler::handle_dasm_NOT_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_NOT_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "NOT_S",0); } -int arcompact_disassembler::handle_dasm_NEG_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_NEG_S_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "NEG_S",0); } -int arcompact_disassembler::handle_dasm_ADD1_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD1_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ADD1_S",0); } -int arcompact_disassembler::handle_dasm_ADD2_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD2_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ADD2_S",0); } -int arcompact_disassembler::handle_dasm_ADD3_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD3_S_b_b_c(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ADD3_S",0); } -int arcompact_disassembler::handle_dasm_ASL_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASL_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ASL_S",0); } -int arcompact_disassembler::handle_dasm_LSR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LSR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "LSR_S",0); } -int arcompact_disassembler::handle_dasm_ASR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASR_S_b_b_c_multiple(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ASR_S",0); } -int arcompact_disassembler::handle_dasm_ASL_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASL_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ASL1_S",0); } -int arcompact_disassembler::handle_dasm_ASR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "ASR1_S",0); } -int arcompact_disassembler::handle_dasm_LSR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LSR_S_b_c_single(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle0f_0x_helper_dasm(stream, pc, op, opcodes, "LSR1_S",0); } -int arcompact_disassembler::handle_dasm_TRAP_S_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) // special +int arcompact_disassembler::handle::dasm_TRAP_S_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) // special { // 0111 1uuu uuu1 1110 int u = (op & 0x07e0)>>5; util::stream_format( stream, "TRAP_S %02x",u); return 2; } -int arcompact_disassembler::handle_dasm_BRK_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) // special +int arcompact_disassembler::handle::dasm_BRK_S(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) // special { int u = (op & 0x07e0) >> 5; @@ -331,9 +330,9 @@ int arcompact_disassembler::handle_dasm_BRK_S(std::ostream &stream, offs_t pc, u int arcompact_disassembler::handle_ld_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext, int shift, int swap) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint8_t creg = expand_reg(dasm_common16_get_creg(op)); - uint32_t u = dasm_common16_get_u5(op); + uint8_t breg = common16_get_and_expand_breg(op); + uint8_t creg = common16_get_and_expand_creg(op); + uint32_t u = common16_get_u5(op); u <<= shift; @@ -343,37 +342,37 @@ int arcompact_disassembler::handle_ld_helper_dasm(std::ostream &stream, offs_t p } -int arcompact_disassembler::handle_dasm_LD_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LD_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "LD_S", 2, 0); } -int arcompact_disassembler::handle_dasm_LDB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "LDB_S", 0, 0); } -int arcompact_disassembler::handle_dasm_LDW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "LDW_S", 1, 0); } -int arcompact_disassembler::handle_dasm_LDW_S_X_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDW_S_X_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "LDW_S.X", 1, 0); } -int arcompact_disassembler::handle_dasm_ST_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ST_S_c_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "ST_S", 2, 1); } -int arcompact_disassembler::handle_dasm_STB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_STB_S_c_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "STB_S", 0, 1); } -int arcompact_disassembler::handle_dasm_STW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_STW_S_c_b_u6(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_ld_helper_dasm(stream, pc, op, opcodes, "STW_S", 1, 1); } @@ -381,48 +380,48 @@ int arcompact_disassembler::handle_dasm_STW_S_c_b_u6(std::ostream &stream, offs_ int arcompact_disassembler::handle_l7_0x_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint32_t u = dasm_common16_get_u5(op); + uint8_t breg = common16_get_and_expand_breg(op); + uint32_t u = common16_get_u5(op); util::stream_format(stream, "%s %s, 0x%02x", optext, regnames[breg], u); return 2; } -int arcompact_disassembler::handle_dasm_ASL_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASL_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "ASL_S"); } -int arcompact_disassembler::handle_dasm_LSR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LSR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "LSR_S"); } -int arcompact_disassembler::handle_dasm_ASR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ASR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "ASR_S"); } -int arcompact_disassembler::handle_dasm_SUB_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SUB_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "SUB_S"); } -int arcompact_disassembler::handle_dasm_BSET_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BSET_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "BSET_S"); } -int arcompact_disassembler::handle_dasm_BCLR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BCLR_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "BCLR_S"); } -int arcompact_disassembler::handle_dasm_BMSK_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BMSK_S_b_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "BSMK_S"); } -int arcompact_disassembler::handle_dasm_BTST_S_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BTST_S_b_u5(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle_l7_0x_helper_dasm(stream, pc, op, opcodes, "BTST_S"); } @@ -432,8 +431,8 @@ int arcompact_disassembler::handle_dasm_BTST_S_b_u5(std::ostream &stream, offs_t int arcompact_disassembler::handle18_0x_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext, int st, int format) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint32_t u = dasm_common16_get_u5(op); + uint8_t breg = common16_get_and_expand_breg(op); + uint32_t u = common16_get_u5(op); util::stream_format(stream, "%s %s ", optext, regnames[breg]); if (st == 1) util::stream_format(stream, "-> "); @@ -445,76 +444,74 @@ int arcompact_disassembler::handle18_0x_helper_dasm(std::ostream &stream, offs_t return 2; } -int arcompact_disassembler::handle_dasm_LD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle18_0x_helper_dasm(stream, pc, op, opcodes, "LD_S", 0,0); } -int arcompact_disassembler::handle_dasm_LDB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle18_0x_helper_dasm(stream, pc, op, opcodes, "LDB_S", 0,0); } -int arcompact_disassembler::handle_dasm_ST_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ST_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle18_0x_helper_dasm(stream, pc, op, opcodes, "ST_S", 1,0); } -int arcompact_disassembler::handle_dasm_STB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_STB_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle18_0x_helper_dasm(stream, pc, op, opcodes, "STB_S", 1,0); } -int arcompact_disassembler::handle_dasm_ADD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_b_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle18_0x_helper_dasm(stream, pc, op, opcodes, "ADD_S", 1,1); // check format } // op bits remaining for 0x18_05_xx subgroups 0x001f -int arcompact_disassembler::handle_dasm_ADD_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { int u; - u = dasm_common16_get_u5(op); + u = common16_get_u5(op); util::stream_format( stream, "ADD_S SP, SP, 0x%02x", u*4); return 2; } -int arcompact_disassembler::handle_dasm_SUB_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_SUB_S_sp_sp_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint32_t u = dasm_common16_get_u5(op); + uint32_t u = common16_get_u5(op); util::stream_format( stream, "SUB_S SP, SP, 0x%02x", u*4); return 2; } // op bits remaining for 0x18_06_xx subgroups 0x0700 -int arcompact_disassembler::handle_dasm_POP_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_POP_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - + uint8_t breg = common16_get_and_expand_breg(op); util::stream_format(stream, "POP_S %s", regnames[breg]); - return 2; } -int arcompact_disassembler::handle_dasm_POP_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_POP_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format(stream, "POP_S [BLINK]"); return 2; } // op bits remaining for 0x18_07_xx subgroups 0x0700 -int arcompact_disassembler::handle_dasm_PUSH_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_PUSH_S_b(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); + uint8_t breg = common16_get_and_expand_breg(op); util::stream_format(stream, "PUSH_S %s", regnames[breg]); return 2; } -int arcompact_disassembler::handle_dasm_PUSH_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_PUSH_S_blink(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { util::stream_format(stream, "PUSH_S [BLINK]"); return 2; @@ -523,7 +520,7 @@ int arcompact_disassembler::handle_dasm_PUSH_S_blink(std::ostream &stream, offs_ int arcompact_disassembler::handle19_0x_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext, int shift, int format) { - uint32_t s = dasm_common16_get_s9(op); + uint32_t s = common16_get_s9(op); s <<= shift; util::stream_format(stream, "%s %s, ", optext, regnames[0]); if (format == 0) @@ -537,66 +534,62 @@ int arcompact_disassembler::handle19_0x_helper_dasm(std::ostream &stream, offs_t return 2; } -int arcompact_disassembler::handle_dasm_LD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle19_0x_helper_dasm(stream, pc, op, opcodes, "LD_S", 2, 0); } -int arcompact_disassembler::handle_dasm_LDB_S_r0_gp_s9(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDB_S_r0_gp_s9(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle19_0x_helper_dasm(stream, pc, op, opcodes, "LDB_S", 0, 0); } -int arcompact_disassembler::handle_dasm_LDW_S_r0_gp_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LDW_S_r0_gp_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle19_0x_helper_dasm(stream, pc, op, opcodes, "LDW_S", 1, 0); } -int arcompact_disassembler::handle_dasm_ADD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_r0_gp_s11(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle19_0x_helper_dasm(stream, pc, op, opcodes, "ADD_S", 2, 1); } -int arcompact_disassembler::handle_dasm_LD_S_b_pcl_u10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_LD_S_b_pcl_u10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint32_t u = dasm_common16_get_u8(op); - + uint8_t breg = common16_get_and_expand_breg(op); + uint32_t u = common16_get_u8(op); util::stream_format(stream, "MOV_S %s, [PCL, 0x%03x]", regnames[breg], u*4); - return 2; } -int arcompact_disassembler::handle_dasm_MOV_S_b_u8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_MOV_S_b_u8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint32_t u = dasm_common16_get_u8(op); + uint8_t breg = common16_get_and_expand_breg(op); + uint32_t u = common16_get_u8(op); util::stream_format(stream, "MOV_S %s <- 0x%02x", regnames[breg], u); return 2; } -int arcompact_disassembler::handle_dasm_ADD_S_b_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_ADD_S_b_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint32_t u = dasm_common16_get_u7(op); - + uint8_t breg = common16_get_and_expand_breg(op); + uint32_t u = common16_get_u7(op); util::stream_format(stream, "ADD_S %s <- %s, 0x%02x", regnames[breg], regnames[breg], u); return 2; } -int arcompact_disassembler::handle_dasm_CMP_S_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_CMP_S_b_u7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); - uint32_t u = dasm_common16_get_u7(op); - + uint8_t breg = common16_get_and_expand_breg(op); + uint32_t u = common16_get_u7(op); util::stream_format(stream, "CMP_S %s, 0x%02x", regnames[breg], u); return 2; } int arcompact_disassembler::handle1d_helper_dasm(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes, const char* optext) { - uint8_t breg = expand_reg(dasm_common16_get_breg(op)); + uint8_t breg = common16_get_and_expand_breg(op); uint32_t s = op & 0x007f; s = util::sext(s, 7); @@ -605,12 +598,12 @@ int arcompact_disassembler::handle1d_helper_dasm(std::ostream &stream, offs_t pc return 2; } -int arcompact_disassembler::handle_dasm_BREQ_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BREQ_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1d_helper_dasm(stream, pc, op, opcodes,"BREQ_S"); } -int arcompact_disassembler::handle_dasm_BRNE_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BRNE_S_b_0_s8(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1d_helper_dasm(stream, pc, op, opcodes,"BRNE_S"); } @@ -624,17 +617,17 @@ int arcompact_disassembler::handle1e_0x_helper_dasm(std::ostream &stream, offs_t return 2; } -int arcompact_disassembler::handle_dasm_B_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_B_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_0x_helper_dasm(stream, pc, op, opcodes, "B_S"); } -int arcompact_disassembler::handle_dasm_BEQ_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BEQ_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_0x_helper_dasm(stream, pc, op, opcodes, "BEQ_S"); } -int arcompact_disassembler::handle_dasm_BNE_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BNE_S_s10(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_0x_helper_dasm(stream, pc, op, opcodes, "BNE_S"); } @@ -648,47 +641,47 @@ int arcompact_disassembler::handle1e_03_0x_helper_dasm(std::ostream &stream, off return 2; } -int arcompact_disassembler::handle_dasm_BGT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BGT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BGT_S"); } -int arcompact_disassembler::handle_dasm_BGE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BGE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BGE_S"); } -int arcompact_disassembler::handle_dasm_BLT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BLT_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BLT_S"); } -int arcompact_disassembler::handle_dasm_BLE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BLE_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BLE_S"); } -int arcompact_disassembler::handle_dasm_BHI_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BHI_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BHI_S"); } -int arcompact_disassembler::handle_dasm_BHS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BHS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BHS_S"); } -int arcompact_disassembler::handle_dasm_BLO_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BLO_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BLO_S"); } -int arcompact_disassembler::handle_dasm_BLS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BLS_S_s7(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { return handle1e_03_0x_helper_dasm(stream, pc, op, opcodes, "BLS_S"); } -int arcompact_disassembler::handle_dasm_BL_S_s13(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) +int arcompact_disassembler::handle::dasm_BL_S_s13(std::ostream &stream, offs_t pc, uint16_t op, const data_buffer &opcodes) { int s = op & 0x07ff; s = util::sext(s, 11); @@ -703,19 +696,19 @@ int arcompact_disassembler::handle_dasm_BL_S_s13(std::ostream &stream, offs_t pc * * ************************************************************************************************************************************/ -int arcompact_disassembler::handle_dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint16_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint16_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%04x)\n", param1, param2, op); return 2; } -int arcompact_disassembler::handle_dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint16_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint16_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%04x)\n", param1, param2, param3, op); return 2; } -int arcompact_disassembler::handle_dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint16_t op, const data_buffer& opcodes) +int arcompact_disassembler::handle::dasm_illegal(std::ostream& stream, offs_t pc, uint8_t param1, uint8_t param2, uint8_t param3, uint8_t param4, uint16_t op, const data_buffer& opcodes) { util::stream_format(stream, " (%04x)\n", param1, param2, param3, param4, op); return 2; -- cgit v1.2.3