changeset 212:b0d53e2f3f53

Make --6309/--6809 work properly Fixed an inverted test that checked for 6809/6309 mode incorrectly. This also fixes the fact that 6309 mode was not the default as per the documentation.
author William Astle <lost@l-w.ca>
date Sat, 09 Jun 2012 23:17:43 -0600
parents 6f2e18f1fe67
children 38ecb99d78dd
files lwasm/main.c lwasm/pass1.c
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/main.c	Sat Jun 09 17:23:04 2012 -0600
+++ b/lwasm/main.c	Sat Jun 09 23:17:43 2012 -0600
@@ -244,7 +244,8 @@
 	asmstate.include_list = lw_stringlist_create();
 	asmstate.input_files = lw_stringlist_create();
 	asmstate.nextcontext = 1;
-
+	asmstate.target = TARGET_6309;
+	
 	/* parse command line arguments */	
 	lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate);
 
--- a/lwasm/pass1.c	Sat Jun 09 17:23:04 2012 -0600
+++ b/lwasm/pass1.c	Sat Jun 09 23:17:43 2012 -0600
@@ -274,7 +274,7 @@
 				if (!strcasecmp(instab[opnum].opcode, sym))
 					break;
 			}
-			if ((as -> target == TARGET_6309) && (instab[opnum].flags & lwasm_insn_is6309))
+			if ((as -> target != TARGET_6309) && (instab[opnum].flags & lwasm_insn_is6309))
 				lwasm_register_error(as, cl, "Illegal use of 6309 instruction in 6809 mode (%s)", sym);
 			
 			// have to go to linedone here in case there was a symbol