comparison lwasm/insn_rlist.c @ 368:362f8fb0695b

Make psh/pul error out if no registers given While the generated object code was technically correct for bare pshs, puls, pshu, and pulu, it was not helpful. Throw a bad operand error if no registers are given as an operand to such instructions. Thanks to Erik G <erik@6809.org> for reporting the problem.
author William Astle <lost@l-w.ca>
date Mon, 15 Jun 2015 21:26:33 -0600
parents 7317fbe024af
children 8764142b3192
comparison
equal deleted inserted replaced
367:c6d2a1f54e0c 368:362f8fb0695b
53 rn = 0x40; 53 rn = 0x40;
54 else 54 else
55 rn = 1 << rn; 55 rn = 1 << rn;
56 rb |= rn; 56 rb |= rn;
57 } 57 }
58 if (rb == 0)
59 lwasm_register_error(as, l, "Bad operand");
58 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1; 60 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
59 l -> pb = rb; 61 l -> pb = rb;
60 } 62 }
61 63
62 EMITFUNC(insn_emit_rlist) 64 EMITFUNC(insn_emit_rlist)