comparison lwasm/insn_logicmem.c @ 402:b20f14edda5a

Completed initial conversion to new parser allowing spaces in operands Converted the remaining addressing modes. This required a complete rewrite of a large portion of the indexed addressing parser. Now the entire indexed parsing system is programmatic without cheating with a lookup table. This update also fixes the "force 0,r" by writing a literal 0,r which is *supposed* to work. There will likely be some pseudo ops that need tweaking for space handling, specially those that take multiple operands of some description which are not expressions. (The expression parser call eats the spaces both before and after the expression, if appropriate.)
author William Astle <lost@l-w.ca>
date Wed, 14 Oct 2015 20:49:41 -0600
parents 8e25147c2aa8
children
comparison
equal deleted inserted replaced
401:bbe5401a9bf3 402:b20f14edda5a
48 lwasm_register_error(as, l, E_OPERAND_BAD); 48 lwasm_register_error(as, l, E_OPERAND_BAD);
49 return; 49 return;
50 } 50 }
51 51
52 lwasm_save_expr(l, 100, s); 52 lwasm_save_expr(l, 100, s);
53 lwasm_skip_to_next_token(l, p);
53 if (**p != ',' && **p != ';') 54 if (**p != ',' && **p != ';')
54 { 55 {
55 lwasm_register_error(as, l, E_OPERAND_BAD); 56 lwasm_register_error(as, l, E_OPERAND_BAD);
56 return; 57 return;
57 } 58 }
58 59
59 (*p)++; 60 (*p)++;
60 61 lwasm_skip_to_next_token(l, p);
61 // now we have a general addressing mode - call for it 62 // now we have a general addressing mode - call for it
62 insn_parse_gen_aux(as, l, p, 1); 63 insn_parse_gen_aux(as, l, p, 1);
63 } 64 }
64 65
65 RESOLVEFUNC(insn_resolve_logicmem) 66 RESOLVEFUNC(insn_resolve_logicmem)