Break shows registers it chose, not ones it inherited

Break left DP1 and DP2 alone, so what a stop printed for them was whatever the
shell happened to have left there - which is a CosmOS address, which moves
whenever CosmOS is touched at all. The recorded output had to be taken again
four times in one day's work, every time for a value that is not this program's
and that nothing should ever depend on.

It sets all three of the pointers it owns now, rotated between the two stops so
that every one of them visibly changes, the way A and B already did. DP3 stays
as the system left it: it is where the program was entered, which is the one
thing worth seeing here that this program did not choose, and it is steady
because it is this program's own base.

A demonstration of what the registers were should show registers somebody
chose. Then every line of the record is being asserted rather than merely
observed, and a reader can tell which is which.

Checked both ways: sixty four bytes added to CosmOS's data no longer moves it,
and reading the frame at the wrong offset still fails it.

cosmosRun and cosmosMonitor move because Break is sixteen bytes longer and both
of them list the disk it sits on.

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 17:13:49 -04:00
co-authored by Claude Opus 5
parent fb7b224bbb
commit 00d896e3e7
5 changed files with 33 additions and 7 deletions
+21
View File
@@ -17,6 +17,23 @@
; Correct output is two stops. A and B differ between them, the addresses differ, and the
; Stack Pointer differs too, because the second one is inside a subroutine and a call has
; put ten bytes down by then.
;
; EVERY POINTER IS SET BEFORE EACH STOP, and the three this program owns are rotated
; between the two so that all of them visibly change.
;
; This program used to leave DP1 and DP2 alone, and what a stop then showed for them was
; whatever the shell happened to have left there. That is a real thing about the machine -
; a program is handed the pointers as it finds them - but it is not this program's to
; demonstrate, and it made what this program prints depend on where CosmOS's code happens
; to sit. The recorded output had to be taken again four times in one day's work, every
; time for a value nothing should ever depend on.
;
; A demonstration of what the registers were should show registers somebody chose. Then
; every line of it is being asserted rather than merely observed.
;
; DP3 is deliberately still the system's. It is where the program was entered, which is the
; one thing here worth seeing that this program did not choose, and it is steady because it
; is this program's own base.
#Include services.asm
@@ -31,6 +48,8 @@ start:
INIA 0d17
INIB 0d34
SETD.0 Marker
SETD.1 Banner
SETD.2 DoneText
SWI osBreak
; The second stop is inside a subroutine, so that the Stack Pointer is visibly not where
@@ -45,6 +64,8 @@ deeper:
INIA 0d68
INIB 0d85
SETD.0 Banner
SETD.1 DoneText
SETD.2 Marker
SWI osBreak
RET