Check the memory map against itself, not only against the code

The CosmOS README's Data row gave the system 0x0000-0x3FFF and a loaded
application 0x2000 and above: two columns of one row that cannot both be
true. Program was doubled to 0x3FFF when CosmOS outgrew its first map and
that number was copied into the Data row as well, where the answer is
0x1FFF.

docs.sh measured both segments against the CosmOS column and passed the
table anyway, because it never read the column beside it. A number checked
against the code and not against the number next to it is still unchecked,
so it now reads both and compares them - and compares two further copies of
the same fact that had gone stale on their own: the minimal application in
the README, still based where applications lived before the doubling, and
the map cosmos.asm opens with, which somebody reading the system reads
before they read the README.

Each of the three checks was confirmed by breaking the fact and watching it
fail; the first reproduces exactly the text this commit removes. While in
that header, the command list said five commands and CosmOS has eleven and
a search path besides, and "dump is next" outlived the monitor.
This commit is contained in:
Anachronaut
2026-08-25 22:54:14 -04:00
parent db3d349da8
commit aa7bdc6acd
3 changed files with 78 additions and 16 deletions
+14 -10
View File
@@ -10,10 +10,10 @@
; The system keeps to the bottom of both memories, and everything above is for whatever
; it is running:
;
; Program Memory 0x0000 - 0x1FFF the system
; 0x2000 - a loaded program's code
; Data Memory 0x0000 - 0x0FFF the system
; 0x1000 - a loaded program's data
; Program Memory 0x0000 - 0x3FFF the system
; 0x4000 - a loaded program's code
; Data Memory 0x0000 - 0x1FFF the system
; 0x2000 - a loaded program's data
;
; Nothing enforces that. Nothing can: the fence guards a range, and this is a convention
; about which range belongs to whom rather than a rule about what may be touched. The
@@ -25,14 +25,20 @@
;
; ---- What it can do ----
;
; dir List what is on the disk.
; dir List what is in the current directory.
; cd Go somewhere else, or to the root when told nothing.
; mkdir Make a directory. rmdir Remove an empty one.
; delete Remove a file. rename Give one another name.
; load Read a program off the disk and put it where it asks to go.
; run Start the program that was loaded.
; help Say what these are.
; exit Stop.
; exit Stop, or leave the monitor if that is where you are.
;
; dump is next. The dispatch below is a chain of comparisons, which is the right shape for
; five commands and the wrong shape for twenty; when it grows, the table that
; Anything else that is not one of those is looked for as a program and run if it is
; found, so most of what the machine does is not in this list at all.
;
; The dispatch below is a chain of comparisons, which is the right shape for five commands
; and the wrong shape for twenty; it is eleven now, and when it grows the table that
; dispatchTest.asm demonstrates is where it should go.
;
; Written by Anachronaut
@@ -65,8 +71,6 @@ bootNoDisk:
CALL printString
CALL newLine
; ---- The loop ----
; ---- The loop ----
;
; The shell has two modes and one prompt that says which. Ordinary mode runs programs;