# HG changeset patch # User William Astle # Date 1688139617 21600 # Node ID f9ffd1935ceebc438ef5b047b41c1691bca9e6be # Parent 4ec5c94ade7188dcd4b1c06092faf2e5c1dc88a0 Add explicit immediate mode to register list instructions (PSHS, etc.) There is actual code in the wild that wants to use things like PSHS #0 which are valid 6809 instructions and actually listed in the literature. So add the capability to do so. diff -r 4ec5c94ade71 -r f9ffd1935cee lwasm/insn_rlist.c --- a/lwasm/insn_rlist.c Sun Apr 23 10:23:43 2023 -0600 +++ b/lwasm/insn_rlist.c Fri Jun 30 09:40:17 2023 -0600 @@ -27,12 +27,23 @@ #include "lwasm.h" #include "instab.h" +PARSEFUNC(insn_parse_imm8); +EMITFUNC(insn_emit_imm8); + PARSEFUNC(insn_parse_rlist) { int rb = 0; int rn; static const char *regs = "CCA B DPX Y U PCD S "; + l -> lint = 0; + if (**p == '#') + { + insn_parse_imm8(as, l, p); + l -> lint = 1; + return; + } + while (**p && !isspace(**p) && **p != ';' && **p != '*') { rn = lwasm_lookupreg2(regs, p); @@ -84,6 +95,12 @@ EMITFUNC(insn_emit_rlist) { + if (l -> lint == 1) + { + insn_emit_imm8(as, l); + return; + } + lwasm_emitop(l, instab[l -> insn].ops[0]); lwasm_emit(l, l -> pb);