A breakpoint that shows every register as the program had them, waits for a key, and carries on. NOTHING IS OVERWRITTEN, and that is the design rather than a shortcut. A breakpoint poked into a running program has to replace an instruction, and putting that instruction back in order to continue is the same act as disarming the breakpoint; firing a second time would mean stepping over the restored instruction and putting the breakpoint back behind it, and this machine cannot step a single instruction. SWI is two bytes, dispatches through a vector, and its frame already holds the address after it, so RETI resumes at the next instruction with nothing to restore and nothing to re-arm. It fires every time it is reached. The price is that a breakpoint is part of the program: a build with them in has different addresses from a build without. That is the bargain every machine with a break instruction makes. Every value shown comes out of the frame rather than the registers, because by the time the handler runs the registers are the handler's. Apps/Break.asm stops twice so that the second stop is checked as well as the first. Also here, found by the test that came with it: the monitor's s wrote into whichever bank was selected, and bank 2 is the controller's own table, published read only. Writing to it was refused, and a refusal nobody catches stops the machine - so selecting the bank table to look at it and then typing s killed the session. bankPresent now keeps the whole flags byte and s declines. The recorded output of cosmosMonitor had contained that crash, having been blessed without being read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
61 lines
2.0 KiB
Plaintext
61 lines
2.0 KiB
Plaintext
CosmOS
|
|
> x examine, d disassemble, s set, b bank, g go, exit leaves
|
|
* b <program|data|number>
|
|
* there is no such bank
|
|
* loaded, starting at 2000
|
|
* bank 00
|
|
* 2000 47 00 10 00 SETD.0 1000
|
|
2004 18 10 SWI 10
|
|
2006 47 00 10 44 SETD.0 1044
|
|
200A 18 10 SWI 10
|
|
200C 47 00 10 7A SETD.0 107A
|
|
2010 27 1F INIB 1F
|
|
2012 18 11 SWI 11
|
|
2014 47 00 10 5D SETD.0 105D
|
|
* 2000 47 00 10 00 18 10 47 00 10 44 18 10 47 00 10 7A G.....G..D..G..z
|
|
2010 27 1F 18 11 47 00 10 5D 18 10 47 00 10 7A 18 10 '...G..]..G..z..
|
|
2020 47 00 10 65 18 10 18 12 00 00 00 00 00 00 00 00 G..e............
|
|
2030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
|
* bank 01
|
|
* 1000 61 20 70 72 6F 67 72 61 6D 2C 20 6C 6F 61 64 65 a program, loade
|
|
1010 64 20 6F 66 66 20 61 20 64 69 73 6B 2C 20 72 75 d off a disk, ru
|
|
1020 6E 6E 69 6E 67 20 6F 6E 20 74 68 65 20 73 79 73 nning on the sys
|
|
1030 74 65 6D 20 74 68 61 74 20 6C 6F 61 64 65 64 20 tem that loaded
|
|
* bank 02
|
|
* 0000 01 FF 00 00 00 00 00 00 01 FF 00 00 00 00 00 00 ................
|
|
0010 03 FF 08 00 00 00 00 00 01 20 01 00 00 00 00 00 ......... ......
|
|
0020 00 FF 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 ................
|
|
0030 00 FF 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 ................
|
|
* that bank will not be written
|
|
* bank 00
|
|
* * 8000 26 48 INIA 48
|
|
8002 D1 00 OUTA 00
|
|
8004 26 0A INIA 0A
|
|
8006 D1 00 OUTA 00
|
|
8008 18 12 SWI 12
|
|
800A 00 ADD
|
|
800B 00 ADD
|
|
800C 00 ADD
|
|
* H
|
|
finished
|
|
* 8000 26 48 INIA 48
|
|
8002 D1 00 OUTA 00
|
|
8004 26 0A INIA 0A
|
|
8006 D1 00 OUTA 00
|
|
8008 18 12 SWI 12
|
|
800A 00 ADD
|
|
800B 00 ADD
|
|
800C 00 ADD
|
|
* > greet.sbx 210
|
|
hello.sbx 52
|
|
Life.sbx 1411
|
|
Snake.sbx 2175
|
|
Keys.sbx 663
|
|
Say.sbx 155
|
|
Break.sbx 128
|
|
notes.txt 21
|
|
8 files
|
|
> halted
|
|
Execution halted.
|
|
[exit 0]
|