# HG changeset patch # User William Astle # Date 1553028353 21600 # Node ID 469a130e7029844d8d70ce19b612a802a10e6f55 # Parent 40c32a0af8c86654cf1234990706e087ca052573 Add option to suppress output file Add --no-output to suppress creation of the output file altogether. Useful when the assembler is used for other features without needing the assembled object. diff -r 40c32a0af8c8 -r 469a130e7029 lwasm/lwasm.h --- a/lwasm/lwasm.h Tue Mar 19 14:37:56 2019 -0600 +++ b/lwasm/lwasm.h Tue Mar 19 14:45:53 2019 -0600 @@ -73,8 +73,9 @@ FLAG_SYMBOLS = 0x004, FLAG_DEPENDNOERR = 0x0008, FLAG_UNICORNS = 0x0010, - FLAG_MAP = 0x0020, - FLAG_SYMBOLS_NOLOCALS = 0x0040, + FLAG_MAP = 0x0020, + FLAG_SYMBOLS_NOLOCALS = 0x0040, + FLAG_NOOUT = 0x80, FLAG_NONE = 0 }; diff -r 40c32a0af8c8 -r 469a130e7029 lwasm/main.c --- a/lwasm/main.c Tue Mar 19 14:37:56 2019 -0600 +++ b/lwasm/main.c Tue Mar 19 14:45:53 2019 -0600 @@ -64,6 +64,7 @@ { "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" }, + { "no-output", 0x105, 0, 0, "Inhibit creation of output file" }, { 0 } }; @@ -103,6 +104,11 @@ if (as -> output_file) lw_free(as -> output_file); as -> output_file = lw_strdup(arg); + as -> flags &= ~FLAG_NOOUT; + break; + + case 0x105: + as -> flags |= FLAG_NOOUT; break; case 'd': @@ -371,7 +377,7 @@ lw_free(n); } } - else + else if ((asmstate.flags & FLAG_NOOUT) == 0) { debug_message(&asmstate, 50, "Doing output"); do_output(&asmstate);