summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/nios2/nios2dasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/nios2/nios2dasm.h')
-rw-r--r--src/devices/cpu/nios2/nios2dasm.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/devices/cpu/nios2/nios2dasm.h b/src/devices/cpu/nios2/nios2dasm.h
new file mode 100644
index 00000000000..4a081180e80
--- /dev/null
+++ b/src/devices/cpu/nios2/nios2dasm.h
@@ -0,0 +1,29 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+
+#ifndef MAME_CPU_NIOS2_NIOS2DASM_H
+#define MAME_CPU_NIOS2_NIOS2DASM_H
+
+#pragma once
+
+class nios2_disassembler : public util::disasm_interface
+{
+public:
+ // construction/destruction
+ nios2_disassembler();
+
+protected:
+ // util::disasm_interface overrides
+ virtual u32 opcode_alignment() const override;
+ virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
+
+private:
+ // disassembly helpers
+ offs_t dasm_rtype(std::ostream &stream, u32 inst) const;
+
+ // formatting helpers
+ void format_simm16(std::ostream &stream, u16 imm16) const;
+ void format_ctlreg(std::ostream &stream, u8 n) const;
+};
+
+#endif // MAME_CPU_NIOS2_NIOS2DASM_H