
Xtal BASIC is the BASIC most Einstein owners actually used. It came in the box, on the machine's own System Master, and nearly all the type-in listings and user group programs of the period were written in it. Type XBAS at the DOS prompt and the machine answers with TATUNG/Xtal BASIC 4.2 and Ready, which is where a great many Einstein programs began.
This course teaches it from the very beginning, for people who have never programmed as well as for people who want to read those old listings and understand what they are doing. It covers version 4.2 and nothing else - the version on the System Master, and the one on the course disc. Xtal BASIC did not stand still, and later versions differ.
You do not need to own an Einstein. Everything here runs on an emulator on your own computer, and everything you need is free.
Like our Z80 assembly course, and unlike the Dr Logo and SuperForth courses, this one builds towards a single game: Mouse In A Hole, a one-screen platform game in which a mouse runs and jumps between platforms, collects five pieces of cheese, avoids two patrolling cats, and gets home to its hole. Every section teaches one part of the language and uses it, and from the halfway point every section adds something to the game. You save each stage to the disc as you go.
Thirty-five sections and four appendices. The first half is the language: typing at the machine, programs, editing, saving to disc, sums, variables, text, asking questions, decisions, loops, subroutines, arrays, data and chance. The second half is the Einstein and the game: colour and text placement, drawing and filling, reading the screen back, characters of your own, sprites, the playing field, the mouse, gravity and jumping, cheese, cats, collisions and lives, winning, sound, making it faster, a title screen with a best time kept on the disc, and finally compiling it with Xtal's own BASIC compiler, which runs it twice as fast. It ends by reading MASTERMIND, one of the programs Tatung shipped on the System Master in 1984, and with a look at where to go next - including the way down into machine code, and our assembly course.
Every section has the same shape: an explanation, a listing to type, what you should see, a few single changes to make with a question attached to each, exercises, and the failures we actually hit. Worked solutions to every exercise are in an appendix.
It is written for both keyboards. Keys are called what the Einstein calls them, which is all you need at a real Einstein; wherever a key is somewhere else on a modern keyboard under MAME, a line beginning In MAME says where, and an appendix has the whole keyboard in one place.
Three things, all free: MAME, the Einstein ROM, and the Xtal BASIC Course Disc from our Downloads page. The disc carries Xtal BASIC 4.2 exactly as Tatung shipped it, the nine BASIC programs Tatung put on the System Master with the menu that runs them, the finished game so you can play it and read it whenever you like, Xtal's compiler, and 64K of free space for your own work. It is an .mfi rather than a .dsk because MAME will not write to a .dsk, so on a .dsk the first program you tried to keep would be lost. The second section sets all of it up, for macOS and for Windows.
The same way as the other courses. Every eight-bit BASIC looks like every other one until it does not, and the places they differ are exactly the places a course gets wrong. So nothing here is taken from another BASIC, from a general BASIC tutorial, or from a manual alone without first running it on the machine and watching what happens. Tatung's own manuals were read first, for what to test and what to call things; where a manual and the machine disagree, the machine wins.
That mattered. Xtal BASIC looks at only the first five letters of a name, and a name with a keyword inside it is quietly taken apart - SCORE is read as SC OR E, which is not an error until the line runs. The manual prints DRAW (40,70) TO (90,80), and on the machine the brackets are a Syntax Error. The arrow keys type square brackets instead of moving the cursor. When two sprites touch, the machine remembers it until a program asks, so an unwary game takes two lives for one touch. While two keys are held, the keyboard reports neither. And under MAME no key at all stops a running program, not even BREAK, so the course shows you how to give every loop a way out from the start. Every one of those is in the course because the machine showed it to us.
Every listing and every exercise solution was run on Xtal BASIC 4.2 before it was written down, and every screenshot is of the machine actually doing it. The sounds were checked by recording the emulator's audio. Some three hundred recorded experiments stand behind the thirty-five sections, and they are kept so that any claim can be checked again. What has not been done is a test on real hardware: the course was written and checked entirely under emulation, and if you follow it on a real Einstein we would like to hear what differs.
The language is also in the library on the TC01 System Master Disc as XBAS.COM. Tatung's own Einstein BASIC manual covers every keyword, and Relatively BASIC goes further into graphics, sprites and memory.
This course was written with Claude Code, directed and tested 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.