# HG changeset patch # User William Astle # Date 1339305463 21600 # Node ID b0d53e2f3f536cadfd250cfa5b3a404f16bfed99 # Parent 6f2e18f1fe6734fee1b63d7b13141057911be044 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. diff -r 6f2e18f1fe67 -r b0d53e2f3f53 lwasm/main.c --- 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); diff -r 6f2e18f1fe67 -r b0d53e2f3f53 lwasm/pass1.c --- 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