# HG changeset patch # User William Astle # Date 1541135223 21600 # Node ID 8181ddd707f137df1c3778f15b134002f13dbc9f # Parent e97f9a302c6acd4342cf5357ea5d0529bfc10576 Add "nooutput" pragma Add the "nooutput" pragma which causes assembly to proceed as normal for code with the exception that no output is generated for any instructions under this pragma. The current address is increased as usual and the symbol table is still constructed. However, no actual output is generated for lines operating under this pragma. diff -r e97f9a302c6a -r 8181ddd707f1 lwasm/lwasm.c --- a/lwasm/lwasm.c Thu Nov 01 23:00:00 2018 -0600 +++ b/lwasm/lwasm.c Thu Nov 01 23:07:03 2018 -0600 @@ -436,6 +436,8 @@ void lwasm_emit(line_t *cl, int byte) { + if (CURPRAGMA(cl, PRAGMA_NOOUTPUT)) + return; if (cl -> as -> output_format == OUTPUT_OBJ && cl -> csect == NULL) { lwasm_register_error(cl -> as, cl, E_INSTRUCTION_SECTION); diff -r e97f9a302c6a -r 8181ddd707f1 lwasm/lwasm.h --- a/lwasm/lwasm.h Thu Nov 01 23:00:00 2018 -0600 +++ b/lwasm/lwasm.h Thu Nov 01 23:07:03 2018 -0600 @@ -108,6 +108,7 @@ PRAGMA_NEWSOURCE = 1 << 24, // don't use compatibility source format PRAGMA_OPERANDSIZE = 1 << 25, // warn if operand size is bigger than required PRAGMA_EMUEXT = 1 << 26, // enable emulator extensions + PRAGMA_NOOUTPUT = 1 << 27, // disable object code output PRAGMA_CLEARBIT = 1 << 31 // reserved to indicate negated pragma flag status }; diff -r e97f9a302c6a -r 8181ddd707f1 lwasm/pragma.c --- a/lwasm/pragma.c Thu Nov 01 23:00:00 2018 -0600 +++ b/lwasm/pragma.c Thu Nov 01 23:07:03 2018 -0600 @@ -76,6 +76,7 @@ { "nooldsource", "oldsource", PRAGMA_NEWSOURCE }, { "operandsizewarning", "nooperandsizewarning", PRAGMA_OPERANDSIZE }, { "emuext", "noemuext", PRAGMA_EMUEXT }, + { "nooutput", "output", PRAGMA_NOOUTPUT }, { 0, 0, 0 } };