summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/nios2/nios2dasm.h
blob: 4a081180e80bb7aa955342ae469df90a2f1f0eeb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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