The vector's number goes beside its kind, not at the end of the line

Kind and Number together are what names a thing: Vector 16 and Device 32
are identifiers in a way that Vector on its own is not. Everything after
them - where it lives, what it is called, where it was written - says
something about it rather than naming it, so with the number at the far
end a line opened with a bare kind and closed with the fact that would
have told you what you were reading.

Fields are now Kind, Number, Address, Name, File, Line. A label still
carries a dash where its number would be, which reads as "this kind is
not numbered" rather than as a field that went missing.

Manual and the docs check follow. Verified with break.sh by swapping the
number and the address back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-09-05 11:03:11 -04:00
co-authored by Claude Opus 5
parent f3d8985bc4
commit 7dca141aae
3 changed files with 27 additions and 17 deletions
+14 -6
View File
@@ -66,6 +66,14 @@ int vectorArrayCount = 0;
// and what a memory dump shows. Neither can be worked out from the other without knowing
// which table it is in, so the file says both.
//
// THE NUMBER SITS SECOND, beside the kind rather than out at the end, because the two of
// them together are what names the thing: "Vector 26" and "Device 32" are single identifiers
// in the way "Vector" alone is not. Everything after them - where it lives, what it is
// called, where it was written - is something about the thing rather than part of naming it,
// so the line reads as an identity followed by its properties. A label has no number and
// carries a dash in that column, which is the shape of the answer "this kind is not numbered"
// rather than an empty space that could be a missing field.
//
// Sorted by kind and then address rather than by name, because the question asked of it is
// always "what is at this address"; sorting by address alone would interleave separate
// address spaces and make the first column flicker between them. The table is small enough
@@ -146,17 +154,17 @@ void writeSymbolFile(const char *path) {
for (int i = 0; i < n; i++) {
char number[12]; // Wide enough for any int, which is more than a vector needs.
if (rows[i].number < 0) {
// A LABEL HAS NO NUMBER, and the field says so rather than being left empty:
// a run of tabs with nothing between them is the one thing a reader of this
// file, human or otherwise, can miscount.
// A label has no number, and the field says so rather than being left empty: a
// run of tabs with nothing between them is the one thing a reader of this file,
// human or otherwise, can miscount.
snprintf(number, sizeof(number), "-");
} else {
snprintf(number, sizeof(number), "%d", rows[i].number);
}
fprintf(file, "%s\t%04X\t%s\t%s\t%d\t%s\n",
kindName[rows[i].kind], rows[i].address, rows[i].name,
fprintf(file, "%s\t%s\t%04X\t%s\t%s\t%d\n",
kindName[rows[i].kind], number, rows[i].address, rows[i].name,
rows[i].fileName ? rows[i].fileName : "?",
rows[i].lineNumber, number);
rows[i].lineNumber);
}
free(rows);
fclose(file);