From 9cdbabc2b3d65ae05bead957df9b7daddf860ff1 Mon Sep 17 00:00:00 2001 From: Iambian Date: Sun, 31 Dec 2017 22:42:08 -0500 Subject: [PATCH] Restored functionality to -L flag, generate symbol table. --- main.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index 39c3962..e52d950 100644 --- a/main.cpp +++ b/main.cpp @@ -132,7 +132,7 @@ int run_assembly() include_dirs = NULL; //...and if there's output, run the second pass and write it to the output file - if (mode & MODE_SYMTABLE || mode & MODE_NORMAL || mode & MODE_LIST) + if (mode & MODE_NORMAL || mode & MODE_LIST) { printf ("Pass two... \n"); int second_pass_session = StartSPASMErrorSession(); @@ -140,14 +140,6 @@ int run_assembly() ReplaySPASMErrorSession(second_pass_session); EndSPASMErrorSession(second_pass_session); - if (mode & MODE_SYMTABLE) { - int symtable_session = StartSPASMErrorSession(); - char* fileName = change_extension(output_filename, "lab"); - write_labels (fileName); - free(fileName); - ReplayFatalSPASMErrorSession(symtable_session); - EndSPASMErrorSession(symtable_session); - } //run the output through the appropriate program export and write it to a file if (mode & MODE_NORMAL && output_filename != NULL) @@ -189,6 +181,16 @@ int run_assembly() input_files = NULL; } + if (mode & MODE_SYMTABLE) { + printf("Outputting symbol table\n"); + int symtable_session = StartSPASMErrorSession(); + char* fileName = change_extension(output_filename, "lab"); + write_labels(fileName); + free(fileName); + ReplayFatalSPASMErrorSession(symtable_session); + EndSPASMErrorSession(symtable_session); + } + //if there's info to be dumped, do that if (mode & MODE_CODE_COUNTER) { fprintf (stdout, "Size: %u\nMin. execution time: %u\nMax. execution time: %u\n",