
Every program you wrote in the assembly course ended the same way. It returned, and something took over: the screen filled with a row of register values and a > appeared, waiting. Every character you printed went through RST 8 followed by 158; every key you read, through 156 or 181. You called these hundreds of times. You never saw what answered.
What answered is the MOS - the Machine Operating System - 8,192 bytes of program that live in a ROM chip inside the Einstein. This course opens it up.
The MOS is small enough to read completely, and old enough that its design choices are visible on the surface. By the end of this course you will know:
Ready.RST 8 calls reach it - including the clever part: how the MOS answers a call even when its own code is switched out of sight.> prompt works - one table of 85 addresses doing two jobs.You read the MOS as source code: a listing of all 8K, with every instruction at its ROM address. The source has been checked the only way that counts - assembling it gives back the original ROM, byte for byte - so anything you read in it is exactly what the machine runs. Where the original authors' names for routines are known, the source uses them: OUTC for the routine that prints a character, FMTBL for the table of calls.
Each section looks at one part of the MOS, says what it does and why it was built that way, and then gives you something to run: a small program that pokes at the MOS from outside, a monitor command, or a changed ROM. Now and then, where it really pays, a section ends with Change one thing: a single edit and a question. Predicting the result before you look is the quickest way to find out whether you have understood.
LD, CALL and RET, the stack, RST 8 calls, hex. Nothing here is harder than its later sections, but nothing is explained twice.There is nothing to assemble yet. Start the Einstein as you always have and look at what the MOS puts on the screen before you have done anything:
*** EINSTEIN ***
Insert disc in drive 0 and
press Ctrl-BREAK to load
TATUNG/Xtal MOS 1.2 (C) 1983 1984
Ready
>
Every character there was put on the screen by the MOS, using the same print routine your programs call. By S10 you will know where each one came from - the letters' shapes included.
What you should see
The screen above. The version number after MOS is the one this course teaches: 1.2.
The MOS is the 8K program that starts the Einstein, runs the > prompt and answers every RST 8 call. This course reads it as checked source code, one part at a time, and ends with you building and booting your own version.
S2 steps back to the machine the MOS runs on: what an 8-bit computer is made of, and what the MOS has to work with.
This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.