Give the system another page of each memory
CosmOS had 1,161 bytes of Program Memory left before the address applications load at, and Tab completion is not going to fit in that with anything to spare. So the wall moves up one page: the system keeps below 0x4FFF and 0x2FFF, and an application is based at 0x5000 and 0x3000. A PAGE IS A CHEAP THING TO GIVE IT AND AN EXPENSIVE THING TO RUN OUT OF. An application still has 44K of Program Memory before the vector table and the largest one here uses 7.5K, so what was taken from applications is space nothing has ever asked for - while what the system gained is the difference between building the next thing and counting bytes while building it. Not doubling, which was the version that would have cost application space worth minding. One page, and the same again when it is needed. Nothing in the machine knows where the wall is, so this is 34 #Base lines, one threshold in the fault handler, and the table in the CosmOS README that Tests/docs.sh reads its limits out of. The native assembler's scratch map had to move with it, and docs.sh said so before anything ran: its data reached 0x40D6 and its buffers began at 0x4000, so they were sitting on its variables. That file already carries a paragraph about the floor coming up and the map staying where it was. It has happened twice now, and been caught by a check the first time wrote. Twenty three recordings are the same runs a page higher. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
f97d15de08
commit
3449405b18
@@ -39,7 +39,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Banner
|
||||
@@ -72,7 +72,7 @@ deeper:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Banner:
|
||||
"two stops, and what the registers were at each
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#Include services.asm
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; One block, and ten bytes after it.
|
||||
@@ -81,7 +81,7 @@ noWrite:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Name:
|
||||
"claim.dat"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#Include services.asm
|
||||
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Arguments
|
||||
@@ -236,7 +236,7 @@ secondReadFailed:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Arguments:
|
||||
#Reserve 0d256
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#Include services.asm
|
||||
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Arguments
|
||||
@@ -232,7 +232,7 @@ doneFailed:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Arguments:
|
||||
#Reserve 0d256
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Argument
|
||||
@@ -124,7 +124,7 @@ crashWait:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
WordOpcode:
|
||||
"opcode"
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; ---- Room for a PATH, not a name ----
|
||||
@@ -869,7 +869,7 @@ addByteToWord:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Break:
|
||||
0x0A 0x00
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; Swap ValueB and ValueA.
|
||||
@@ -72,7 +72,7 @@ start:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
ValueA:
|
||||
; Low byte, high byte.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; Swap ValueB and ValueA.
|
||||
@@ -128,7 +128,7 @@ start:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
ValueA:
|
||||
; Lowest byte ... Highest byte.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; Load our initial values into A and B.
|
||||
@@ -38,6 +38,6 @@ start:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
#Include print.asm
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; ---- Write it ----
|
||||
@@ -133,7 +133,7 @@ noDelete:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Name:
|
||||
"kept.txt"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; ---- Reaching video memory ----
|
||||
@@ -411,7 +411,7 @@ everyCell:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
ScreenKept:
|
||||
0x00
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
CIF ; Nothing arrives until there is something to catch it.
|
||||
@@ -85,7 +85,7 @@ keyStop:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Banner:
|
||||
"keys, by interrupt. q stops."
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
CALL seedGlider
|
||||
@@ -350,7 +350,7 @@ delayDone:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
RowCount:
|
||||
0x00
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
INA 0x31 ; Which mode the screen is in now.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#Include services.asm
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Name
|
||||
@@ -139,7 +139,7 @@ finished:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
Usage:
|
||||
"more: give me a file name
|
||||
"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Wanted
|
||||
@@ -114,7 +114,7 @@ measureDone:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Prefix:
|
||||
"system "
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#Include services.asm
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Argument
|
||||
@@ -213,7 +213,7 @@ doneFailed:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Name:
|
||||
"poured.dat"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 LineText
|
||||
@@ -141,7 +141,7 @@ keySay:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
LineText:
|
||||
"a line, then keys. q stops."
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Saying
|
||||
@@ -45,7 +45,7 @@ start:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Saying:
|
||||
"starting again
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Given
|
||||
@@ -45,7 +45,7 @@ sayEnd:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
SaidText:
|
||||
"it says: "
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SWI osBootState
|
||||
@@ -71,7 +71,7 @@ alreadySettled:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
WasTrying:
|
||||
"the disk says a start is still in progress
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
RSTA
|
||||
@@ -140,7 +140,7 @@ printCandidateHex:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
; Segment has to begin on a page boundary, and now says so itself rather than relying on
|
||||
; whatever happens to have been assembled before it. The marking loop adds the prime to
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; Search the list until we find a prime.
|
||||
@@ -46,7 +46,7 @@ start:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
; The table of our prime candidates. It has to begin on a page boundary: marking walks
|
||||
; the pointer's low byte and treats the carry out as running off the end of the table,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; The two pointers whose low byte is a square number. Both regions are page aligned, so
|
||||
@@ -615,7 +615,7 @@ pauseInner:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
HeadCell:
|
||||
0x00
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SWI osLastStatus
|
||||
@@ -70,7 +70,7 @@ done:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Prefix:
|
||||
"the last program left "
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; ---- 1. How big is something that will not fit ----
|
||||
@@ -408,7 +408,7 @@ printWhy:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
BigName:
|
||||
"big.txt"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#Include services.asm
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Name
|
||||
@@ -70,7 +70,7 @@ finished:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
Usage:
|
||||
"type: give me a file name
|
||||
"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#Include services.asm
|
||||
#Program
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
; Where to go is the argument. Nothing else about this program says a directory name, so
|
||||
@@ -85,7 +85,7 @@ noFile:
|
||||
SWI osExit
|
||||
|
||||
#Data
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Where:
|
||||
#Reserve 0d64
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000 ; Above the system, which keeps below here.
|
||||
#Base 0x5000 ; Above the system, which keeps below here.
|
||||
|
||||
greet:
|
||||
SETD.0 Opening
|
||||
@@ -44,7 +44,7 @@ greet:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000 ; And its data above the system's.
|
||||
#Base 0x3000 ; And its data above the system's.
|
||||
|
||||
Opening:
|
||||
"a program, loaded off a disk, running on the system that loaded it
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000 ; Change two:
|
||||
#Base 0x5000 ; Change two:
|
||||
|
||||
SETD hello ; Change three
|
||||
Start:
|
||||
@@ -26,6 +26,6 @@ End:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000 ; Five, adjust the base of the data segment.
|
||||
#Base 0x3000 ; Five, adjust the base of the data segment.
|
||||
hello: ; Throw a label here so we can explicitly point at this data. Six, actually.
|
||||
"Hello, World!"
|
||||
|
||||
Reference in New Issue
Block a user