1 // license:BSD-3-Clause
2 // copyright-holders:Aaron Giles
3 /***************************************************************************
4 
5     dis32031.h
6     Disassembler for the portable TMS320C3x emulator.
7     Written by Aaron Giles
8 
9 ***************************************************************************/
10 
11 #ifndef MAME_CPU_TMS32031_DIS32031_H
12 #define MAME_CPU_TMS32031_DIS32031_H
13 
14 #pragma once
15 
16 class tms32031_disassembler : public util::disasm_interface
17 {
18 public:
19 	tms32031_disassembler() = default;
20 	virtual ~tms32031_disassembler() = default;
21 
22 	virtual u32 opcode_alignment() const override;
23 	virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
24 
25 private:
26 	enum {
27 		INTEGER         = 0,
28 		FLOAT           = 1,
29 		NODEST          = 2,
30 		NOSOURCE        = 4,
31 		NOSOURCE1       = NOSOURCE,
32 		NOSOURCE2       = 8,
33 		SWAPSRCDST      = 16,
34 		UNSIGNED        = 32
35 	};
36 
37 	static const char *const regname[32];
38 	static const char *const condition[32];
39 	void append_indirect(uint8_t ma, int8_t disp, std::ostream &stream);
40 	std::string get_indirect(uint8_t ma, int8_t disp);
41 	void append_immediate(uint16_t data, int is_float, int is_unsigned, std::ostream &stream);
42 	void disasm_general(const char *opstring, uint32_t op, int flags, std::ostream &stream);
43 	void disasm_3op(const char *opstring, uint32_t op, int flags, std::ostream &stream);
44 	void disasm_conditional(const char *opstring, uint32_t op, int flags, std::ostream &stream);
45 	void disasm_parallel_3op3op(const char *opstring1, const char *opstring2, uint32_t op, int flags, const uint8_t *srctable, std::ostream &stream);
46 	void disasm_parallel_3opstore(const char *opstring1, const char *opstring2, uint32_t op, int flags, std::ostream &stream);
47 	void disasm_parallel_loadload(const char *opstring1, const char *opstring2, uint32_t op, int flags, std::ostream &stream);
48 	void disasm_parallel_storestore(const char *opstring1, const char *opstring2, uint32_t op, int flags, std::ostream &stream);
49 };
50 
51 #endif
52