summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-07-12 23:17:53 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-07-12 23:41:52 -0400
commit05993b1f311fc44b0ac014e3d1029959029b9e10 (patch)
tree40b989f6edd225c703e3920efd28102de461fd21
parent1fc13da750a0dedc1c8ccfe948810d729c9d7917 (diff)
mcs51: Disassembler update
- Restore some 8052 SFR and bit names that were inadvertently omitted for more advanced models - Add a few more T2-related names - Add i8xc51fx and i8xc51gb disassemblers with additional SFR and bit names - Remove i80c51 from unidasm (actual differences from i8051 are not significant) Change device names from "Intel I8xxx" to "Intel 8xxx" (nw) scm_500: Identify CPU type as 80C51GB (specific differences obviously not emulated) (nw) unidasm: Realphabetize mips1 (nw)
-rw-r--r--src/devices/cpu/mcs51/mcs51.cpp35
-rw-r--r--src/devices/cpu/mcs51/mcs51.h11
-rw-r--r--src/devices/cpu/mcs51/mcs51dasm.cpp136
-rw-r--r--src/devices/cpu/mcs51/mcs51dasm.h16
-rw-r--r--src/mame/drivers/scm_500.cpp19
-rw-r--r--src/tools/unidasm.cpp7
6 files changed, 198 insertions, 26 deletions
diff --git a/src/devices/cpu/mcs51/mcs51.cpp b/src/devices/cpu/mcs51/mcs51.cpp
index c307c19a611..21f64953a45 100644
--- a/src/devices/cpu/mcs51/mcs51.cpp
+++ b/src/devices/cpu/mcs51/mcs51.cpp
@@ -222,19 +222,20 @@ enum
};
-DEFINE_DEVICE_TYPE(I8031, i8031_device, "i8031", "Intel I8031")
-DEFINE_DEVICE_TYPE(I8032, i8032_device, "i8032", "Intel I8032")
-DEFINE_DEVICE_TYPE(I8051, i8051_device, "i8051", "Intel I8051")
-DEFINE_DEVICE_TYPE(I8751, i8751_device, "i8751", "Intel I8751")
+DEFINE_DEVICE_TYPE(I8031, i8031_device, "i8031", "Intel 8031")
+DEFINE_DEVICE_TYPE(I8032, i8032_device, "i8032", "Intel 8032")
+DEFINE_DEVICE_TYPE(I8051, i8051_device, "i8051", "Intel 8051")
+DEFINE_DEVICE_TYPE(I8751, i8751_device, "i8751", "Intel 8751")
DEFINE_DEVICE_TYPE(AM8753, am8753_device, "am8753", "AMD Am8753")
-DEFINE_DEVICE_TYPE(I8052, i8052_device, "i8052", "Intel I8052")
-DEFINE_DEVICE_TYPE(I8752, i8752_device, "i8752", "Intel I8752")
-DEFINE_DEVICE_TYPE(I80C31, i80c31_device, "i80c31", "Intel I80C31")
-DEFINE_DEVICE_TYPE(I80C51, i80c51_device, "i80c51", "Intel I80C51")
-DEFINE_DEVICE_TYPE(I87C51, i87c51_device, "i87c51", "Intel I87C51")
-DEFINE_DEVICE_TYPE(I80C32, i80c32_device, "i80c32", "Intel I80C32")
-DEFINE_DEVICE_TYPE(I80C52, i80c52_device, "i80c52", "Intel I80C52")
-DEFINE_DEVICE_TYPE(I87C52, i87c52_device, "i87c52", "Intel I87C52")
+DEFINE_DEVICE_TYPE(I8052, i8052_device, "i8052", "Intel 8052")
+DEFINE_DEVICE_TYPE(I8752, i8752_device, "i8752", "Intel 8752")
+DEFINE_DEVICE_TYPE(I80C31, i80c31_device, "i80c31", "Intel 80C31")
+DEFINE_DEVICE_TYPE(I80C51, i80c51_device, "i80c51", "Intel 80C51")
+DEFINE_DEVICE_TYPE(I87C51, i87c51_device, "i87c51", "Intel 87C51")
+DEFINE_DEVICE_TYPE(I80C32, i80c32_device, "i80c32", "Intel 80C32")
+DEFINE_DEVICE_TYPE(I80C52, i80c52_device, "i80c52", "Intel 80C52")
+DEFINE_DEVICE_TYPE(I87C52, i87c52_device, "i87c52", "Intel 87C52")
+DEFINE_DEVICE_TYPE(I80C51GB, i80c51gb_device, "i80c51gb", "Intel 80C51GB")
DEFINE_DEVICE_TYPE(AT89C52, at89c52_device, "at89c52", "Atmel AT89C52")
DEFINE_DEVICE_TYPE(AT89S52, at89s52_device, "at89s52", "Atmel AT89S52")
DEFINE_DEVICE_TYPE(AT89C4051, at89c4051_device, "at89c4051", "Atmel AT89C4051")
@@ -371,6 +372,11 @@ i87c52_device::i87c52_device(const machine_config &mconfig, const char *tag, dev
{
}
+i80c51gb_device::i80c51gb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : i80c52_device(mconfig, I80C51GB, tag, owner, clock, 0, 8)
+{
+}
+
at89c52_device::at89c52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i80c52_device(mconfig, AT89C52, tag, owner, clock, 13, 8)
{
@@ -2521,6 +2527,11 @@ std::unique_ptr<util::disasm_interface> i80c52_device::create_disassembler()
return std::make_unique<i80c52_disassembler>();
}
+std::unique_ptr<util::disasm_interface> i80c51gb_device::create_disassembler()
+{
+ return std::make_unique<i8xc51gb_disassembler>();
+}
+
std::unique_ptr<util::disasm_interface> ds5002fp_device::create_disassembler()
{
return std::make_unique<ds5002fp_disassembler>();
diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h
index bd7b6d7b085..a16f302ab16 100644
--- a/src/devices/cpu/mcs51/mcs51.h
+++ b/src/devices/cpu/mcs51/mcs51.h
@@ -339,6 +339,7 @@ DECLARE_DEVICE_TYPE(I87C51, i87c51_device)
DECLARE_DEVICE_TYPE(I80C32, i80c32_device)
DECLARE_DEVICE_TYPE(I80C52, i80c52_device)
DECLARE_DEVICE_TYPE(I87C52, i87c52_device)
+DECLARE_DEVICE_TYPE(I80C51GB, i80c51gb_device)
DECLARE_DEVICE_TYPE(AT89C52, at89c52_device)
DECLARE_DEVICE_TYPE(AT89S52, at89s52_device)
/* 4k internal perom and 128 internal ram and 2 analog comparators */
@@ -467,6 +468,16 @@ public:
i87c52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
+class i80c51gb_device : public i80c52_device
+{
+public:
+ // construction/destruction
+ i80c51gb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+};
+
class at89c52_device : public i80c52_device
{
public:
diff --git a/src/devices/cpu/mcs51/mcs51dasm.cpp b/src/devices/cpu/mcs51/mcs51dasm.cpp
index 2b857f74307..a9eeb91a28e 100644
--- a/src/devices/cpu/mcs51/mcs51dasm.cpp
+++ b/src/devices/cpu/mcs51/mcs51dasm.cpp
@@ -153,6 +153,9 @@ const mcs51_disassembler::mem_info mcs51_disassembler::i8052_names[] = {
{ 0x1ad, "et2" },
{ 0x1bd, "pt2" },
+ { 0x190, "t2" },
+ { 0x191, "t2ex" },
+
{ 0x1c8, "cprl2" },
{ 0x1c9, "ct2" },
{ 0x1ca, "tr2" },
@@ -169,6 +172,120 @@ const mcs51_disassembler::mem_info mcs51_disassembler::i80c52_names[] = {
{ 0xb7, "iph" },
{ 0xa9, "saddr" },
{ 0xb9, "saden" },
+ { 0xc9, "t2mod" },
+
+ { -1 }
+};
+
+const mcs51_disassembler::mem_info mcs51_disassembler::i8xc51fx_names[] = {
+ { 0xd8, "ccon" },
+ { 0xd9, "cmod" },
+ { 0xe9, "cl" },
+ { 0xf9, "ch" },
+ { 0xda, "ccapm0" },
+ { 0xdb, "ccapm1" },
+ { 0xdc, "ccapm2" },
+ { 0xdd, "ccapm3" },
+ { 0xde, "ccapm4" },
+ { 0xea, "ccap0l" },
+ { 0xfa, "ccap0h" },
+ { 0xeb, "ccap1l" },
+ { 0xfb, "ccap1h" },
+ { 0xec, "ccap2l" },
+ { 0xfc, "ccap2h" },
+ { 0xed, "ccap3l" },
+ { 0xfd, "ccap3h" },
+ { 0xee, "ccap4l" },
+ { 0xfe, "ccap4h" },
+
+ { 0x192, "eci" },
+ { 0x193, "cex0" },
+ { 0x194, "cex1" },
+ { 0x195, "cex2" },
+ { 0x196, "cex3" },
+ { 0x197, "cex4" },
+
+ { 0x1ae, "ec" },
+ { 0x1be, "ppc" },
+
+ { 0x1d8, "ccf0" },
+ { 0x1d9, "ccf1" },
+ { 0x1da, "ccf2" },
+ { 0x1db, "ccf3" },
+ { 0x1dc, "ccf4" },
+ { 0x1de, "cr" },
+ { 0x1df, "cf" },
+};
+
+const mcs51_disassembler::mem_info mcs51_disassembler::i8xc51gb_names[] = {
+ { 0x84, "ad0" },
+ { 0x94, "ad1" },
+ { 0xa4, "ad2" },
+ { 0xb4, "ad3" },
+ { 0xc4, "ad4" },
+ { 0xd4, "ad5" },
+ { 0xe4, "ad6" },
+ { 0xf4, "ad7" },
+ { 0x85, "acon" },
+ { 0xc7, "acmp" },
+
+ { 0xe8, "c1con" },
+ { 0x9f, "c1mod" },
+ { 0xaf, "cl1" },
+ { 0xbf, "ch1" },
+ { 0x9a, "c1capm0"},
+ { 0x9b, "c1capm1"},
+ { 0x9c, "c1capm2"},
+ { 0x9d, "c1capm3"},
+ { 0x9e, "c1capm4"},
+ { 0xaa, "c1cap0l"},
+ { 0xba, "c1cap0h"},
+ { 0xab, "c1cap1l"},
+ { 0xbb, "c1cap1h"},
+ { 0xac, "c1cap2l"},
+ { 0xbc, "c1cap2h"},
+ { 0xad, "c1cap3l"},
+ { 0xbd, "c1cap3h"},
+ { 0xae, "c1cap4l"},
+ { 0xbe, "c1cap4h"},
+
+ { 0xc6, "exicon" },
+ { 0xa7, "iea" },
+ { 0xb6, "ipa" },
+ { 0xb5, "ipah" },
+
+ { 0xa5, "oscr" },
+ { 0xa6, "wdtrst" },
+
+ { 0xc0, "p4" },
+ { 0xf8, "p5" },
+
+ { 0xd7, "sepcon" },
+ { 0xe7, "sepdat" },
+ { 0xf7, "sepstat"},
+
+ { 0x1c0, "sepclk" },
+ { 0x1c1, "sepdat" },
+ { 0x1c2, "eci1" },
+ { 0x1c3, "c1ex0" },
+ { 0x1c4, "c1ex1" },
+ { 0x1c5, "c1ex2" },
+ { 0x1c6, "c1ex3" },
+ { 0x1c7, "c1ex4" },
+
+ { 0x1e8, "c1cf0" },
+ { 0x1e9, "c1cf1" },
+ { 0x1ea, "c1cf2" },
+ { 0x1eb, "c1cf3" },
+ { 0x1ec, "c1cf4" },
+ { 0x1ee, "cr1" },
+ { 0x1ef, "cf1" },
+
+ { 0x1fa, "int2" },
+ { 0x1fb, "int3" },
+ { 0x1fc, "int4" },
+ { 0x1fd, "int5" },
+ { 0x1fe, "int6" },
{ -1 }
};
@@ -272,10 +389,7 @@ std::string mcs51_disassembler::get_bit_address( uint8_t arg ) const
if(arg < 0x80)
{
//Bit address 0-7F can be referred to as 20.0, 20.1, to 20.7 for address 0, and 2f.0,2f.1 to 2f.7 for address 7f
- if(arg < 0x7f)
- return util::string_format("$%02X.%d", (arg >> 3) | 0x20, arg & 0x07);
- else
- return util::string_format("$%02X", arg);
+ return util::string_format("$%02X.%d", (arg >> 3) | 0x20, arg & 0x07);
}
else
{
@@ -1122,14 +1236,22 @@ i8052_disassembler::i8052_disassembler() : mcs51_disassembler(default_names, i80
{
}
-i80c51_disassembler::i80c51_disassembler() : mcs51_disassembler(default_names, i80c52_names)
+i80c51_disassembler::i80c51_disassembler() : mcs51_disassembler(default_names)
+{
+}
+
+i80c52_disassembler::i80c52_disassembler() : mcs51_disassembler(default_names, i8052_names, i80c52_names)
+{
+}
+
+i8xc51fx_disassembler::i8xc51fx_disassembler() : mcs51_disassembler(default_names, i8052_names, i80c52_names, i8xc51fx_names)
{
}
-i80c52_disassembler::i80c52_disassembler() : mcs51_disassembler(default_names, i80c52_names, i80c52_names)
+i8xc51gb_disassembler::i8xc51gb_disassembler() : mcs51_disassembler(default_names, i8052_names, i80c52_names, i8xc51fx_names, i8xc51gb_names)
{
}
-ds5002fp_disassembler::ds5002fp_disassembler() : mcs51_disassembler(default_names, i80c52_names, ds5002fp_names, i8xc751_names)
+ds5002fp_disassembler::ds5002fp_disassembler() : mcs51_disassembler(default_names, i8052_names, i80c52_names, ds5002fp_names, i8xc751_names)
{
}
diff --git a/src/devices/cpu/mcs51/mcs51dasm.h b/src/devices/cpu/mcs51/mcs51dasm.h
index 9cf7702361f..0bb161f3ab8 100644
--- a/src/devices/cpu/mcs51/mcs51dasm.h
+++ b/src/devices/cpu/mcs51/mcs51dasm.h
@@ -42,6 +42,8 @@ public:
static const mem_info default_names[];
static const mem_info i8052_names[];
static const mem_info i80c52_names[];
+ static const mem_info i8xc51fx_names[];
+ static const mem_info i8xc51gb_names[];
static const mem_info ds5002fp_names[];
static const mem_info i8xc751_names[];
@@ -101,6 +103,20 @@ public:
virtual ~i80c52_disassembler() = default;
};
+class i8xc51fx_disassembler : public mcs51_disassembler
+{
+public:
+ i8xc51fx_disassembler();
+ virtual ~i8xc51fx_disassembler() = default;
+};
+
+class i8xc51gb_disassembler : public mcs51_disassembler
+{
+public:
+ i8xc51gb_disassembler();
+ virtual ~i8xc51gb_disassembler() = default;
+};
+
class ds5002fp_disassembler : public mcs51_disassembler
{
public:
diff --git a/src/mame/drivers/scm_500.cpp b/src/mame/drivers/scm_500.cpp
index ad16a0e2c57..535644f35b0 100644
--- a/src/mame/drivers/scm_500.cpp
+++ b/src/mame/drivers/scm_500.cpp
@@ -11,24 +11,34 @@ http://www.standardchange.com/frequently-asked-questions
*/
#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
class scm_500_state : public driver_device
{
public:
scm_500_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
-// ,m_maincpu(*this, "maincpu")
- { }
+ , m_maincpu(*this, "maincpu")
+ {
+ }
void scm_500(machine_config &config);
private:
+ void prog_map(address_map &map);
+
virtual void machine_start() override;
virtual void machine_reset() override;
-// required_device<cpu_device> m_maincpu;
+
+ required_device<mcs51_cpu_device> m_maincpu;
};
+void scm_500_state::prog_map(address_map &map)
+{
+ map(0x0000, 0xffff).rom().region("maincpu", 0);
+}
+
static INPUT_PORTS_START( scm_500 )
INPUT_PORTS_END
@@ -42,7 +52,8 @@ void scm_500_state::machine_reset()
void scm_500_state::scm_500(machine_config &config)
{
- // unknown CPU
+ I80C51GB(config, m_maincpu, 12'000'000); // unknown clock
+ m_maincpu->set_addrmap(AS_PROGRAM, &scm_500_state::prog_map);
}
/*
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index 89089b3a688..aa5708b3ec5 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -381,11 +381,12 @@ static const dasm_table_entry dasm_table[] =
{ "i8052", le, 0, []() -> util::disasm_interface * { return new i8052_disassembler; } },
{ "i8085", le, 0, []() -> util::disasm_interface * { return new i8085_disassembler; } },
{ "i8089", le, 0, []() -> util::disasm_interface * { return new i8089_disassembler; } },
- { "i80c51", le, 0, []() -> util::disasm_interface * { return new i80c51_disassembler; } },
{ "i80c52", le, 0, []() -> util::disasm_interface * { return new i80c52_disassembler; } },
{ "i860", le, 0, []() -> util::disasm_interface * { return new i860_disassembler; } },
{ "i8x9x", le, 0, []() -> util::disasm_interface * { return new i8x9x_disassembler; } },
{ "i8xc196", le, 0, []() -> util::disasm_interface * { return new i8xc196_disassembler; } },
+ { "i8xc51fx", le, 0, []() -> util::disasm_interface * { return new i8xc51fx_disassembler; } },
+ { "i8xc51gb", le, 0, []() -> util::disasm_interface * { return new i8xc51gb_disassembler; } },
{ "i960", le, 0, []() -> util::disasm_interface * { return new i960_disassembler; } },
{ "ie15", le, 0, []() -> util::disasm_interface * { return new ie15_disassembler; } },
{ "jaguardsp", be, 0, []() -> util::disasm_interface * { return new jaguar_disassembler(jaguar_disassembler::variant::DSP); } },
@@ -424,6 +425,8 @@ static const dasm_table_entry dasm_table[] =
{ "mb88", le, 0, []() -> util::disasm_interface * { return new mb88_disassembler; } },
{ "mcs48", le, 0, []() -> util::disasm_interface * { return new mcs48_disassembler(false, false); } },
{ "minx", le, 0, []() -> util::disasm_interface * { return new minx_disassembler; } },
+ { "mips1be", be, 0, []() -> util::disasm_interface * { return new mips1_disassembler; } },
+ { "mips1le", le, 0, []() -> util::disasm_interface * { return new mips1_disassembler; } },
{ "mips3be", be, 0, []() -> util::disasm_interface * { return new mips3_disassembler; } },
{ "mips3le", le, 0, []() -> util::disasm_interface * { return new mips3_disassembler; } },
{ "mn10200", le, 0, []() -> util::disasm_interface * { return new mn10200_disassembler; } },
@@ -440,8 +443,6 @@ static const dasm_table_entry dasm_table[] =
{ "powerpc", be, 0, []() -> util::disasm_interface * { return new powerpc_disassembler; } },
{ "pps4", le, 0, []() -> util::disasm_interface * { return new pps4_disassembler; } },
{ "psxcpu", le, 0, []() -> util::disasm_interface * { return new psxcpu_disassembler; } },
- { "mips1be", be, 0, []() -> util::disasm_interface * { return new mips1_disassembler; } },
- { "mips1le", le, 0, []() -> util::disasm_interface * { return new mips1_disassembler; } },
{ "rii", le, -1, []() -> util::disasm_interface * { return new riscii_disassembler; } },
{ "rsp", le, 0, []() -> util::disasm_interface * { return new rsp_disassembler; } },
{ "s2650", le, 0, []() -> util::disasm_interface * { return new s2650_disassembler(&s2650_unidasm); } },