Basically, stdout is buffered, and not fully written out when "sort" also starts writing to it. If the output is to a terminal, everything comes out in the proper order. But if stdout is redirected to a disk file, the symbol table always seems to appear starting in line 241 of my ~470 line output code. The fix is to do a "fflush(stdout)" somewhere. I put it in dump_table itself, and I also changed the "fclose/wait" combination to "pclose" which I feel is only proper for a pipe. Attached is a patch file.
Basically, stdout is buffered, and not fully written out when "sort" also starts writing to it. If the output is to a terminal, everything comes out in the proper order. But if stdout is redirected to a disk file, the symbol table always seems to appear starting in line 241 of my ~470 line output code. The fix is to do a "fflush(stdout)" somewhere. I put it in dump_table itself, and I also changed the "fclose/wait" combination to "pclose" which I feel is only proper for a pipe. Attached is a patch file.
masm-patch.txt