Put the application hello.asm on the disk, not the bare metal one

Both are called hello.asm and they are different programs: Programs/hello.asm
is the 1978-style boot image that writes straight to port 0x00 and HALTs,
and CosmOS/Apps/hello.asm is the loadable one that ends with SWI osExit.
The disk had the first, which assembles to a .bin the shell cannot load, so
watching it work meant taking the file off the disk afterwards.

Now it has the second, and the whole thing is two commands:

    > load Asm.sbx
    > run hello.asm
    wrote hello.sbx: program 22, data 14, labels 3
    > load hello.sbx
    > run
    Hello, World!

It writes over the hello.sbx the host tool put there, so what runs is the
machine's own work. Byte for byte identical to the C assembler's, as ever.

strings.asm stays as it is, and now earns its place by being the odd one
out: no #Include and no #Base, so it assembles to a boot image rather than
a loadable program and the difference between the two is visible on one
disk.

Tests/native.sh still builds the bare metal hello.asm, and should: it is the
only thing that checks the SPBT path end to end, including running what came
out.

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-20 22:55:05 -04:00
co-authored by Claude Opus 5
parent c5e4ec3455
commit 04424a8917
+12 -8
View File
@@ -84,23 +84,27 @@ cosmos: $(COSMOS) $(APPS) $(NATIVE_ASM)
# Made from scratch every time, so that what is on it is what is in Apps/ now and not
# also whatever used to be.
$(COSMOS_DISK): $(APPS) $(NATIVE_ASM) hello.asm testPrograms/stringKeyword.asm \
CosmOS/Apps/Say.asm CosmOS/Source/services.asm
$(COSMOS_DISK): $(APPS) $(NATIVE_ASM) testPrograms/stringKeyword.asm \
CosmOS/Apps/hello.asm CosmOS/Apps/Say.asm CosmOS/Source/services.asm
@mkdir -p $(@D)
rm -f $@
$(DISKTOOL) format $@ 2048 4
@for app in $(APPS); do $(DISKTOOL) put $@ $$app; done
$(DISKTOOL) put $@ $(NATIVE_ASM)
@# SOURCE goes on as well, because an assembler with nothing to assemble is a
@# demonstration of nothing. hello.asm and strings.asm are boot images built from one
@# file; Say.asm is an application, which needs the include and the service names.
@# demonstration of nothing.
@#
@# Assembling Say.asm writes Say.sbx over the one the host tool put there, so the
@# machine ends up running a program it built itself.
$(DISKTOOL) put $@ hello.asm
$(DISKTOOL) put $@ testPrograms/stringKeyword.asm strings.asm
@# hello.asm and Say.asm are the APPLICATION versions, so each assembles to a .sbx
@# written straight over the one the host tool put there - which means the next
@# thing loaded is a program the machine built itself, in the same breath.
@#
@# strings.asm is the odd one out on purpose: it has no #Include and no #Base, so it
@# comes out as a boot image rather than a loadable program, and the difference
@# between the two is visible on one disk.
$(DISKTOOL) put $@ CosmOS/Apps/hello.asm
$(DISKTOOL) put $@ CosmOS/Apps/Say.asm
$(DISKTOOL) put $@ CosmOS/Source/services.asm
$(DISKTOOL) put $@ testPrograms/stringKeyword.asm strings.asm
# The system as well as the disk. Building only the image leaves whatever cosmos.bin was
# there before, or none at all, and then the disk is booted with a system that does not