comparison lwasm/parse.c @ 230:0df2a39a268c

Added --6809/--6309 switches and some cleanups in error reporting
author lost
date Fri, 12 Jun 2009 03:18:32 +0000
parents 436b36214e35
children a58f49a77441
comparison
equal deleted inserted replaced
229:59a138df0401 230:0df2a39a268c
179 // we've registered the symbol as needed 179 // we've registered the symbol as needed
180 // now we need to check for a macro call IFF we don't collide with 180 // now we need to check for a macro call IFF we don't collide with
181 // an operation code; otherwise, call the operation function 181 // an operation code; otherwise, call the operation function
182 if (instab[opnum].opcode) 182 if (instab[opnum].opcode)
183 { 183 {
184 if (instab[opnum].fn) 184 if (instab[opnum].fn && !(as -> no6309 && instab[opnum].is6309))
185 { 185 {
186 (instab[opnum].fn)(as, l, &p2, opnum); 186 (instab[opnum].fn)(as, l, &p2, opnum);
187 187
188 // if we didn't end on a "space" character or EOL, throw error 188 // if we didn't end on a "space" character or EOL, throw error
189 if (*p2 && !isspace(*p2)) 189 if (*p2 && !isspace(*p2) && !(l -> err))
190 register_error(as, l, 1, "Bad operand"); 190 register_error(as, l, 1, "Bad operand");
191 } 191 }
192 else 192 else
193 { 193 {
194 // carp about unimplemented operation 194 // carp about unimplemented operation
195 register_error(as, l, 1, "Unimplemented operation code: %s", opc); 195 if (instab[opnum].is6309)
196 register_error(as, l, 1, "Use of 6309 operation code: %s", opc);
197 else
198 register_error(as, l, 1, "Unimplemented operation code: %s", opc);
196 } 199 }
197 } 200 }
198 else 201 else
199 { 202 {
200 if (expand_macro(as, l, &p2, opc) == 0) 203 if (expand_macro(as, l, &p2, opc) == 0)