diff options
Diffstat (limited to 'src/devices/cpu/spc700/spc700ds.h')
-rw-r--r-- | src/devices/cpu/spc700/spc700ds.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/devices/cpu/spc700/spc700ds.h b/src/devices/cpu/spc700/spc700ds.h index e2135526363..fdd7bbeba7b 100644 --- a/src/devices/cpu/spc700/spc700ds.h +++ b/src/devices/cpu/spc700/spc700ds.h @@ -17,8 +17,49 @@ All rights reserved. */ +class spc700_disassembler : public util::disasm_interface +{ +public: + spc700_disassembler() = default; + virtual ~spc700_disassembler() = default; -CPU_DISASSEMBLE( spc700 ); + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + struct spc700_opcode_struct + { + unsigned char name; + unsigned char args[2]; + }; + + enum + { + IMP , A , X , Y , YA , SP , PSW , C , REL , UPAG, IMM , XI , + XII , YI , DP , DPX , DPY , DPI , DXI , DIY , ABS , ABX , ABY , AXI , N0 , + N1 , N2 , N3 , N4 , N5 , N6 , N7 , N8 , N9 , N10 , N11 , N12 , + N13 , N14 , N15 , DP0 , DP1 , DP2 , DP3 , DP4 , DP5 , DP6 , DP7 , MEMN, + MEMI + }; + + enum + { + ADC , ADDW , AND , AND1 , ASL , BBC , BBS , BCC , + BCS , BEQ , BMI , BNE , BPL , BRA , BRK , BVC , + BVS , CALL , CBNE , CLR1 , CLRC , CLRP , CLRV , CMP , + CMPW , DAA , DAS , DBNZ , DEC , DECW , DI , DIV , + EI , EOR , EOR1 , INC , INCW , JMP , LSR , MOV , + MOV1 , MOVW , MUL , NOP , NOT1 , NOTQ , NOTC , OR , + OR1 , PCALL , POP , PUSH , RET , RETI , ROL , ROR , + SBC , SET1 , SETC , SETP , SLEEP , STOP , SUBW , TCALL , + TCLR1 , TSET1 , XCN + }; + + static const char *const g_opnames[]; + static const spc700_opcode_struct g_opcodes[256]; + static inline unsigned int read_8_immediate(offs_t &pc, const data_buffer &opcodes); + static inline unsigned int read_16_immediate(offs_t &pc, const data_buffer &opcodes); +}; #endif /* __SPC700DS_H__ */ |