Two ceilings a hundred bytes apart look like one ceiling

The sixteen kilobytes taken back a moment ago all went to the output image,
because that was the wall: 13,245 bytes of cosmos.bin against 13,312. Lifting
it moved the machine straight into the next one, a hundred and eleven bytes
away - the label names, at 8,081 of 8,192 - and the index was a hundred and
eighteen entries from the same place.

So the room is shared out rather than given to the obvious one. Names and index
both double, and the output takes what is left, which is still four and a half
thousand bytes more than CosmOS needs.

LabLimit and LabRoom in labels.asm have to agree with the map in scratch.asm
and are now said to.

Worth recording how this was found, because it is the good case. The assembler
STOPPED and said "no room left for label names: Mode, at line 3598" - a limit
it checks, names, and points at. Every other ceiling this project has hit went
unnoticed until something downstream broke: a program loaded over the shell, a
path silently cut short, a file reported as itself less 65,536. A limit that
announces itself is worth the handful of instructions it costs.

The output's eighteen kilobytes are temporary. They exist because the assembler
holds a whole finished file in memory before writing it, and the file is
produced in order, so it could be written as it is made.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-08-25 14:50:36 -04:00
co-authored by Claude Opus 5
parent ec56439d9a
commit 7cd5e34347
2 changed files with 28 additions and 14 deletions
+9 -4
View File
@@ -297,13 +297,18 @@ LabEnd:
; How many labels there may be, and how many bytes of name between them.
;
; SIZED FOR THE ASSEMBLER ITSELF, which turns out to be the largest thing it is asked to
; build: 555 labels and about 6,800 bytes of name, against CosmOS's 475 and 5,881. Running into
; either limit says so rather than writing past the end of the table. The buffers live
; build: 555 labels and about 6,800 bytes of name, against CosmOS's 650 and 8,081 - CosmOS is
; the bigger of the two now, and was the smaller when this was written. Running into either
; limit says so rather than writing past the end of the table, and that is what it did. The buffers live
; above the program rather than inside it - see the scratch map in Asm.asm.
; Fifteen hundred and thirty six names, and sixteen kilobytes to hold them in. Both were
; half that, and the names ran out first: 8,081 bytes of 8,192, which is a hundred and
; eleven - and the thing that ran into it was one ordinary piece of work adding eighteen
; labels. THESE TWO MUST AGREE WITH THE SCRATCH MAP, which says where the room actually is.
LabLimit:
0x03 0x00
0x06 0x00
LabRoom:
0x20 0x00
0x40 0x00
LabNamed:
": "