Skip to content

Commit

Permalink
[TMS9900] Accept @symbol as BLSK operand
Browse files Browse the repository at this point in the history
  • Loading branch information
tgtakaoka committed Jan 10, 2025
1 parent 89409a9 commit 23d8e1f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/asm_tms9900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void AsmTms9900::encodeOperand(AsmInsn &insn, const Operand &op, AddrMode mode)
auto val16 = op.val.getUnsigned();
switch (mode) {
case M_IMM:
case M_SYBL:
insn.emitOperand16(val16);
break;
case M_REG:
Expand Down
14 changes: 8 additions & 6 deletions src/table_tms9900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ static constexpr Entry TABLE_TMS99105[] PROGMEM = {
E2(0x0029, TEXT_SM, M_SRC2, M_DST4),
E2(0x002A, TEXT_AM, M_SRC2, M_DST4),
E2(0x00B0, TEXT_BLSK, M_REG, M_IMM),
E2(0x00B0, TEXT_BLSK, M_REG, M_SYBL),
E1(0x0140, TEXT_BIND, M_SRC),
E2(0x0C09, TEXT_TMB, M_SRC2, M_BIT0),
E2(0x0C0A, TEXT_TCMB, M_SRC2, M_BIT0),
Expand All @@ -214,16 +215,17 @@ static constexpr Entry TABLE_TMS99105[] PROGMEM = {

static constexpr uint8_t INDEX_TMS99105[] PROGMEM = {
3, // TEXT_AM
5, // TEXT_BIND
6, // TEXT_BIND
4, // TEXT_BLSK
9, // TEXT_EVAD
10, // TEXT_RTWP
5, // TEXT_BLSK
10, // TEXT_EVAD
11, // TEXT_RTWP
1, // TEXT_SLAM
2, // TEXT_SM
0, // TEXT_SRAM
7, // TEXT_TCMB
6, // TEXT_TMB
8, // TEXT_TSMB
8, // TEXT_TCMB
7, // TEXT_TMB
9, // TEXT_TSMB
};

static constexpr Entry TABLE_TMS99110[] PROGMEM = {
Expand Down
2 changes: 2 additions & 0 deletions test/test_asm_tms9900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ static void test_reg_imm() {
// TMS99105, TMS99110
TEST("BLSK R3,>4567", 0x00B3, 0x4567);
TEST("BLSK R3,sym1234", 0x00B3, 0x1234);
TEST("BLSK R3,@>4567", 0x00B3, 0x4567);
TEST("BLSK R3,@sym1234", 0x00B3, 0x1234);
} else {
ERUI("BLSK R3,>4567");
}
Expand Down

0 comments on commit 23d8e1f

Please sign in to comment.