changeset 460:3d53f2e8d0e0

Allow macros to shadow instructions that are not supported by current CPU. When assembling in 6809 mode, 6309 instructions should be usable as macros. When assembling in 6309 mode, instructions not valid on the 6309 should be usable as macros.
author William Astle <lost@l-w.ca>
date Wed, 28 Feb 2018 20:43:14 -0700
parents ed7b8f74087d
children c8d4f3486ad7
files lwasm/pass1.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pass1.c	Wed Feb 28 18:41:26 2018 -0700
+++ b/lwasm/pass1.c	Wed Feb 28 20:43:14 2018 -0700
@@ -330,7 +330,12 @@
         			goto linedone;
         		}
         	}
-			if (instab[opnum].opcode == NULL)
+        	
+			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 != '*')