Delete a comment describing a design that was removed, and check the rest
Two comments in the native assembler survived the changes that made them false, and both are the kind that misleads rather than merely ages. Asm.asm still explained an eighteen kilobyte buffer that the whole output had to fit in "because a file is written in one call and there is nowhere to put half of one" - which stopped being true when the assembler learned to stream, and the variable it described, ImgRoom, does not exist any more. It was sitting in front of the comment that replaced it, so the paragraph a reader met first described the design that had been taken out. Replaced by what is actually there: no limit but the disk, one block at a time through a window in scratch. scratch.asm said the system keeps below 0x1000 twelve lines above the paragraph explaining that the system's half of Data Memory was doubled to 0x1FFF. A stale number next to its own correction is worse than a stale number alone, because which one a reader believes is a coin toss. docs.sh now checks both of the facts scratch.asm asserts about the machine around it: the floor it claims the system keeps below, against the CosmOS README, and the address its buffers start at, against where the assembler's own data actually ends. Neither is enforced by a line of code anywhere - the map is a comment, deliberately, because reserving the buffers would put 22K of zeroes in the file and the assembler could not load itself - so a check is the only thing that can hold them. Both fail when broken; the second reports the exact overlap.
This commit is contained in:
@@ -2315,17 +2315,21 @@ ImgHold:
|
||||
DropWalk:
|
||||
0x00 0x00
|
||||
|
||||
; How big an output file this can build. Everything the assembler makes has to fit here at once,
|
||||
; because a file is written in one call and there is nowhere to put half of one. CosmOS
|
||||
; itself comes to 9,564 bytes.
|
||||
; Eighteen kilobytes, and IT HAS TO AGREE WITH THE SCRATCH MAP, which says where that room
|
||||
; actually is. Three numbers in three files describe these buffers - this one, LabLimit and
|
||||
; LabRoom in labels.asm, and the map itself - and each of the three has now been the one
|
||||
; that was left behind while the other two moved.
|
||||
; Which block of the file is in the window, and whether anything has been put in it. The
|
||||
; window itself is in scratch, like every other buffer here: a #Reserve is written into the
|
||||
; file as zeroes and copied at load, and a program that carries its own scratch pays for it
|
||||
; twice.
|
||||
; ---- The output, which goes out as it is made ----
|
||||
;
|
||||
; THERE IS NO LIMIT ON HOW BIG A FILE THIS CAN BUILD, and that is the point of the window
|
||||
; below. The assembler used to hold the whole output in an eighteen kilobyte buffer and
|
||||
; write it in one call at the end, which made the largest program it could assemble a
|
||||
; property of ITS OWN memory rather than of the disk - and cosmos.bin reached 13,245 bytes
|
||||
; of the 13,312 there were, sixty seven short of the system being unable to build itself.
|
||||
;
|
||||
; Now one block at a time goes through OutBlock, which lives in scratch like every other
|
||||
; buffer here: a #Reserve is written into the file as zeroes and copied at load, so a
|
||||
; program that carries its own scratch pays for it twice. What bounds the output is the
|
||||
; contiguous run the disk can find for it.
|
||||
;
|
||||
; OutAt is the cursor, OutBlock which block of the file the window holds, OutHeld whether
|
||||
; it holds one at all, and OutDirty whether anything has been put in it since it arrived.
|
||||
OutAt:
|
||||
0x00 0x00
|
||||
OutBlock:
|
||||
|
||||
Reference in New Issue
Block a user