mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
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.
This commit is contained in:
parent
7bf6964388
commit
7bf3044c32
@ -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")
|
||||
|
@ -19,7 +19,8 @@
|
||||
\*********************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
#include "arcompactdasm.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
|
||||
|
109
src/devices/cpu/arcompact/arcompact_common.h
Normal file
109
src/devices/cpu/arcompact/arcompact_common.h
Normal file
@ -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
|
@ -2,8 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompactdasm.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
/*
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I
|
||||
|
@ -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
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I$$$ SS SSSS $$$ ss ssss
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I SS SSSS ss ssss
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I SS SSSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I SS SSSS
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I SS SSSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// IIII I SS SSSS
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I S S
|
||||
|
@ -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
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I S S
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I$$$ sssS SSSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I sssS SSSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I S SSSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I SSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I SSS
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII ISS
|
||||
|
@ -2,8 +2,7 @@
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#include "emu.h"
|
||||
#include "arcompact.h"
|
||||
#include "arcompactdasm.h"
|
||||
#include "arcompact_helper.ipp"
|
||||
|
||||
// #######################################################################################################################
|
||||
// IIII I
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
251
src/devices/cpu/arcompact/arcompactdasm_internal.h
Normal file
251
src/devices/cpu/arcompact/arcompactdasm_internal.h
Normal file
@ -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
|
@ -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, "<illegal 0x%02x_%02x> (%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, "<illegal 0x%02x_%02x_%02x> (%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, "<illegal 0x%02x_%02x_%02x_%02x> (%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, "<reserved 0x%02x_%02x_%02x_%02x> (%08x)\n", param1, param2, param3, param4, op);
|
||||
return 4;
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -6,11 +6,10 @@
|
||||
\*********************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "arcompactdasm.h"
|
||||
#include "arcompactdasm_internal.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)
|
||||
{
|
||||
|
@ -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, ".<F set, illegal>");
|
||||
@ -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, ".<F set, illegal>");
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 <no dst>, %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, "<illegal 0x%02x_%02x> (%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, "<illegal 0x%02x_%02x_%02x> (%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, "<illegal 0x%02x_%02x_%02x_%02x> (%04x)\n", param1, param2, param3, param4, op);
|
||||
return 2;
|
||||
|
Loading…
Reference in New Issue
Block a user