comparison lwasm/pass1.c @ 461:c8d4f3486ad7

Make 6309/6809 warnings work again. Previous commit broke 6809/6309 instruction warnings.
author William Astle <lost@l-w.ca>
date Wed, 28 Feb 2018 20:54:53 -0700
parents 3d53f2e8d0e0
children e97f9a302c6a
comparison
equal deleted inserted replaced
460:3d53f2e8d0e0 461:c8d4f3486ad7
330 goto linedone; 330 goto linedone;
331 } 331 }
332 } 332 }
333 333
334 if (instab[opnum].opcode == NULL || 334 if (instab[opnum].opcode == NULL ||
335 (
336 (CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6309)) || 335 (CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6309)) ||
337 (!CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6809)) 336 (!CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6809))
338 )) 337 )
339 { 338 {
340 cl -> insn = -1; 339 cl -> insn = -1;
341 if (*tok != ';' && *tok != '*') 340 if (*tok != ';' && *tok != '*')
342 { 341 {
343 // bad opcode; check for macro here 342 // bad opcode; check for macro here
346 { 345 {
347 // macro expansion failed 346 // macro expansion failed
348 if (expand_struct(as, cl, &p1, sym) != 0) 347 if (expand_struct(as, cl, &p1, sym) != 0)
349 { 348 {
350 // structure expansion failed 349 // structure expansion failed
351 lwasm_register_error(as, cl, E_OPCODE_BAD); 350 if (CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6309))
351 lwasm_register_error2(as, cl, E_6309_INVALID, "(%s)", sym);
352 else if (!CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6809))
353 lwasm_register_error2(as, cl, E_6809_INVALID, "(%s)", sym);
354 else
355 lwasm_register_error(as, cl, E_OPCODE_BAD);
352 } 356 }
353 } 357 }
354 } 358 }
355 } 359 }
356 else 360 else