# HG changeset patch # User Matti Hamalainen # Date 1559257819 -10800 # Node ID 122134900c0eaa3c4dcc9a90656e5b5c9cb52aae # Parent 987c9081088387bab3533d75784fa8a43f4daa43 Cosmetics. diff -r 987c90810883 -r 122134900c0e dump.c --- a/dump.c Wed Jun 27 11:37:08 2018 +0300 +++ b/dump.c Fri May 31 02:10:19 2019 +0300 @@ -90,15 +90,25 @@ for (address = EndAddress < StartAddress ? EndAddress : 0; address != StartAddress; address++) + { if (IsLabeled (address) && !IsInsideRegion(address)) + { fprintf (stdout, "%s%s = $%x\n", lineprefix, Label (address, abso, 0), address); + } + } if (EndAddress >= StartAddress) + { for (address = EndAddress; address; address++) + { if (IsLabeled (address) && !IsInsideRegion(address)) + { fprintf (stdout, "%s%s = $%x\n", lineprefix, Label (address, abso, 0), address); + } + } + } /* dump the program */ fprintf(stdout, "\n\n"); diff -r 987c90810883 -r 122134900c0e label.c --- a/label.c Wed Jun 27 11:37:08 2018 +0300 +++ b/label.c Fri May 31 02:10:19 2019 +0300 @@ -61,6 +61,7 @@ entry->len = len; } + int IsInsideRegion(ADDR_T address) { label *entry; @@ -131,16 +132,18 @@ if (fVerbose) fprintf (stderr, "%s: collecting garbage.\n", prog); - while ((entry = entry2 = FindNextEntryType (entry, 0, 0))) { + while ((entry = entry2 = FindNextEntryType (entry, 0, 0))) + { counter++; PutLabel (entry->address); PutLowByte (entry->address); PutHighByte (entry->address); - while ((entry2 = FindNextEntry (entry2, entry->address, - ~0, entry->type))) + while ((entry2 = FindNextEntry (entry2, entry->address, ~0, entry->type))) + { DeleteEntry (entry2); /* remove duplicate warnings */ + } } if ((entry = malloc (counter * sizeof *entry))) { /* compact the table */ @@ -157,10 +160,12 @@ } for (labels = &labeltable[numLabels]; labels-- > labeltable;) - if ((ADDR_T)(labels->address - StartAddress) < - (ADDR_T)(EndAddress - StartAddress)) { + { + if ((ADDR_T)(labels->address - StartAddress) < (ADDR_T)(EndAddress - StartAddress)) + { PutLabel (labels->address); PutLowByte (labels->address); PutHighByte (labels->address); } + } }