summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/mcs51/axc51-core_dasm.h
blob: 0e9bd5c3ed26c878fc1dbef60f49c87fb5066d18 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// license:BSD-3-Clause
// copyright-holders:David Haywood
/*****************************************************************************

    AXC51-CORE (AppoTech Inc.)

    used in

    AX208 SoC

 *****************************************************************************/

#ifndef MAME_CPU_MCS51_AXC51_CORE_DASM_H
#define MAME_CPU_MCS51_AXC51_CORE_DASM_H

#pragma once

#include "mcs51dasm.h"

class axc51core_disassembler : public mcs51_disassembler
{
public:
	axc51core_disassembler();

	axc51core_disassembler(const mem_info* names) : mcs51_disassembler(names) {};

	virtual ~axc51core_disassembler() = default;

	static const mem_info axc51core_names[];

protected:
	virtual offs_t disassemble_op(std::ostream &stream, unsigned PC, offs_t pc, const data_buffer &opcodes, const data_buffer &params, uint8_t op) override;

private:
	offs_t disassemble_extended_a5(std::ostream& stream, unsigned PC, offs_t pc, const data_buffer& opcodes, const data_buffer& params);
	offs_t disassemble_extended_a5_0e(std::ostream& stream, unsigned PC, offs_t pc, const data_buffer& opcodes, const data_buffer& params);
	offs_t disassemble_extended_a5_0f(std::ostream& stream, unsigned PC, offs_t pc, const data_buffer& opcodes, const data_buffer& params);
	offs_t disassemble_extended_a5_d0(std::ostream& stream, unsigned PC, offs_t pc, const data_buffer& opcodes, const data_buffer& params);
	offs_t disassemble_extended_a5_d1(std::ostream& stream, unsigned PC, offs_t pc, const data_buffer& opcodes, const data_buffer& params);

};

class ax208_disassembler : public axc51core_disassembler
{
public:
	ax208_disassembler();
	virtual ~ax208_disassembler() = default;

	struct ax208_bios_info {
		int addr;
		const char *name;
	};

	static const ax208_bios_info bios_call_names[];

protected:
	virtual void disassemble_op_ljmp(std::ostream& stream, unsigned &PC, const data_buffer& params) override;
	virtual void disassemble_op_lcall(std::ostream& stream, unsigned &PC, const data_buffer& params) override;
};



#endif // MAME_CPU_MCS51_AXC51_CORE_DASM_H