From 3226026f2dca7eeda158bad2c16a483640e9c890 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 7 Mar 2024 18:17:38 +0100 Subject: misc hap disasm: move opcode mnemonics enum out of header file --- src/devices/cpu/amis2000/amis2000d.cpp | 21 +++++++++++++---- src/devices/cpu/amis2000/amis2000d.h | 13 ++-------- src/devices/cpu/cops1/cops1d.cpp | 12 ++++++++++ src/devices/cpu/cops1/cops1d.h | 14 +---------- src/devices/cpu/e0c6200/e0c6200d.cpp | 43 ++++++++++++++++++---------------- src/devices/cpu/e0c6200/e0c6200d.h | 28 +++++----------------- src/devices/cpu/hmcs40/hmcs40d.cpp | 16 +++++++++++++ src/devices/cpu/hmcs40/hmcs40d.h | 17 +------------- src/devices/cpu/melps4/melps4d.cpp | 33 ++++++++++++++------------ src/devices/cpu/melps4/melps4d.h | 23 ++++-------------- src/devices/cpu/mn1400/mn1400d.cpp | 20 ++++++++++++++++ src/devices/cpu/mn1400/mn1400d.h | 16 +------------ src/devices/cpu/pps41/pps41d.cpp | 19 +++++++++++++++ src/devices/cpu/pps41/pps41d.h | 21 +---------------- src/devices/cpu/rw5000/rw5000d.cpp | 12 ++++++++++ src/devices/cpu/rw5000/rw5000d.h | 14 +---------- src/devices/cpu/sm510/sm510d.cpp | 32 +++++++++++++++++++++++++ src/devices/cpu/sm510/sm510d.h | 33 +------------------------- src/devices/cpu/tms1000/tms1k_dasm.cpp | 16 +++++++++++++ src/devices/cpu/tms1000/tms1k_dasm.h | 17 +------------- src/devices/cpu/ucom4/ucom4d.cpp | 18 ++++++++++++++ src/devices/cpu/ucom4/ucom4d.h | 15 +----------- 22 files changed, 222 insertions(+), 231 deletions(-) diff --git a/src/devices/cpu/amis2000/amis2000d.cpp b/src/devices/cpu/amis2000/amis2000d.cpp index a9a3e5acb70..697f909607b 100644 --- a/src/devices/cpu/amis2000/amis2000d.cpp +++ b/src/devices/cpu/amis2000/amis2000d.cpp @@ -9,6 +9,19 @@ #include "emu.h" #include "amis2000d.h" + +// common lookup tables + +enum e_mnemonics : unsigned +{ + mLAB = 0, mLAE, mLAI, mLBE, mLBEP, mLBF, mLBZ, mXAB, mXABU, mXAE, + mLAM, mXC, mXCI, mXCD, mSTM, mRSM, + mADD, mADCS, mADIS, mAND, mXOR, mCMA, mSTC, mRSC, mSF1, mRF1, mSF2, mRF2, + mSAM, mSZM, mSBE, mSZC, mSOS, mSZK, mSZI, mTF1, mTF2, + mPP, mJMP, mJMS, mRT, mRTS, mNOP, mHALT, + mINP, mOUT, mDISB, mDISN, mMVS, mPSH, mPSL, mEUR +}; + const char *const amis2000_disassembler::s_mnemonics[] = { "LAB", "LAE", "LAI", "LBE", "LBEP", "LBF", "LBZ", "XAB", "XABU", "XAE", @@ -83,6 +96,9 @@ const u8 amis2000_disassembler::s2000_mnemonic[0x100] = mJMP, mJMP, mJMP, mJMP, mJMP, mJMP, mJMP, mJMP }; + +// disasm + offs_t amis2000_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { u8 op = opcodes.r8(pc); @@ -112,8 +128,3 @@ offs_t amis2000_disassembler::disassemble(std::ostream &stream, offs_t pc, const return 1 | s_flags[instr] | SUPPORTED; } - -u32 amis2000_disassembler::opcode_alignment() const -{ - return 1; -} diff --git a/src/devices/cpu/amis2000/amis2000d.h b/src/devices/cpu/amis2000/amis2000d.h index 0de1a455fa8..abc9a6dd6a6 100644 --- a/src/devices/cpu/amis2000/amis2000d.h +++ b/src/devices/cpu/amis2000/amis2000d.h @@ -17,20 +17,11 @@ public: amis2000_disassembler() = default; virtual ~amis2000_disassembler() = default; - virtual u32 opcode_alignment() const override; + virtual u32 opcode_alignment() const override { return 1; } virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - enum e_mnemonics - { - mLAB = 0, mLAE, mLAI, mLBE, mLBEP, mLBF, mLBZ, mXAB, mXABU, mXAE, - mLAM, mXC, mXCI, mXCD, mSTM, mRSM, - mADD, mADCS, mADIS, mAND, mXOR, mCMA, mSTC, mRSC, mSF1, mRF1, mSF2, mRF2, - mSAM, mSZM, mSBE, mSZC, mSOS, mSZK, mSZI, mTF1, mTF2, - mPP, mJMP, mJMS, mRT, mRTS, mNOP, mHALT, - mINP, mOUT, mDISB, mDISN, mMVS, mPSH, mPSL, mEUR - }; - + enum e_mnemonics : unsigned; static const char *const s_mnemonics[]; static const s8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/cops1/cops1d.cpp b/src/devices/cpu/cops1/cops1d.cpp index aa7622bd22f..ee7eb049504 100644 --- a/src/devices/cpu/cops1/cops1d.cpp +++ b/src/devices/cpu/cops1/cops1d.cpp @@ -32,6 +32,18 @@ offs_t cops1_common_disassembler::increment_pc(offs_t pc) // common lookup tables +enum e_mnemonics : unsigned +{ + mILL, + mAD, mADD, mSUB, mCOMP, m0TA, mADX, mHXA, mTAM, mSC, mRSC, mTC, + mTIN, mTF, mTKB, mTIR, + mBTD, mDSPA, mDSPS, mAXO, mLDF, mREAD, + mGO, mCALL, mRET, mRETS, mLG, mLGCALL, mNOP, + mEXC, mEXCM, mEXCP, mMTA, mLM, + mSM1, mSM2, mSM4, mSM8, mRSM1, mRSM2, mRSM4, mRSM8, mTM, + mLB, mLBL, mATB, mBTA, mHXBR +}; + const char *const cops1_common_disassembler::s_name[] = { "?", diff --git a/src/devices/cpu/cops1/cops1d.h b/src/devices/cpu/cops1/cops1d.h index ac48fb8853e..d7a98a9f638 100644 --- a/src/devices/cpu/cops1/cops1d.h +++ b/src/devices/cpu/cops1/cops1d.h @@ -25,19 +25,7 @@ public: virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; } protected: - // opcode mnemonics - enum e_mnemonics - { - mILL, - mAD, mADD, mSUB, mCOMP, m0TA, mADX, mHXA, mTAM, mSC, mRSC, mTC, - mTIN, mTF, mTKB, mTIR, - mBTD, mDSPA, mDSPS, mAXO, mLDF, mREAD, - mGO, mCALL, mRET, mRETS, mLG, mLGCALL, mNOP, - mEXC, mEXCM, mEXCP, mMTA, mLM, - mSM1, mSM2, mSM4, mSM8, mRSM1, mRSM2, mRSM4, mRSM8, mTM, - mLB, mLBL, mATB, mBTA, mHXBR - }; - + enum e_mnemonics : unsigned; static const char *const s_name[]; static const u8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/e0c6200/e0c6200d.cpp b/src/devices/cpu/e0c6200/e0c6200d.cpp index 22497b8839f..85505b96b43 100644 --- a/src/devices/cpu/e0c6200/e0c6200d.cpp +++ b/src/devices/cpu/e0c6200/e0c6200d.cpp @@ -9,6 +9,27 @@ #include "emu.h" #include "e0c6200d.h" + +// common lookup tables + +enum e_mnemonics : unsigned +{ + em_JP, em_RETD, em_CALL, em_CALZ, + em_LD, em_LBPX, em_ADC, em_CP, em_ADD, em_SUB, em_SBC, em_AND, em_OR, em_XOR, + em_RLC, em_FAN, em_PSET, em_LDPX, em_LDPY, em_SET, em_RST, em_INC, em_DEC, + em_RRC, em_ACPX, em_ACPY, em_SCPX, em_SCPY, em_PUSH, em_POP, + em_RETS, em_RET, em_JPBA, em_HALT, em_SLP, em_NOP5, em_NOP7, + em_NOT, em_SCF, em_SZF, em_SDF, em_EI, em_DI, em_RDF, em_RZF, em_RCF, em_ILL +}; + +enum e_params : unsigned +{ + ep_S, ep_E, ep_I, ep_R0, ep_R2, ep_R4, ep_Q, + ep_cC, ep_cNC, ep_cZ, ep_cNZ, + ep_A, ep_B, ep_X, ep_Y, ep_MX, ep_MY, ep_XP, ep_XH, ep_XL, ep_YP, ep_YH, ep_YL, + ep_P, ep_F, ep_MN, ep_SP, ep_SPH, ep_SPL +}; + const char *const e0c6200_disassembler::em_name[] = { "JP", "RETD", "CALL", "CALZ", @@ -53,6 +74,8 @@ const char *const e0c6200_disassembler::ep_name[] = }; +// disasm + std::string e0c6200_disassembler::decode_param(u16 opcode, int param) { int bits = ep_bits[param] & 0xf; @@ -671,23 +694,3 @@ offs_t e0c6200_disassembler::disassemble(std::ostream &stream, offs_t pc, const return 1 | ((op & 0xf00) == 0 ? 0 : em_flags[m]) | SUPPORTED; } - -u32 e0c6200_disassembler::opcode_alignment() const -{ - return 1; -} - -u32 e0c6200_disassembler::interface_flags() const -{ - return PAGED2LEVEL; -} - -u32 e0c6200_disassembler::page_address_bits() const -{ - return 8; -} - -u32 e0c6200_disassembler::page2_address_bits() const -{ - return 4; -} diff --git a/src/devices/cpu/e0c6200/e0c6200d.h b/src/devices/cpu/e0c6200/e0c6200d.h index d2555c4ead8..95ec78b4458 100644 --- a/src/devices/cpu/e0c6200/e0c6200d.h +++ b/src/devices/cpu/e0c6200/e0c6200d.h @@ -17,32 +17,16 @@ public: e0c6200_disassembler() = default; virtual ~e0c6200_disassembler() = default; - virtual u32 opcode_alignment() const override; - virtual u32 interface_flags() const override; - virtual u32 page_address_bits() const override; - virtual u32 page2_address_bits() const override; + virtual u32 opcode_alignment() const override { return 1; } + virtual u32 interface_flags() const override { return PAGED2LEVEL; } + virtual u32 page_address_bits() const override { return 8; } + virtual u32 page2_address_bits() const override { return 4; } virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - enum e_mnemonics - { - em_JP, em_RETD, em_CALL, em_CALZ, - em_LD, em_LBPX, em_ADC, em_CP, em_ADD, em_SUB, em_SBC, em_AND, em_OR, em_XOR, - em_RLC, em_FAN, em_PSET, em_LDPX, em_LDPY, em_SET, em_RST, em_INC, em_DEC, - em_RRC, em_ACPX, em_ACPY, em_SCPX, em_SCPY, em_PUSH, em_POP, - em_RETS, em_RET, em_JPBA, em_HALT, em_SLP, em_NOP5, em_NOP7, - em_NOT, em_SCF, em_SZF, em_SDF, em_EI, em_DI, em_RDF, em_RZF, em_RCF, em_ILL - }; - - enum e_params - { - ep_S, ep_E, ep_I, ep_R0, ep_R2, ep_R4, ep_Q, - ep_cC, ep_cNC, ep_cZ, ep_cNZ, - ep_A, ep_B, ep_X, ep_Y, ep_MX, ep_MY, ep_XP, ep_XH, ep_XL, ep_YP, ep_YH, ep_YL, - ep_P, ep_F, ep_MN, ep_SP, ep_SPH, ep_SPL - }; - + enum e_mnemonics : unsigned; + enum e_params : unsigned; static const char *const em_name[]; static const u32 em_flags[]; static const u16 ep_bits[]; diff --git a/src/devices/cpu/hmcs40/hmcs40d.cpp b/src/devices/cpu/hmcs40/hmcs40d.cpp index c0918df2977..87f270a10f0 100644 --- a/src/devices/cpu/hmcs40/hmcs40d.cpp +++ b/src/devices/cpu/hmcs40/hmcs40d.cpp @@ -38,6 +38,22 @@ hmcs40_disassembler::hmcs40_disassembler() // common lookup tables +enum e_mnemonics : unsigned +{ + mILL, + mLAB, mLBA, mLAY, mLASPX, mLASPY, mXAMR, + mLXA, mLYA, mLXI, mLYI, mIY, mDY, mAYY, mSYY, mXSP, + mLAM, mLBM, mXMA, mXMB, mLMAIY, mLMADY, + mLMIIY, mLAI, mLBI, + mAI, mIB, mDB, mAMC, mSMC, mAM, mDAA, mDAS, mNEGA, mCOMB, mSEC, mREC, mTC, mROTL, mROTR, mOR, + mMNEI, mYNEI, mANEM, mBNEM, mALEI, mALEM, mBLEM, + mSEM, mREM, mTM, + mBR, mCAL, mLPU, mTBR, mRTN, + mSEIE, mSEIF0, mSEIF1, mSETF, mSECF, mREIE, mREIF0, mREIF1, mRETF, mRECF, mTI0, mTI1, mTIF0, mTIF1, mTTF, mLTI, mLTA, mLAT, mRTNI, + mSED, mRED, mTD, mSEDD, mREDD, mLAR, mLBR, mLRA, mLRB, mP, + mNOP +}; + const char *const hmcs40_disassembler::s_mnemonics[] = { "?", diff --git a/src/devices/cpu/hmcs40/hmcs40d.h b/src/devices/cpu/hmcs40/hmcs40d.h index fdd00fd32f1..e67d5ab0c18 100644 --- a/src/devices/cpu/hmcs40/hmcs40d.h +++ b/src/devices/cpu/hmcs40/hmcs40d.h @@ -25,22 +25,7 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - enum e_mnemonics - { - mILL, - mLAB, mLBA, mLAY, mLASPX, mLASPY, mXAMR, - mLXA, mLYA, mLXI, mLYI, mIY, mDY, mAYY, mSYY, mXSP, - mLAM, mLBM, mXMA, mXMB, mLMAIY, mLMADY, - mLMIIY, mLAI, mLBI, - mAI, mIB, mDB, mAMC, mSMC, mAM, mDAA, mDAS, mNEGA, mCOMB, mSEC, mREC, mTC, mROTL, mROTR, mOR, - mMNEI, mYNEI, mANEM, mBNEM, mALEI, mALEM, mBLEM, - mSEM, mREM, mTM, - mBR, mCAL, mLPU, mTBR, mRTN, - mSEIE, mSEIF0, mSEIF1, mSETF, mSECF, mREIE, mREIF0, mREIF1, mRETF, mRECF, mTI0, mTI1, mTIF0, mTIF1, mTTF, mLTI, mLTA, mLAT, mRTNI, - mSED, mRED, mTD, mSEDD, mREDD, mLAR, mLBR, mLRA, mLRB, mP, - mNOP - }; - + enum e_mnemonics : unsigned; static const char *const s_mnemonics[]; static const s8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/melps4/melps4d.cpp b/src/devices/cpu/melps4/melps4d.cpp index 5c40642bd6c..cb677ed3a41 100644 --- a/src/devices/cpu/melps4/melps4d.cpp +++ b/src/devices/cpu/melps4/melps4d.cpp @@ -12,6 +12,24 @@ #include "emu.h" #include "melps4d.h" + +// common lookup tables + +enum e_mnemonics : unsigned +{ + mILL, + mTAB, mTBA, mTAY, mTYA, mTEAB, mTABE, mTEPA, mTXA, mTAX, + mLXY, mLZ, mINY, mDEY, mLCPS, mSADR, + mTAM, mXAM, mXAMD, mXAMI, + mLA, mAM, mAMC, mAMCS, mA, mSC, mRC, mSZC, mCMA, mRL, mRR, + mSB, mRB, mSZB, mSEAM, mSEY, + mTLA, mTHA, mTAJ, mXAL, mXAH, mLC7, mDEC, mSHL, mRHL, mCPA, mCPAS, mCPAE, mSZJ, + mT1AB, mTRAB, mT2AB, mTAB1, mTABR, mTAB2, mTVA, mTWA, mSNZ1, mSNZ2, + mBA, mSP, mB, mBM, mRT, mRTS, mRTI, + mCLD, mCLS, mCLDS, mSD, mRD, mSZD, mOSAB, mOSPA, mOSE, mIAS, mOFA, mIAF, mOGA, mIAK, mSZK, mSU, mRU, + mEI, mDI, mINTH, mINTL, mNOP +}; + const char *const melps4_disassembler::s_name[] = { "?", @@ -124,18 +142,3 @@ offs_t melps4_disassembler::disassemble(std::ostream &stream, offs_t pc, const d return 1 | flags | SUPPORTED; } - -u32 melps4_disassembler::opcode_alignment() const -{ - return 1; -} - -u32 melps4_disassembler::interface_flags() const -{ - return PAGED; -} - -u32 melps4_disassembler::page_address_bits() const -{ - return 7; -} diff --git a/src/devices/cpu/melps4/melps4d.h b/src/devices/cpu/melps4/melps4d.h index b03a506a60e..48155c38af8 100644 --- a/src/devices/cpu/melps4/melps4d.h +++ b/src/devices/cpu/melps4/melps4d.h @@ -17,28 +17,13 @@ public: melps4_disassembler() = default; virtual ~melps4_disassembler() = default; - virtual u32 opcode_alignment() const override; - virtual u32 interface_flags() const override; - virtual u32 page_address_bits() const override; + virtual u32 opcode_alignment() const override { return 1; } + virtual u32 interface_flags() const override { return PAGED; } + virtual u32 page_address_bits() const override { return 7; } virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - // opcode mnemonics - enum e_mnemonics - { - mILL, - mTAB, mTBA, mTAY, mTYA, mTEAB, mTABE, mTEPA, mTXA, mTAX, - mLXY, mLZ, mINY, mDEY, mLCPS, mSADR, - mTAM, mXAM, mXAMD, mXAMI, - mLA, mAM, mAMC, mAMCS, mA, mSC, mRC, mSZC, mCMA, mRL, mRR, - mSB, mRB, mSZB, mSEAM, mSEY, - mTLA, mTHA, mTAJ, mXAL, mXAH, mLC7, mDEC, mSHL, mRHL, mCPA, mCPAS, mCPAE, mSZJ, - mT1AB, mTRAB, mT2AB, mTAB1, mTABR, mTAB2, mTVA, mTWA, mSNZ1, mSNZ2, - mBA, mSP, mB, mBM, mRT, mRTS, mRTI, - mCLD, mCLS, mCLDS, mSD, mRD, mSZD, mOSAB, mOSPA, mOSE, mIAS, mOFA, mIAF, mOGA, mIAK, mSZK, mSU, mRU, - mEI, mDI, mINTH, mINTL, mNOP - }; - + enum e_mnemonics : unsigned; static const char *const s_name[]; static const u8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/mn1400/mn1400d.cpp b/src/devices/cpu/mn1400/mn1400d.cpp index 04410d4e30b..7860845b3fb 100644 --- a/src/devices/cpu/mn1400/mn1400d.cpp +++ b/src/devices/cpu/mn1400/mn1400d.cpp @@ -9,6 +9,24 @@ #include "emu.h" #include "mn1400d.h" + +// common lookup tables + +enum e_mnemonics : unsigned +{ + mILL, mILL2, + mL, mLD, mLI, mLIC, mLDC, mST, mSTD, mSTIC, mSTDC, + mLX, mLY, mTAX, mTAY, mTYA, mTACU, mTACL, mTCAU, mTCAL, + mNOP, mAND, mANDI, mOR, mXOR, mA, mAI, mCPL, mC, mCI, mCY, + mSL, mICY, mDCY, mICM, mDCM, mSM, mRM, mTB, + mINA, mINB, mOTD, mOTMD, mOTE, mOTIE, mRCO, mSCO, mCCO, + mRC, mRP, mSC, mSP, + mBS0, mBS1, mBS01, mBSN0, mBSN1, mBSN01, + mBP, mBC, mBZ, mBPC, mBPZ, mBCZ, mBPCZ, + mBNP, mBNC, mBNZ, mBNPC, mBNPZ, mBNCZ, mBNPCZ, + mJMP, mCAL, mRET, mEC, mDC +}; + const char *const mn1400_disassembler::s_mnemonics[] = { "?", "?", @@ -81,6 +99,8 @@ const u8 mn1400_disassembler::mn1400_mnemonic[0x100] = }; +// disasm + offs_t mn1400_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { offs_t pos = pc; diff --git a/src/devices/cpu/mn1400/mn1400d.h b/src/devices/cpu/mn1400/mn1400d.h index 7d3b0af1d28..a51d9445b1b 100644 --- a/src/devices/cpu/mn1400/mn1400d.h +++ b/src/devices/cpu/mn1400/mn1400d.h @@ -23,21 +23,7 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - enum e_mnemonics - { - mILL, mILL2, - mL, mLD, mLI, mLIC, mLDC, mST, mSTD, mSTIC, mSTDC, - mLX, mLY, mTAX, mTAY, mTYA, mTACU, mTACL, mTCAU, mTCAL, - mNOP, mAND, mANDI, mOR, mXOR, mA, mAI, mCPL, mC, mCI, mCY, - mSL, mICY, mDCY, mICM, mDCM, mSM, mRM, mTB, - mINA, mINB, mOTD, mOTMD, mOTE, mOTIE, mRCO, mSCO, mCCO, - mRC, mRP, mSC, mSP, - mBS0, mBS1, mBS01, mBSN0, mBSN1, mBSN01, - mBP, mBC, mBZ, mBPC, mBPZ, mBCZ, mBPCZ, - mBNP, mBNC, mBNZ, mBNPC, mBNPZ, mBNCZ, mBNPCZ, - mJMP, mCAL, mRET, mEC, mDC - }; - + enum e_mnemonics : unsigned; static const char *const s_mnemonics[]; static const u8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/pps41/pps41d.cpp b/src/devices/cpu/pps41/pps41d.cpp index a4b91dd95cc..080c14769e0 100644 --- a/src/devices/cpu/pps41/pps41d.cpp +++ b/src/devices/cpu/pps41/pps41d.cpp @@ -32,6 +32,25 @@ offs_t pps41_common_disassembler::increment_pc(offs_t pc) // common lookup tables +enum e_mnemonics : unsigned +{ + // MM76/shared + mILL /* 0! */, + mXAB, mLBA, mLB, mEOB2, + mSB, mRB, mSKBF, + mXAS, mLSA, + mL, mX, mXDSK, mXNSK, + mA, mAC, mACSK, mASK, mCOM, mRC, mSC, mSKNC, mLAI, mAISK, + mRT, mRTSK, mT, mNOP, mTL, mTM, mTML, mTR, + mSKMEA, mSKBEI, mSKAEI, + mSOS, mROS, mSKISL, mIBM, mOB, mIAM, mOA, mIOS, mI1, mI2C, mINT1H, mDIN1, mINT0L, mDIN0, mSEG1, mSEG2, + + // MM78 differences + mINT0H, mINT1L, mSAG, mEOB3, mTAB, + mI1SK, mIX, mOX, mLXA, mXAX, mIOA, + mTLB, mTMLB +}; + const char *const pps41_common_disassembler::s_name[] = { // MM76 diff --git a/src/devices/cpu/pps41/pps41d.h b/src/devices/cpu/pps41/pps41d.h index 8075ef1f09b..5d61b5ebf7b 100644 --- a/src/devices/cpu/pps41/pps41d.h +++ b/src/devices/cpu/pps41/pps41d.h @@ -25,26 +25,7 @@ public: virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; } protected: - // opcode mnemonics - enum e_mnemonics - { - // MM76/shared - mILL /* 0! */, - mXAB, mLBA, mLB, mEOB2, - mSB, mRB, mSKBF, - mXAS, mLSA, - mL, mX, mXDSK, mXNSK, - mA, mAC, mACSK, mASK, mCOM, mRC, mSC, mSKNC, mLAI, mAISK, - mRT, mRTSK, mT, mNOP, mTL, mTM, mTML, mTR, - mSKMEA, mSKBEI, mSKAEI, - mSOS, mROS, mSKISL, mIBM, mOB, mIAM, mOA, mIOS, mI1, mI2C, mINT1H, mDIN1, mINT0L, mDIN0, mSEG1, mSEG2, - - // MM78 differences - mINT0H, mINT1L, mSAG, mEOB3, mTAB, - mI1SK, mIX, mOX, mLXA, mXAX, mIOA, - mTLB, mTMLB - }; - + enum e_mnemonics : unsigned; static const char *const s_name[]; static const u8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/rw5000/rw5000d.cpp b/src/devices/cpu/rw5000/rw5000d.cpp index ab980f9c5d3..e0ca8bc5e56 100644 --- a/src/devices/cpu/rw5000/rw5000d.cpp +++ b/src/devices/cpu/rw5000/rw5000d.cpp @@ -32,6 +32,18 @@ offs_t rw5000_common_disassembler::increment_pc(offs_t pc) // common lookup tables +enum e_mnemonics : unsigned +{ + mILL, + mNOP, mRSC, mSC, mTC, mTAM, + mLAX, mADX, mCOMP, mATB, mATBZ, + mLDA, mEXC0, mEXCP, mEXCM, mADD, + mLB0, mLB7, mLB8, mLB9, mLB10, mLB11, + mRSM, mSM, mTM, + mTL, mTRA0, mTRA1, mRET, + mTKB, mTKBS, mTDIN, mREAD, mKSEG, mMTD +}; + const char *const rw5000_common_disassembler::s_name[] = { "?", diff --git a/src/devices/cpu/rw5000/rw5000d.h b/src/devices/cpu/rw5000/rw5000d.h index 87e6cb3dca4..ba812f7d31f 100644 --- a/src/devices/cpu/rw5000/rw5000d.h +++ b/src/devices/cpu/rw5000/rw5000d.h @@ -25,19 +25,7 @@ public: virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l[pc & 0x3f]; } protected: - // opcode mnemonics - enum e_mnemonics - { - mILL, - mNOP, mRSC, mSC, mTC, mTAM, - mLAX, mADX, mCOMP, mATB, mATBZ, - mLDA, mEXC0, mEXCP, mEXCM, mADD, - mLB0, mLB7, mLB8, mLB9, mLB10, mLB11, - mRSM, mSM, mTM, - mTL, mTRA0, mTRA1, mRET, - mTKB, mTKBS, mTDIN, mREAD, mKSEG, mMTD - }; - + enum e_mnemonics : unsigned; static const char *const s_name[]; static const u8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/sm510/sm510d.cpp b/src/devices/cpu/sm510/sm510d.cpp index c02ddaed8fe..c8e484073ca 100644 --- a/src/devices/cpu/sm510/sm510d.cpp +++ b/src/devices/cpu/sm510/sm510d.cpp @@ -46,6 +46,38 @@ offs_t sm510_common_disassembler::increment_pc(offs_t pc, u8 pclen) // common lookup tables +enum e_mnemonics : unsigned +{ + // SM510 common + mILL /* 0! */, mEXT, + mLB, mLBL, mSBM, mEXBLA, mINCB, mDECB, + mATPL, mRTN0, mRTN1, mTL, mTML, mTM, mT, + mEXC, mBDC, mEXCI, mEXCD, mLDA, mLAX, mPTW, mWR, mWS, + mKTA, mATBP, mATX, mATL, mATFC, mATR, + mADD, mADD11, mADX, mCOMA, mROT, mRC, mSC, + mTB, mTC, mTAM, mTMI, mTA0, mTABL, mTIS, mTAL, mTF1, mTF4, + mRM, mSM, + mPRE, mSME, mRME, mTMEL, + mSKIP, mCEND, mIDIV, mDR, mDTA, mCLKLO, mCLKHI, + + // SM500 common + mCOMCB, mRTN, mRTNS, mSSR, mTR, mTRS, mRBM, + mADDC, mPDTW, mTW, mDTW, + mATS, mEXKSA, mEXKFA, + mRMF, mSMF, mCOMCN, + mTA, mTM2, mTG, + + // SM530 common + mSABM, mSABL, mEXBL, + mTG2, mTBA, + mKETA, mATF, mSDS, mRDS, + mINIS, + + // SM590 common + mTAX, mLBLX, mMTR, mSTR, mINBM, mDEBM, mRTA, mBLTA, mEXAX, mTBA2, mADS, mADC, mLBMX, mTLS, + mNOP, mCCTRL, mINBL, mDEBL, mXBLA, mADCS, mTR7 // aliases +}; + const char *const sm510_common_disassembler::s_mnemonics[] = { // SM510 diff --git a/src/devices/cpu/sm510/sm510d.h b/src/devices/cpu/sm510/sm510d.h index 59257b73173..dacc7ca4264 100644 --- a/src/devices/cpu/sm510/sm510d.h +++ b/src/devices/cpu/sm510/sm510d.h @@ -25,38 +25,7 @@ public: virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x3f) | m_r2l6[pc & 0x3f]; } protected: - enum e_mnemonics - { - // SM510 common - mILL /* 0! */, mEXT, - mLB, mLBL, mSBM, mEXBLA, mINCB, mDECB, - mATPL, mRTN0, mRTN1, mTL, mTML, mTM, mT, - mEXC, mBDC, mEXCI, mEXCD, mLDA, mLAX, mPTW, mWR, mWS, - mKTA, mATBP, mATX, mATL, mATFC, mATR, - mADD, mADD11, mADX, mCOMA, mROT, mRC, mSC, - mTB, mTC, mTAM, mTMI, mTA0, mTABL, mTIS, mTAL, mTF1, mTF4, - mRM, mSM, - mPRE, mSME, mRME, mTMEL, - mSKIP, mCEND, mIDIV, mDR, mDTA, mCLKLO, mCLKHI, - - // SM500 common - mCOMCB, mRTN, mRTNS, mSSR, mTR, mTRS, mRBM, - mADDC, mPDTW, mTW, mDTW, - mATS, mEXKSA, mEXKFA, - mRMF, mSMF, mCOMCN, - mTA, mTM2, mTG, - - // SM530 common - mSABM, mSABL, mEXBL, - mTG2, mTBA, - mKETA, mATF, mSDS, mRDS, - mINIS, - - // SM590 common - mTAX, mLBLX, mMTR, mSTR, mINBM, mDEBM, mRTA, mBLTA, mEXAX, mTBA2, mADS, mADC, mLBMX, mTLS, - mNOP, mCCTRL, mINBL, mDEBL, mXBLA, mADCS, mTR7 // aliases - }; - + enum e_mnemonics : unsigned; static const char *const s_mnemonics[]; static const u8 s_bits[]; static const u32 s_flags[]; diff --git a/src/devices/cpu/tms1000/tms1k_dasm.cpp b/src/devices/cpu/tms1000/tms1k_dasm.cpp index 3aeb2d2bac9..b80afb1483f 100644 --- a/src/devices/cpu/tms1000/tms1k_dasm.cpp +++ b/src/devices/cpu/tms1000/tms1k_dasm.cpp @@ -84,6 +84,22 @@ offs_t tms1000_base_disassembler::pc_real_to_linear(offs_t pc) const // common lookup tables +enum e_mnemonics : unsigned +{ + mILL = 0, + mAC0AC, mAC1AC, mACACC, mACNAA, mALEC, mALEM, mAMAAC, mBRANCH, + mCALL, mCCLA, mCLA, mCLO, mCOMC, mCOMX, mCOMX8, mCPAIZ, mCTMDYN, + mDAN, mDMAN, mDMEA, mDNAA, mDYN, mHALT, + mIA, mIMAC, mINTDIS, mINTEN, mINTRTN, mIYC, + mKNEZ, mLDP, mLDX2, mLDX3, mLDX4, mMNEA, mMNEZ, + mNDMEA, mOFF, mRBIT, mREAC, mRETN, mRSTR, + mSAL, mSAMAN, mSBIT, mSBL, mSEAC, mSELIN, mSETR, + mTAC, mTADM, mTAM, mTAMACS, mTAMDYN, mTAMIY, mTAMIYC, mTAMZA, + mTASR, mTAX, mTAY, mTBIT, mTCA, mTCMIY, mTCY, mTDO, mTKA, + mTKM, mTMA, mTMSET, mTMY, mTPC, mTRA, mTSG, mTXA, mTYA, + mXDA, mXMA, mYMCY, mYNEA, mYNEC +}; + const char *const tms1000_base_disassembler::s_mnemonic[] = { "?", diff --git a/src/devices/cpu/tms1000/tms1k_dasm.h b/src/devices/cpu/tms1000/tms1k_dasm.h index f2aa2aa8f96..da2ab18b488 100644 --- a/src/devices/cpu/tms1000/tms1k_dasm.h +++ b/src/devices/cpu/tms1000/tms1k_dasm.h @@ -25,22 +25,7 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; protected: - enum e_mnemonics - { - mILL = 0, - mAC0AC, mAC1AC, mACACC, mACNAA, mALEC, mALEM, mAMAAC, mBRANCH, - mCALL, mCCLA, mCLA, mCLO, mCOMC, mCOMX, mCOMX8, mCPAIZ, mCTMDYN, - mDAN, mDMAN, mDMEA, mDNAA, mDYN, mHALT, - mIA, mIMAC, mINTDIS, mINTEN, mINTRTN, mIYC, - mKNEZ, mLDP, mLDX2, mLDX3, mLDX4, mMNEA, mMNEZ, - mNDMEA, mOFF, mRBIT, mREAC, mRETN, mRSTR, - mSAL, mSAMAN, mSBIT, mSBL, mSEAC, mSELIN, mSETR, - mTAC, mTADM, mTAM, mTAMACS, mTAMDYN, mTAMIY, mTAMIYC, mTAMZA, - mTASR, mTAX, mTAY, mTBIT, mTCA, mTCMIY, mTCY, mTDO, mTKA, - mTKM, mTMA, mTMSET, mTMY, mTPC, mTRA, mTSG, mTXA, mTYA, - mXDA, mXMA, mYMCY, mYNEA, mYNEC - }; - + enum e_mnemonics : unsigned; static const char *const s_mnemonic[]; static const u32 s_flags[]; static const u8 s_bits[]; diff --git a/src/devices/cpu/ucom4/ucom4d.cpp b/src/devices/cpu/ucom4/ucom4d.cpp index 17505de32df..7609340b60b 100644 --- a/src/devices/cpu/ucom4/ucom4d.cpp +++ b/src/devices/cpu/ucom4/ucom4d.cpp @@ -9,6 +9,22 @@ #include "emu.h" #include "ucom4d.h" + +// common lookup tables + +enum e_mnemonics : unsigned +{ + mILL, + mLI, mL, mLM, mLDI, mLDZ, mS, mTAL, mTLA, + mX, mXI, mXD, mXM, mXMI, mXMD, mAD, mADC, mADS, mDAA, mDAS, + mEXL, mCLA, mCMA, mCIA, mCLC, mSTC, mTC, mINC, mDEC, mIND, mDED, + mRMB, mSMB, mREB, mSEB, mRPB, mSPB, mJMP, mJCP, mJPA, mCAL, mCZP, mRT, mRTS, + mCI, mCM, mCMB, mTAB, mCLI, mTMB, mTPA, mTPB, + mTIT, mIA, mIP, mOE, mOP, mOCD, mNOP, + mTAW, mTAZ, mTHX, mTLY, mXAW, mXAZ, mXHR, mXHX, mXLS, mXLY, mXC, + mSFB, mRFB, mFBT, mFBF, mRAR, mINM, mDEM, mSTM, mTTM, mEI, mDI +}; + const char *const ucom4_disassembler::s_mnemonics[] = { "?", @@ -75,6 +91,8 @@ const u8 ucom4_disassembler::ucom4_mnemonic[0x100] = }; +// disasm + offs_t ucom4_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { offs_t pos = pc; diff --git a/src/devices/cpu/ucom4/ucom4d.h b/src/devices/cpu/ucom4/ucom4d.h index 73fe1155b69..fc0263f8497 100644 --- a/src/devices/cpu/ucom4/ucom4d.h +++ b/src/devices/cpu/ucom4/ucom4d.h @@ -6,7 +6,6 @@ */ - #ifndef MAME_CPU_UCOM4_UCOM4D_H #define MAME_CPU_UCOM4_UCOM4D_H @@ -25,19 +24,7 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - enum e_mnemonics - { - mILL, - mLI, mL, mLM, mLDI, mLDZ, mS, mTAL, mTLA, - mX, mXI, mXD, mXM, mXMI, mXMD, mAD, mADC, mADS, mDAA, mDAS, - mEXL, mCLA, mCMA, mCIA, mCLC, mSTC, mTC, mINC, mDEC, mIND, mDED, - mRMB, mSMB, mREB, mSEB, mRPB, mSPB, mJMP, mJCP, mJPA, mCAL, mCZP, mRT, mRTS, - mCI, mCM, mCMB, mTAB, mCLI, mTMB, mTPA, mTPB, - mTIT, mIA, mIP, mOE, mOP, mOCD, mNOP, - mTAW, mTAZ, mTHX, mTLY, mXAW, mXAZ, mXHR, mXHX, mXLS, mXLY, mXC, - mSFB, mRFB, mFBT, mFBF, mRAR, mINM, mDEM, mSTM, mTTM, mEI, mDI - }; - + enum e_mnemonics : unsigned; static const char *const s_mnemonics[]; static const u8 s_bits[]; static const u32 s_flags[]; -- cgit v1.2.3