Skip to content

Commit

Permalink
[TMS9900] Add TMS99110 variant
Browse files Browse the repository at this point in the history
  • Loading branch information
tgtakaoka committed Oct 20, 2024
1 parent 9648e09 commit 5a4afeb
Show file tree
Hide file tree
Showing 13 changed files with 1,046 additions and 52 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ It can generate Intel HEX or Motorola S-Record output.
i80C48 MSM80C39 MSM80C48 i8051 i8080 i8085 V30EMU Z80 Z8 Z86C Z88
TLCS90 INS8060 INS8070 CDP1802 CDP1804 CDP1804A SCN2650 F3850 IM6100
HD6120 TMS7000 TMS32010 TMS32015 i8086 i80186 V30 i8096 MC68000
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 Z8001 Z8002 NS32032 MN1610
MN1613 MN1613A J11 T11
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 TMS99110 Z8001 Z8002 NS32032
MN1610 MN1613 MN1613A J11 T11
-o <output> : output file
-l <list> : list file
-S[<bytes>] : output Motorola S-Record format
Expand Down Expand Up @@ -122,8 +122,8 @@ It can read Intel HEX or Motorola S-Record input.
i80C48 MSM80C39 MSM80C48 i8051 i8080 i8085 V30EMU Z80 Z8 Z86C Z88
TLCS90 INS8060 INS8070 CDP1802 CDP1804 CDP1804A SCN2650 F3850 IM6100
HD6120 TMS7000 TMS32010 TMS32015 i8086 i80186 V30 i8096 MC68000
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 Z8001 Z8002 NS32032 MN1610
MN1613 MN1613A J11 T11
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 TMS99110 Z8001 Z8002 NS32032
MN1610 MN1613 MN1613A J11 T11
-o <output> : output file
-l <list> : list file
<input> : file can be Motorola S-Record or Intel HEX format
Expand Down
8 changes: 4 additions & 4 deletions README_.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ usage: asm [-o <output>] [-l <list>] <input>
i80C48 MSM80C39 MSM80C48 i8051 i8080 i8085 V30EMU Z80 Z8 Z86C Z88
TLCS90 INS8060 INS8070 CDP1802 CDP1804 CDP1804A SCN2650 F3850 IM6100
HD6120 TMS7000 TMS32010 TMS32015 i8086 i80186 V30 i8096 MC68000
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 Z8001 Z8002 NS32032 MN1610
MN1613 MN1613A J11 T11
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 TMS99110 Z8001 Z8002 NS32032
MN1610 MN1613 MN1613A J11 T11
-o <output> : output file
-l <list> : list file
-S[<bytes>] : output Motorola S-Record format
Expand Down Expand Up @@ -128,8 +128,8 @@ usage: dis -C <CPU> [-o <output>] [-l <list>] <input>
i80C48 MSM80C39 MSM80C48 i8051 i8080 i8085 V30EMU Z80 Z8 Z86C Z88
TLCS90 INS8060 INS8070 CDP1802 CDP1804 CDP1804A SCN2650 F3850 IM6100
HD6120 TMS7000 TMS32010 TMS32015 i8086 i80186 V30 i8096 MC68000
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 Z8001 Z8002 NS32032 MN1610
MN1613 MN1613A J11 T11
MC68010 TMS9900 TMS9980 TMS9995 TMS99105 TMS99110 Z8001 Z8002 NS32032
MN1610 MN1613 MN1613A J11 T11
-o <output> : output file
-l <list> : list file
<input> : file can be Motorola S-Record or Intel HEX format
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.arch
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TGT_scn2650 = scn2650
TGT_tlcs90 = tlcs90
TGT_tms32010 = tms32010
TGT_tms7000 = tms7000
TGT_tms9900 = tms9900 tms9980 tms9995 tms99105
TGT_tms9900 = tms9900 tms9980 tms9995 tms99105 tms99110
TGT_z8000 = z8001 z8002 z8k1 z8k2
TGT_z80 = z80 i8080_z80syn i8085_z80syn v30emu_z80syn
TGT_z8 = z8 z86c z88
Expand Down Expand Up @@ -126,6 +126,7 @@ CPU_tms32010 = 32010
CPU_tms7000 = TMS7000
CPU_tms9900 = TMS9900
CPU_tms99105 = TMS99105
CPU_tms99110 = TMS99110
CPU_tms9980 = TMS9980
CPU_tms9995 = TMS9995
CPU_v30emu = V30EMU
Expand Down
1 change: 1 addition & 0 deletions src/config_tms9900.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum CpuType : uint8_t {
TMS9980,
TMS9995,
TMS99105,
TMS99110,
};

struct Config : ConfigImpl<CpuType, ADDRESS_16BIT, ADDRESS_BYTE, OPCODE_16BIT, ENDIAN_BIG, 8, 4> {
Expand Down
45 changes: 45 additions & 0 deletions src/table_tms9900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,43 @@ static constexpr uint8_t INDEX_TMS99105[] PROGMEM = {
6, // TEXT_TMB
8, // TEXT_TSMB
};

static constexpr Entry TABLE_TMS99110[] PROGMEM = {
E0(0x0780, TEXT_LDS),
E0(0x07C0, TEXT_LDD),
E0(0x0C00, TEXT_CRI),
E0(0x0C02, TEXT_NEGR),
E0(0x0C04, TEXT_CRE),
E0(0x0C06, TEXT_CER),
E1(0x0C40, TEXT_AR, M_SRC),
E1(0x0C80, TEXT_CIR, M_SRC),
E1(0x0CC0, TEXT_SR, M_SRC),
E1(0x0D00, TEXT_MR, M_SRC),
E1(0x0D40, TEXT_DR, M_SRC),
E1(0x0D80, TEXT_LR, M_SRC),
E1(0x0DC0, TEXT_STR, M_SRC),
E2(0x0301, TEXT_CR, M_SRC2, M_DST2),
E2(0x0302, TEXT_MM, M_SRC2, M_DST2),
};

static constexpr uint8_t INDEX_TMS99110[] PROGMEM = {
6, // TEXT_AR
5, // TEXT_CER
7, // TEXT_CIR
13, // TEXT_CR
4, // TEXT_CRE
2, // TEXT_CRI
10, // TEXT_DR
1, // TEXT_LDD
0, // TEXT_LDS
11, // TEXT_LR
14, // TEXT_MM
9, // TEXT_MR
3, // TEXT_NEGR
8, // TEXT_SR
12, // TEXT_STR
};

// clang-format on

using EntryPage = entry::TableBase<Entry>;
Expand All @@ -241,13 +278,21 @@ static constexpr EntryPage TMS99105_PAGES[] PROGMEM = {
{ARRAY_RANGE(TABLE_TMS9995), ARRAY_RANGE(INDEX_TMS9995)},
};

static constexpr EntryPage TMS99110_PAGES[] PROGMEM = {
{ARRAY_RANGE(TABLE_TMS99105), ARRAY_RANGE(INDEX_TMS99105)},
{ARRAY_RANGE(TABLE_TMS9900), ARRAY_RANGE(INDEX_TMS9900)},
{ARRAY_RANGE(TABLE_TMS9995), ARRAY_RANGE(INDEX_TMS9995)},
{ARRAY_RANGE(TABLE_TMS99110), ARRAY_RANGE(INDEX_TMS99110)},
};

using Cpu = entry::CpuBase<CpuType, EntryPage>;

static constexpr Cpu CPU_TABLE[] PROGMEM = {
{TMS9900, TEXT_CPU_9900, ARRAY_RANGE(TMS9900_PAGES)},
{TMS9980, TEXT_CPU_9980, ARRAY_RANGE(TMS9900_PAGES)},
{TMS9995, TEXT_CPU_9995, ARRAY_RANGE(TMS9995_PAGES)},
{TMS99105, TEXT_CPU_99105, ARRAY_RANGE(TMS99105_PAGES)},
{TMS99110, TEXT_CPU_99110, ARRAY_RANGE(TMS99110_PAGES)},
};

static const Cpu *cpu(CpuType cpuType) {
Expand Down
22 changes: 20 additions & 2 deletions src/text_tms9900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ namespace text {
namespace tms9900 {

// clang-format off
constexpr char TEXT_TMS9900_LIST[] PROGMEM = "TMS9900, TMS9980, TMS9995, TMS99105";
constexpr char TEXT_TMS9900_LIST[] PROGMEM = "TMS9900, TMS9980, TMS9995, TMS99105, TMS99110";
constexpr char TEXT_CPU_9900[] PROGMEM = "9900";
constexpr char TEXT_CPU_9980[] PROGMEM = "9980";
constexpr char TEXT_CPU_9995[] PROGMEM = "9995";
constexpr char TEXT_CPU_99105[] PROGMEM = "99105";
constexpr char TEXT_CPU_99110[] PROGMEM = "99110";

// TMS9900
// constexpr char TEXT_A[] PROGMEM = "A";
Expand Down Expand Up @@ -115,8 +116,25 @@ constexpr char TEXT_SRAM[] PROGMEM = "SRAM";
constexpr char TEXT_TCMB[] PROGMEM = "TCMB";
constexpr char TEXT_TMB[] PROGMEM = "TMB";
constexpr char TEXT_TSMB[] PROGMEM = "TSMB";
// clang-format on

// TMS99110
constexpr char TEXT_AR[] PROGMEM = "AR";
constexpr char TEXT_CER[] PROGMEM = "CER";
constexpr char TEXT_CIR[] PROGMEM = "CIR";
constexpr char TEXT_CR[] PROGMEM = "CR";
constexpr char TEXT_CRE[] PROGMEM = "CRE";
constexpr char TEXT_CRI[] PROGMEM = "CRI";
constexpr char TEXT_DR[] PROGMEM = "DR";
// constexpr char TEXT_LDD[] PROGMEM = "LDD";
// constexpr char TEXT_LDS[] PROGMEM = "LDS";
// constexpr char TEXT_LR[] PROGMEM = "LR";
constexpr char TEXT_MM[] PROGMEM = "MM";
constexpr char TEXT_MR[] PROGMEM = "MR";
constexpr char TEXT_NEGR[] PROGMEM = "NEGR";
// constexpr char TEXT_SR[] PROGMEM = "SR";
// constexpr char TEXT_STR[] PROGMEM = "STR";

// clang-format on
} // namespace tms9900
} // namespace text
} // namespace libasm
Expand Down
20 changes: 19 additions & 1 deletion src/text_tms9900.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern const char TEXT_CPU_9900[] PROGMEM;
extern const char TEXT_CPU_9980[] PROGMEM;
extern const char TEXT_CPU_9995[] PROGMEM;
extern const char TEXT_CPU_99105[] PROGMEM;
extern const char TEXT_CPU_99110[] PROGMEM;

// TMS9900
using common::TEXT_A;
Expand Down Expand Up @@ -118,8 +119,25 @@ extern const char TEXT_SRAM[] PROGMEM;
extern const char TEXT_TCMB[] PROGMEM;
extern const char TEXT_TMB[] PROGMEM;
extern const char TEXT_TSMB[] PROGMEM;
// clang-format on

// TMS99110
extern const char TEXT_AR[] PROGMEM;
extern const char TEXT_CER[] PROGMEM;
extern const char TEXT_CIR[] PROGMEM;
extern const char TEXT_CR[] PROGMEM;
extern const char TEXT_CRE[] PROGMEM;
extern const char TEXT_CRI[] PROGMEM;
extern const char TEXT_DR[] PROGMEM;
using common::TEXT_LDD;
using common::TEXT_LDS;
using common::TEXT_LR;
extern const char TEXT_MM[] PROGMEM;
extern const char TEXT_MR[] PROGMEM;
extern const char TEXT_NEGR[] PROGMEM;
using common::TEXT_SR;
using common::TEXT_STR;

// clang-format on
} // namespace tms9900
} // namespace text
} // namespace libasm
Expand Down
Loading

0 comments on commit 5a4afeb

Please sign in to comment.