a <address>, then instructions until a line that is just a dot. The syntax is the assembler's own: a selector rides on the mnemonic as LDA.0 or LDD.0.1, and leaving one off means Data Pointer 0 exactly as it does in a source file, so nothing learned at the monitor has to be unlearned when writing a program. Case is folded, since the assembler does not care either. Numbers are hexadecimal and bare. A source file writes 0x2000 or 0d16 because it has both and must say which; a monitor has one and says so once, in the manual, rather than on every line. It reads the same table the disassembler does, searched the other way round, which is the point of it being a table rather than two lists: what a writes, d reads back, and neither can drift from the other or from the assembler both were generated from. Instruction lengths come from the shared shape table too, so the cursor cannot get out of step with what was written. THE WHOLE LINE IS UNDERSTOOD BEFORE ANYTHING IS WRITTEN. Emitting the opcode first and discovering a missing operand afterwards leaves half an instruction in memory, which the next line usually covers up and the last line of a session does not. Written that way first and fixed. What cannot be written is a label, and that is the whole difference between this and the assembler proper: a label is a promise to fill an address in later, and later is what a line at a time does not have. The recorded test now types in a complete program - a string poked into Data Memory, instructions assembled into Program Memory, and the result run - and includes a lower case mnemonic, both selector forms, an instruction that does not exist and one missing its value, so the refusals sit beside the successes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 lines
344 B
Plaintext
17 lines
344 B
Plaintext
CosmOS
|
|
> loaded, starting at 2000
|
|
> two stops, and what the registers were at each
|
|
break at 200E
|
|
A 11 B 22 Q 00 status 00
|
|
DP0 1030 DP1 0661 DP2 039A DP3 2000 SP FFFF
|
|
press a key
|
|
break at 2023
|
|
A 44 B 55 Q 00 status 00
|
|
DP0 1000 DP1 0661 DP2 039A DP3 2000 SP FFF5
|
|
press a key
|
|
carried on to the end
|
|
finished
|
|
> halted
|
|
Execution halted.
|
|
[exit 0]
|