comparison lwasm/insn_rlist.c @ 373:00fced888c5d

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.
author William Astle <lost@l-w.ca>
date Wed, 24 Jun 2015 19:39:13 -0600
parents 8764142b3192
children 35d4213e6657
comparison
equal deleted inserted replaced
372:39490cf2d1c2 373:00fced888c5d
45 { 45 {
46 lwasm_register_error(as, l, E_OPERAND_BAD); 46 lwasm_register_error(as, l, E_OPERAND_BAD);
47 } 47 }
48 if (**p == ',') 48 if (**p == ',')
49 (*p)++; 49 (*p)++;
50 if ((instab[l -> insn].ops[0]) & 2)
51 {
52 // pshu/pulu
53 if (rn == 6)
54 {
55 lwasm_register_error2(as, l, E_REGISTER_BAD, "'%s'", "u");
56 return;
57 }
58 }
59 else
60 {
61 if (rn == 9)
62 {
63 lwasm_register_error2(as, l, E_REGISTER_BAD, "'%s'", "s");
64 return;
65 }
66 }
50 if (rn == 8) 67 if (rn == 8)
51 rn = 6; 68 rn = 6;
52 else if (rn == 9) 69 else if (rn == 9)
53 rn = 0x40; 70 rn = 0x40;
54 else 71 else