Add Type and More, and the file stream they are built on

Two applications that read a file too big for Data Memory: Type prints one,
More pages it. Both sit on fileStream.asm, which wraps osFileInfo and
osFileBlock into open-and-next so an application walks a file's blocks without
repeating the service calls.

The disk fixture is deliberately awkward: readable.txt crosses several blocks
and carries no zero byte to be mistaken for an end marker, and empty.txt says
that zero blocks is a valid file rather than an error.

These three files were written by ChatGPT, as their headers record.

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-24 17:15:53 -04:00
co-authored by Claude Opus 5
parent 4fd8bf7b3f
commit dbe58db660
10 changed files with 544 additions and 0 deletions
+10
View File
@@ -316,6 +316,14 @@ cosmosServices | CosmOS/Source/cosmos.asm | run | cosmosFil
# notice the file moved - and that one would otherwise pass, since the blocks are still
# there and still hold the same bytes.
cosmosStream | CosmOS/Source/cosmos.asm | run | cosmosStream.in | - | disks/stream.img
# A useful application made out of the streaming primitive: print a named text file without
# requiring it to fit in Data Memory. The fixture crosses block boundaries, includes a full
# 256-byte block, and also checks empty, missing, and absent filename cases.
cosmosType | CosmOS/Source/cosmos.asm | run | cosmosType.in | - | disks/type.img
# The same stream with interaction layered on it. Three runs exercise q, a whole screen
# with Space, and one line with Return. The input is intentionally packed so that the one
# byte the pager consumes leaves the next shell command immediately behind it.
cosmosMore | CosmOS/Source/cosmos.asm | run | cosmosMore.in | - | disks/type.img
# The assembler's front end, checked in two pieces before anything is built on it.
#
# cosmosSource reads a source file and prints it back. The file crosses a block boundary,
@@ -340,6 +348,8 @@ app-Break | CosmOS/Apps/Break.asm | assemble | -
app-Edit | CosmOS/Apps/Edit.asm | assemble | - | -
app-Files | CosmOS/Apps/Files.asm | assemble | - | -
app-Stream | CosmOS/Apps/Stream.asm | assemble | - | -
app-Type | CosmOS/Apps/Type.asm | assemble | - | -
app-More | CosmOS/Apps/More.asm | assemble | - | -
# The assembler that runs on the machine, and its parts. Checked on their own so that a
# failure reads as "it does not assemble" rather than as a broken disk image.
asm-Asm | CosmOS/Assembler/Asm.asm | assemble | - | -