# HG changeset patch # User William Astle # Date 1435196353 21600 # Node ID 00fced888c5d6f0674e920b9b12f0afdabd8d8b4 # Parent 39490cf2d1c2e9d7c2a96fe59b6f25e51f431a5f Fix psh/pul to not accept the stack pointer as a valid argument Don't allow "pshs s", "puls s", "pshu u", or "pulu u" - none of those are valid on the 6809 (not encodable) so they need to throw an error. diff -r 39490cf2d1c2 -r 00fced888c5d lwasm/insn_rlist.c --- a/lwasm/insn_rlist.c Mon Jun 22 19:23:11 2015 -0600 +++ b/lwasm/insn_rlist.c Wed Jun 24 19:39:13 2015 -0600 @@ -47,6 +47,23 @@ } if (**p == ',') (*p)++; + if ((instab[l -> insn].ops[0]) & 2) + { + // pshu/pulu + if (rn == 6) + { + lwasm_register_error2(as, l, E_REGISTER_BAD, "'%s'", "u"); + return; + } + } + else + { + if (rn == 9) + { + lwasm_register_error2(as, l, E_REGISTER_BAD, "'%s'", "s"); + return; + } + } if (rn == 8) rn = 6; else if (rn == 9)