Add option -yl1 to list pass 1 as well

Normally listing is suppressed during the first pass, because there are
many unresolved symbols, which will be better in pass 2.
Errors are also suppressed because most of them are spurious.

With the -yl1 option, listing during pass 1 is not suppressed.
If you give the option twice, you also get the error messages.
This commit is contained in:
Olaf Seibert 2015-05-10 01:12:36 +02:00
parent 21b5f2269f
commit 2c091595e9
3 changed files with 15 additions and 3 deletions

View File

@ -28,6 +28,7 @@ static char *binline; /* for octal expansion */
FILE *lstfile = NULL;
int list_pass_0 = 0;/* Also list what happens during the first pass */
@ -36,7 +37,9 @@ FILE *lstfile = NULL;
static int dolist(
void)
{
int ok = lstfile != NULL && pass > 0 && list_level > 0;
int ok = lstfile != NULL &&
(pass > 0 || list_pass_0) &&
list_level > 0;
return ok;
}
@ -147,7 +150,7 @@ void report(
char *name = "**";
int line = 0;
if (!pass)
if (!pass && list_pass_0 < 2)
return; /* Don't report now. */
if (str) {

View File

@ -35,6 +35,8 @@ extern int list_level; /* Listing control level. .LIST
extern FILE *lstfile;
extern int list_pass_0; /* Also list what happens during the first pass */
#endif

View File

@ -125,6 +125,7 @@ static void print_help(
printf("-ysl Syntax extension: change length of symbols from \n");
printf(" default = %d to larger values, max %d.\n", SYMMAX_DEFAULT, SYMMAX_MAX);
printf("-yus Syntax extension: allow underscore \"_\" in symbols.\n");
printf("-yl1 Extension: list the first pass too, not only the second.\n");
printf("\n");
printf("Options for -e and -d are:\n");
printf("AMA (off) - absolute addressing (versus PC-relative)\n");
@ -236,7 +237,7 @@ int main(
/* The option -l gives the listing file name (.LST) */
/* -l - enables listing to stdout. */
if(arg >= argc-1 ||
(argv[arg+1][0] == '-' && argv[arg+1][1] != '\0')) {
(argv[arg+1][0] == '-' && argv[arg+1][1] != '\0')) {
usage("-l must be followed by the listing file name (- for standard output)\n");
}
lstname = argv[++arg];
@ -275,6 +276,9 @@ int main(
} else if (!stricmp(cp, "yus")) {
/* allow underscores */
symbol_allow_underscores = 1;
} else if (!stricmp(cp, "yl1")) {
/* list the first pass, in addition to the second */
list_pass_0++;
} else {
fprintf(stderr, "Unknown option %s\n", argv[arg]);
print_help();
@ -324,6 +328,9 @@ int main(
assemble_stack(&stack, &tr);
if (list_pass_0 && lstfile) {
list_symbol_table();
}
#if 0
if (enabl_debug)
dump_all_macros();