diff lwasm/pass1.c @ 385:4fd16faa4d93

Add various "convenience" ops These are things like "NEGD" in 6809 mode or NEGQ in 6309 mode. These require either 6809conv or 6309conv pragmas. Also fix a problem with "CPX" in the 6800 mode. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 21:26:34 -0600
parents 80d615a6642c
children 6153cb49403c
line wrap: on
line diff
--- a/lwasm/pass1.c	Mon Jul 13 21:20:30 2015 -0600
+++ b/lwasm/pass1.c	Mon Jul 13 21:26:34 2015 -0600
@@ -279,9 +279,15 @@
 
 			for (opnum = 0; instab[opnum].opcode; opnum++)
 			{
-				// ignore 6800 compatibility entries unless asked for
-				if ((instab[opnum].flags & lwasm_insn_is6800) && !CURPRAGMA(cl, PRAGMA_6800COMPAT))
-					continue;
+				// ignore 6800 compatibility opcodes unless asked for
+				if ((instab[opnum].flags & lwasm_insn_is6800) && !CURPRAGMA(cl, PRAGMA_6800COMPAT)) continue;
+				// ignore 6809 convenience opcodes unless asked for
+				if ((instab[opnum].flags & lwasm_insn_is6809conv) && !CURPRAGMA(cl, PRAGMA_6809CONV)) continue;
+				// ignore 6809 convenience opcodes in 6309 mode
+				if ((instab[opnum].flags & lwasm_insn_is6809conv) && !CURPRAGMA(cl, PRAGMA_6809)) continue;
+				// ignore 6309 convenience opcodes unless asked for
+				if ((instab[opnum].flags & lwasm_insn_is6309conv) && !CURPRAGMA(cl, PRAGMA_6309CONV)) continue;
+
 				if (!strcasecmp(instab[opnum].opcode, sym))
 					break;
 			}