diff lwasm/main.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 d4ac484d0ec6
children 5d401d1eb3e9
line wrap: on
line diff
--- a/lwasm/main.c	Mon Apr 14 07:43:43 2014 -0600
+++ b/lwasm/main.c	Tue Apr 15 10:57:34 2014 -0600
@@ -59,6 +59,7 @@
 	{ "define", 'D', "SYM[=VAL]", 0, "Automatically define SYM to be VAL (or 1)"},
 	{ "preprocess",	'P',	0,			0,							"Preprocess macros and conditionals and output revised source to stdout" },
 	{ "unicorns",	0x142,	0,			0,							"Add sooper sekrit sauce"},
+	{ "6800compat",	0x200,	0,			0,							"Enable 6800 compatibility instructions, equivalent to --pragma=6800compat" },
 	{ 0 }
 };
 
@@ -191,6 +192,10 @@
 	case 'P':
 		as -> preprocess = 1;
 		break;
+	
+	case 0x200:
+		as -> pragmas |= PRAGMA_6800COMPAT;
+		break;
 		
 	case lw_cmdline_key_end:
 		break;