diff lwasm/pass1.c @ 333:507f442dc71e

Add support for 6800 compatibility instructions. The occasional program uses the 6800 compatibility instructions since they are actually specified by Motorola in at least some documentation. They advertised the 6809 as source compatible with the 6800. This mode is not enabled by default, however. It is my belief that receiving an error when using a non-6809 instruction is more useful since it is unlikely that much 6800 source code is being assembled for the 6809 these days. Nevertheless, the --6809compat option is present for just those purposes so one does not have to resort to using macros (which would work equally well in most cases).
author William Astle <lost@l-w.ca>
date Tue, 15 Apr 2014 10:57:34 -0600
parents 9f7889139b06
children 30b2bad9b5eb
line wrap: on
line diff
--- a/lwasm/pass1.c	Mon Apr 14 07:43:43 2014 -0600
+++ b/lwasm/pass1.c	Tue Apr 15 10:57:34 2014 -0600
@@ -271,6 +271,9 @@
 
 			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;
 				if (!strcasecmp(instab[opnum].opcode, sym))
 					break;
 			}