
Turbo Pascal, Borland's Pascal of 1983, put three things in one program small enough for a home computer: a menu, a screen editor and a compiler that turns what you type into real Z80 machine code in seconds, without ever leaving the editor. Type TURBO at the Einstein's DOS prompt and it signs on as TURBO Pascal system Version 2.00A, CP/M-80, Z80.
This course teaches it from the very beginning, on the Einstein. It covers version 2.00A for CP/M-80 and nothing else - the version on the site's Turbo Pascal disc and on the course disc. Later Turbo Pascals, on the Einstein and elsewhere, differ, and nothing here is taken from them.
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 Xtal BASIC course, this one builds towards a single game: Warehouse, a block-pushing puzzle in the manner of 1982's Sokoban, in which a warehouse worker pushes crates onto their goals - never pulling, one crate at a time. It has six levels, undo as far back as you like, a best score for each level kept on the disc, a display of everywhere the worker can reach, a level editor, and pictures of its own drawn into the Einstein's character set. Every section teaches one part of the language and uses it, and in the last part every section adds a piece to the game.
Thirty-nine sections and four appendices. The first part is the language: Turbo's menu and editor, saving and compiling, numbers, text, questions, decisions, loops, procedures and functions, a function that calls itself, your own types, sets, arrays, records, files and pointers. The second is the screen and the keyboard: putting text where you want it, reading a key the moment it is pressed, chance, and reaching into the Einstein's memory and video chip. The third is the game, a piece a section, ending with it compiled into a program that runs without Turbo at all. Then you read a real program - MicroCalc, the spreadsheet Borland shipped with Turbo Pascal, written for a screen twice as wide as the Einstein's - and change two lines to make it fit. The last section looks at machine code inside a Pascal program, and the way on to our assembly course.
Every section has the same shape: an explanation, the code 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. Everything you type is typed into Turbo's own editor on the machine, as an owner in 1984 would have, and every line fits its 40-column screen.
It is written for both keyboards. Keys are called what the Einstein calls them; 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 - and all of the editor's control keys - in one place.
Three things, all free: MAME, the Einstein ROM, and the Turbo Pascal Course Disc from our Downloads page. The disc carries Turbo Pascal 2.00A set up for the Einstein's 40-column screen, the finished game so you can play it and read it whenever you like, the complete source of MicroCalc, and 80K 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.
The same way as the other courses. Pascal is a standard language with a famous family of compilers, and almost everything that can be read about Turbo Pascal describes a later version, a different machine, or the language in the abstract - and almost all of it is nearly right. So nothing here is taken from another Turbo Pascal, from a Pascal textbook, or from Borland's manual alone without first running it on the machine and watching what happens. The 1984 manual was read first, for what to test and what to call things; where the manual and the machine disagree, the machine wins.
That mattered. As it comes on its disc, Turbo is set up for an 80-column screen, and its DELETE key deletes a whole line; set up for 40 columns as Borland's installer offers, it wipes a program's output off the screen the moment the program ends. A procedure that calls itself gives wrong answers - silently - unless the program starts with the directive {$A-}. The manual says IOresult is a Boolean; on the machine it is a number. The arrow keys type characters instead of moving the cursor. And a loop cannot be stopped from the keyboard at all unless it was compiled to allow it. Every one of those is in the course because the machine showed it to us. And the reason for a compiler at all is there too: a compiled loop on the Einstein runs about 39,000 times a second, where Xtal BASIC manages about 850.
Every listing, every change and every exercise solution was compiled and run on Turbo Pascal 2.00A before it was written down, and every screenshot is of the machine actually doing it. Some two hundred recorded runs of over three hundred test programs stand behind the thirty-nine 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 disc as Borland sold it is in the library as Borland Turbo Pascal, and Borland's own Turbo Pascal Version 2.0 Reference Manual covers everything in the language.
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.