diff --git a/Programs/CosmOS/Apps/Edit.asm b/Programs/CosmOS/Apps/Edit.asm index be4b28f..ddc3cde 100644 --- a/Programs/CosmOS/Apps/Edit.asm +++ b/Programs/CosmOS/Apps/Edit.asm @@ -529,7 +529,6 @@ listStep: PSHD.3 POPD.0 DPUP.0 0d03 - SETD.1 Leftover LDA.1 BRA listEmpty listChars: @@ -723,7 +722,6 @@ writeOut: CCF SUB MVQA - SETD.0 WroteSize STA.0 ; WroteSize is now a count of bytes, which is what gets printed. ; And into the two registers the service takes a size in. diff --git a/Programs/CosmOS/Apps/Pour.asm b/Programs/CosmOS/Apps/Pour.asm index 197a0d2..5ec5afb 100644 --- a/Programs/CosmOS/Apps/Pour.asm +++ b/Programs/CosmOS/Apps/Pour.asm @@ -34,7 +34,6 @@ counted: LDA.0 BNA haveCount INIA 0d1 - SETD.0 Blocks STA.0 haveCount: @@ -159,7 +158,6 @@ countLoop: SETD.1 Blocks LDB.1 PSHA - RSTA INIA 0d10 CALL timesTen POPA @@ -191,7 +189,6 @@ tenLoop: CCF ADD MVQA - SETD.0 Scratch STA.0 POPA DECA diff --git a/Programs/CosmOS/Apps/Snake.asm b/Programs/CosmOS/Apps/Snake.asm index 12f444c..4f5621b 100644 --- a/Programs/CosmOS/Apps/Snake.asm +++ b/Programs/CosmOS/Apps/Snake.asm @@ -334,7 +334,6 @@ takeKeyTurn: XOR POPA BRQ takeKeyDone ; Opposite, so it is not a turn anybody can make. - SETD.0 Direction STA.0 RET @@ -430,7 +429,6 @@ stepDown: INIB 0xF0 AND MVQA - INIB 0xF0 XOR POPA BRQ stepWall ; The bottom row is where the high nibble is fifteen. @@ -453,7 +451,6 @@ stepRight: INIB 0x0F AND MVQA - INIB 0x0F XOR POPA BRQ stepWall diff --git a/Programs/CosmOS/Assembler/Asm.asm b/Programs/CosmOS/Assembler/Asm.asm index 0d03936..4c63542 100644 --- a/Programs/CosmOS/Assembler/Asm.asm +++ b/Programs/CosmOS/Assembler/Asm.asm @@ -1277,7 +1277,6 @@ dropColon: LDA.0 BRA dropColonDone DECA - SETD.0 TokLength STA.0 SETD.0 TokText SETD.1 DropWalk @@ -1525,7 +1524,6 @@ checkImageRoom: LDA.1 SETD.0 ImgOutBlocks STA.0 ; The high half is whole blocks. - SETD.1 ImgAsk INCD.1 LDA.1 SETD.0 ImgOutTail @@ -2034,7 +2032,6 @@ writeImage: LDA.1 SETD.0 ImgOutBlocks STA.0 - SETD.1 ImgTotal INCD.1 LDA.1 SETD.0 ImgOutTail diff --git a/Programs/CosmOS/Assembler/vectors.asm b/Programs/CosmOS/Assembler/vectors.asm index 2f6ee73..1e39956 100644 --- a/Programs/CosmOS/Assembler/vectors.asm +++ b/Programs/CosmOS/Assembler/vectors.asm @@ -189,7 +189,6 @@ vecReadFields: STA.1 INCD.0 LDA.0 - SETD.1 VecHandler INCD.1 STA.1 INCD.0 diff --git a/Programs/CosmOS/README.md b/Programs/CosmOS/README.md index a942d5f..16bb204 100644 --- a/Programs/CosmOS/README.md +++ b/Programs/CosmOS/README.md @@ -462,7 +462,7 @@ Typed in as bytes, checked by disassembling it back, and run. It ends with `SWI `Edit` is the first program on this machine that makes a file a person typed - every byte on every disk before it was put there by the host tool. It is line oriented in the manner of `ed`: `l` lists, `a` adds at the end, `i` and `c` and `d` take a line number, `w` writes and `q` stops. -It includes nothing but `services.asm` and `text.asm`: the filesystem and the console are the system's, asked for rather than carried. That is what brought `Edit` down from 4,941 bytes to 1,995 bytes without a line of its own logic changing - and the way that was checked is worth knowing, because the recorded output of the `cosmosEdit` test did not move by a single byte across the rewrite. +It includes nothing but `services.asm` and `text.asm`: the filesystem and the console are the system's, asked for rather than carried. That is what brought `Edit` down from 4,941 bytes to 1,983 bytes without a line of its own logic changing - and the way that was checked is worth knowing, because the recorded output of the `cosmosEdit` test did not move by a single byte across the rewrite. It keeps the document as a **linked list of lines** rather than one buffer with newlines in it. Each line says where the next one is, how long it is, and then its bytes. Inserting is two pointers changed and nothing moved; with a flat buffer it would mean shifting every byte after the edit, on a machine whose only block move is a device asked politely. The price is that deleted lines are not reused, so a heavy session uses more room than the document needs and writing it out is what tidies up. diff --git a/Programs/CosmOS/Source/cosmos.asm b/Programs/CosmOS/Source/cosmos.asm index c9dc41a..571f2e9 100644 --- a/Programs/CosmOS/Source/cosmos.asm +++ b/Programs/CosmOS/Source/cosmos.asm @@ -402,7 +402,6 @@ dirCheck: STA.1 SETD.0 SbfsFileTail LDA.0 - SETD.1 DirSize INCD.1 STA.1 @@ -446,12 +445,10 @@ dirDone: STA.1 SETD.0 DirSeen LDA.0 - SETD.1 DirTaken LDB.1 CCF SUB MVQA - SETD.0 DirSeen STA.0 SETD.0 DirSeen @@ -2327,7 +2324,6 @@ bankSet: LDB.0 SETD.1 BankWas STB.1 - SETD.0 DumpBank STA.0 ; Naming a bank puts the cursor at the start of it, which is the only answer that does @@ -2390,10 +2386,8 @@ showAt: LDA.0 SETD.1 DumpAt STA.1 - SETD.0 TextValue INCD.0 LDA.0 - SETD.1 DumpAt INCD.1 STA.1 @@ -2694,7 +2688,6 @@ showInstruction: CALL printByteHex INIA 0x20 OUTA 0x00 - INIA 0x20 OUTA 0x00 CALL aimAtDumpAt @@ -3210,7 +3203,6 @@ takeMnemonicPad: INIA 0x20 STA.1 INCD.1 - SETD.2 AsmLeft LDA.2 DECA STA.2 diff --git a/Programs/CosmOS/Source/sbfs.asm b/Programs/CosmOS/Source/sbfs.asm index 0044e5d..e7ae6d2 100644 --- a/Programs/CosmOS/Source/sbfs.asm +++ b/Programs/CosmOS/Source/sbfs.asm @@ -943,10 +943,10 @@ sbfsFirst: STA.0 BRI sbfsWalkScan +; The pointer and the count were stepped when the last entry was handed out, so there is +; nothing to do here but carry on looking - which is what the next label does, so this one +; falls into it rather than branching to the line below itself. sbfsNext: - ; The pointer and the count were stepped when the last entry was handed out, so there - ; is nothing to do here but carry on looking. - BRI sbfsWalkScan sbfsWalkScan: ; Anything left in the block in hand? diff --git a/Programs/CosmOS/Source/text.asm b/Programs/CosmOS/Source/text.asm index 7fdda6f..b9033bf 100644 --- a/Programs/CosmOS/Source/text.asm +++ b/Programs/CosmOS/Source/text.asm @@ -272,7 +272,6 @@ textNumberLoop: POPB CCF ADD ; And the digit. - SETD.1 TextValue STQ.1 SETD.1 TextDigits diff --git a/Programs/testPrograms/sbfsWalkTest.asm b/Programs/testPrograms/sbfsWalkTest.asm index c8c24e1..2844f1d 100644 --- a/Programs/testPrograms/sbfsWalkTest.asm +++ b/Programs/testPrograms/sbfsWalkTest.asm @@ -66,7 +66,6 @@ walkCheck: STA.1 SETD.0 SbfsFileTail LDA.0 - SETD.1 Size INCD.1 STA.1 diff --git a/Programs/testPrograms/waitTest.asm b/Programs/testPrograms/waitTest.asm index 619d527..7c927bd 100644 --- a/Programs/testPrograms/waitTest.asm +++ b/Programs/testPrograms/waitTest.asm @@ -26,7 +26,6 @@ start: OUTA 0xE8 RSTA OUTA 0x20 - RSTA OUTA 0x21 INIA 0x01 OUTA 0x22 diff --git a/Tests/expected/cosmosMonitor.out b/Tests/expected/cosmosMonitor.out index 83fb026..7dcf55f 100644 --- a/Tests/expected/cosmosMonitor.out +++ b/Tests/expected/cosmosMonitor.out @@ -63,7 +63,7 @@ finished * > greet.sbx 210 hello.sbx 52 Life.sbx 1409 -Snake.sbx 2175 +Snake.sbx 2167 Keys.sbx 663 Say.sbx 155 Break.sbx 148 diff --git a/Tests/expected/cosmosRun.out b/Tests/expected/cosmosRun.out index c471318..d835bb6 100644 --- a/Tests/expected/cosmosRun.out +++ b/Tests/expected/cosmosRun.out @@ -3,7 +3,7 @@ CosmOS > greet.sbx 210 hello.sbx 52 Life.sbx 1409 -Snake.sbx 2175 +Snake.sbx 2167 Keys.sbx 663 Say.sbx 155 Break.sbx 148 diff --git a/Tests/expected/cosmosSlowDisk.out b/Tests/expected/cosmosSlowDisk.out index 153bdcc..c998466 100644 --- a/Tests/expected/cosmosSlowDisk.out +++ b/Tests/expected/cosmosSlowDisk.out @@ -2,7 +2,7 @@ CosmOS > greet.sbx 210 hello.sbx 52 Life.sbx 1409 -Snake.sbx 2175 +Snake.sbx 2167 Keys.sbx 663 Say.sbx 155 Break.sbx 148 diff --git a/Tests/expected/cosmosTreeWrite.out b/Tests/expected/cosmosTreeWrite.out index 561e2a3..6192d57 100644 --- a/Tests/expected/cosmosTreeWrite.out +++ b/Tests/expected/cosmosTreeWrite.out @@ -1,13 +1,13 @@ CosmOS > Folder -Edit.sbx 1995 +Edit.sbx 1983 1 file, 1 directory > loaded, starting at 4000 > note.txt, 0 lines > : : : > written, 67 bytes > finished > Folder -Edit.sbx 1995 +Edit.sbx 1983 note.txt 67 2 files, 1 directory > halted