diff --git a/Programs/CosmOS/README.md b/Programs/CosmOS/README.md index 6e218bf..8c6bacc 100644 --- a/Programs/CosmOS/README.md +++ b/Programs/CosmOS/README.md @@ -263,6 +263,10 @@ prompt rather than at the shell. `x` and `d` share a position, and each leaves it after what it displayed, so either may be given without an address to continue from where the last one stopped. +**Everything the shell does still works in the monitor**, since it is a mode of the shell +rather than a different program: a program can be started by name, `dir` still lists, and a +word that is nothing at all is still told so. + For example: ```text diff --git a/Programs/CosmOS/Source/cosmos.asm b/Programs/CosmOS/Source/cosmos.asm index 354d966..5a89e55 100644 --- a/Programs/CosmOS/Source/cosmos.asm +++ b/Programs/CosmOS/Source/cosmos.asm @@ -331,6 +331,20 @@ promptWhere: CALL textSame BRQ doAssemble + ; ---- And a word the monitor does not know either ---- + ; + ; It goes where the shell's unknown words go, which is the disk, because the monitor is a + ; MODE of the shell rather than a different program and everything the shell can do is + ; still supposed to work in it. + ; + ; THERE WAS NOTHING HERE AT ALL, and the fall through was into sayPrompt - a routine, which + ; ended in a RET that had nothing of its own to return to. So it took whatever the Stack + ; held and went there. Sometimes that was 0x0003, in the middle of newLine, and the machine + ; stopped on a byte that is not an instruction; once it was inside sbfsFormat, and the + ; machine formatted the disk it had booted from. The tell was a SECOND prompt printed + ; before the wreckage, which is sayPrompt doing exactly what it is for on its way past. + BRI promptUnknown + ; Where you are, and then the prompt itself. A routine rather than a run of code in the loop, ; because the loop is no longer the only thing that needs it - see shellReadTyped. sayPrompt: diff --git a/SplitBit Test Manual.md b/SplitBit Test Manual.md index 88170ac..a66dbea 100644 --- a/SplitBit Test Manual.md +++ b/SplitBit Test Manual.md @@ -79,7 +79,7 @@ from `make`, not from here. ### 1. Recorded output `Tests/run.sh` assembles each program named in `Tests/manifest`, runs it, and compares -everything it printed against a file in `Tests/expected`. 196 tests, of which 134 run, 35 +everything it printed against a file in `Tests/expected`. 197 tests, of which 135 run, 35 only assemble, 16 are expected to fail to assemble, and 11 boot from ROM with no image given at all. diff --git a/Tests/expected/cosmosMonitorRun.out b/Tests/expected/cosmosMonitorRun.out new file mode 100644 index 0000000..5b58768 --- /dev/null +++ b/Tests/expected/cosmosMonitorRun.out @@ -0,0 +1,42 @@ +CosmOS +> monitor +x examine, d disassemble, a assemble, s set, b bank, g go, exit leaves +* Say hello from the monitor +it says: hello from the monitor +finished +* Crash opcode +that byte is not an instruction, at 4081 + A 00 B 0F Q 00 +the program was stopped +* nonsense +I do not know: nonsense +* b program +bank 00 +* exit +> dir +greet.sbx 211 +hello.sbx 53 +Life.sbx 1396 +Snake.sbx 2164 +Keys.sbx 664 +Say.sbx 156 +Break.sbx 149 +Grid.sbx 559 +Press.sbx 872 +Mode.sbx 48 +Crash.sbx 632 +notes.txt 21 +Apps