
Your Z80 programs can print, read the keyboard, loop and call subroutines, but nothing they make survives the Einstein being switched off. This primer teaches them to use the disc: to read and write files, and then to read and write the disc with no DOS at all. You learn it by building one program, DISKMON, a disc monitor that gains one command in each section.
You need to know Z80 assembly first. The primer follows on from Z80 Assembly for the Tatung Einstein and does not teach registers, loops or RST 8 again. Inside the Einstein: The Disc and Inside the Einstein: The MOS are worth doing as well; the primer recaps the page of each that it needs.
Twenty eight sections and four appendices, in five parts. The first part sets up the routine of assembling DISKMON, putting it on a disc image and running it under XtalDOS, and makes the first call to the BDOS. Through the DOS uses XtalDOS's file calls: naming a file, opening it, reading it record by record or at random, writing, deleting and renaming, and what happens when the DOS says no. Under the DOS asks the MOS for sectors by drive, track and ID, then reads the directory and a whole file by hand and writes a sector back. Without the DOS takes XtalDOS away: a disc that starts DISKMON by itself, and a program that reads any record of a file with no DOS loaded. The Controller drives the floppy disc controller through its ports: moving the head, listing a track's sector IDs in the order they pass under it, and reading a sector byte by byte.
Part five works on SECRET.DSK, a practice disc whose sector IDs on four tracks are letters that spell out a message. Reading IDs like these is how you find the hidden message on Dragon's Lair; the course reads its own disc, not that one.
z80asm and MAME, set up as in the Z80 assembly course, with the Einstein System ROM and the TC01 System Master Disc (XtalDOS). Python 3 and edisc.py, the disc image tool from Inside the Einstein: The Disc Course Files. From S10 on, the Einstein Disc Tools, so that MAME can keep what DISKMON writes. The practice discs, DISKMON at the end of every section and the finished program are one download, Assembly Disc Access Primer Course Files. The practice discs were made for the course, so you can do what you like to them.
The same way as our other courses. Every listing was assembled with z80asm and run in MAME 0.289 (MOS 1.2, XtalDOS 1.31) before it was written down, and each screen shown is the screen that run produced. Everything DISKMON writes was read back by other software, either XtalDOS's own DIR and DISP after a fresh start or edisc.py, so a program agreeing with itself was never taken as proof. The primer has been run in MAME only, not yet on a real Einstein.
This course was written with Claude Code, directed by Gavin Watson. We say so openly because we think it is the right way to use these tools, and because you deserve to know how the thing you are learning from was built.
This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.