diff lwasm/main.c @ 406:4411a6123716

Add "basic" output format Add "basic" output format. This outputs the code in the form of a Basic program that installs the assembled output. If an execution address is provided to the END pseudo operation, it will transfer control there using the Basic EXEC command. Thanks to Tim Lindner <tlindner@macmess.org> for the original patch. I used it mostly as is except for a couple of minor fixes for coding style and removing a variable declaration from inside a for() statement for portability reasons.
author William Astle <lost@l-w.ca>
date Thu, 03 Mar 2016 21:04:39 -0700
parents 1ebb5a0b2874
children 9f796134d6f4
line wrap: on
line diff
--- a/lwasm/main.c	Thu Mar 03 20:52:15 2016 -0700
+++ b/lwasm/main.c	Thu Mar 03 21:04:39 2016 -0700
@@ -44,7 +44,7 @@
 {
 	{ "output",		'o',	"FILE",		0,							"Output to FILE"},
 	{ "debug",		'd',	"LEVEL",	lw_cmdline_opt_optional,	"Set debug mode"},
-	{ "format",		'f',	"TYPE",		0,							"Select output format: decb, raw, obj, os9"},
+	{ "format",		'f',	"TYPE",		0,							"Select output format: decb, basic, raw, obj, os9"},
 	{ "list",		'l',	"FILE",		lw_cmdline_opt_optional,	"Generate list [to FILE]"},
 	{ "symbols",	's',	0,			lw_cmdline_opt_optional,	"Generate symbol list in listing, no effect without --list"},
 	{ "symbols-nolocals", 0x103,	0,	lw_cmdline_opt_optional,	"Same as --symbols but with local labels ignored"},
@@ -175,6 +175,8 @@
 	case 'f':
 		if (!strcasecmp(arg, "decb"))
 			as -> output_format = OUTPUT_DECB;
+		else if (strcasecmp(arg, "basic"))
+			as -> output_format = OUTPUT_BASIC;
 		else if (!strcasecmp(arg, "raw"))
 			as -> output_format = OUTPUT_RAW;
 		else if (!strcasecmp(arg, "rawrel"))