diff 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
line wrap: on
line diff
--- a/lwasm/pass1.c	Wed Feb 28 20:43:14 2018 -0700
+++ b/lwasm/pass1.c	Wed Feb 28 20:54:53 2018 -0700
@@ -332,10 +332,9 @@
         	}
         	
 			if (instab[opnum].opcode == NULL ||
-			(
 				(CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6309)) ||
 				(!CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6809))
-			))
+			)
 			{
 				cl -> insn = -1;
 				if (*tok != ';' && *tok != '*')
@@ -348,7 +347,12 @@
 						if (expand_struct(as, cl, &p1, sym) != 0)
 						{
 							// structure expansion failed
-							lwasm_register_error(as, cl, E_OPCODE_BAD);
+							if (CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6309))
+								lwasm_register_error2(as, cl, E_6309_INVALID, "(%s)", sym);
+							else if (!CURPRAGMA(cl, PRAGMA_6809) && (instab[opnum].flags & lwasm_insn_is6809))
+								lwasm_register_error2(as, cl, E_6809_INVALID, "(%s)", sym);
+							else
+								lwasm_register_error(as, cl, E_OPCODE_BAD);
 						}
 					}
 				}