# HG changeset patch # User William Astle # Date 1519875794 25200 # Node ID 3d53f2e8d0e00500552a524445a531c00cc9bdba # Parent ed7b8f74087dd67f433253f4929087edce39752f 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. diff -r ed7b8f74087d -r 3d53f2e8d0e0 lwasm/pass1.c --- 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 != '*')