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
88 lines
1.6 KiB
NASM
88 lines
1.6 KiB
NASM
; Status.asm
|
|
; Says what the last program made of what it was asked to do.
|
|
;
|
|
; The shell keeps the number and does not print it, because a program that failed has
|
|
; already said so in words and a number beside that would be noise. But a number nobody can
|
|
; see is a number nobody can trust, so this is how a person looks.
|
|
;
|
|
; 0 it did what it was asked
|
|
; 1 it did not
|
|
; 2 it was asked wrongly
|
|
;
|
|
; A program may give its own meanings if it says so, and Compare does: one there means the
|
|
; files differ, which is a result rather than a failure.
|
|
;
|
|
; Written by Anachronaut
|
|
|
|
#Include services.asm
|
|
|
|
#Program
|
|
|
|
#Base 0x5000
|
|
|
|
start:
|
|
SWI osLastStatus
|
|
MVQA
|
|
SETD.0 Was
|
|
STA.0
|
|
|
|
SETD.0 Prefix
|
|
SWI osPrintString
|
|
|
|
; A and B together, most significant first - so the status is the LOW half. Put in A the
|
|
; first time this was written, which printed a status of two as five hundred and twelve.
|
|
RSTA
|
|
SETD.0 Was
|
|
LDB.0
|
|
SWI osPrintNumber
|
|
|
|
; And in words, for the three the system itself uses.
|
|
SETD.0 Was
|
|
LDA.0
|
|
BRA sayWorked
|
|
INIB 0d1
|
|
XOR
|
|
BRQ sayFailed
|
|
SETD.0 Was
|
|
LDA.0
|
|
INIB 0d2
|
|
XOR
|
|
BRQ sayAsked
|
|
BRI done
|
|
|
|
sayWorked:
|
|
SETD.0 WorkedText
|
|
SWI osPrintString
|
|
BRI done
|
|
sayFailed:
|
|
SETD.0 FailedText
|
|
SWI osPrintString
|
|
BRI done
|
|
sayAsked:
|
|
SETD.0 AskedText
|
|
SWI osPrintString
|
|
|
|
done:
|
|
SETD.0 NewLine
|
|
SWI osPrintString
|
|
RSTA
|
|
SWI osExit
|
|
|
|
#Data
|
|
|
|
#Base 0x3000
|
|
|
|
Prefix:
|
|
"the last program left "
|
|
WorkedText:
|
|
", which is: it did what it was asked"
|
|
FailedText:
|
|
", which is: it did not"
|
|
AskedText:
|
|
", which is: it was asked wrongly"
|
|
NewLine:
|
|
"
|
|
"
|
|
Was:
|
|
0x00
|