Mastering Machine Code on Your ZX81
By Toni Baker

Sinclair ZX Spectrum
THUNOR'S FOREWORD
When I was young I would drool over magazine adverts for the ZX80 and ZX81 and eventually persuaded my parents to buy me a ZX81, followed by a 16K RAM pack. I would hog the TV playing with BASIC and wrote a snazzy fruit machine program that took 2 hours to type in (I didn't have a suitable tape deck to save/load programs). What I didn't do was learn Z80 assembly and how to write machine code programs, although I did eventually embrace 8086 assembly which got me my first job in computing. Now that I'm older and have the opportunity to do so, I would like to complete my experience of the ZX81 and write some games in machine code and I found this wonderful book via World of Spectrum (->). Unfortunately it's a PDF where each page is an image of the original, which is acceptable for a desktop computer but I like to read books on portable devices in comfy chairs or in bed, and so I've decided to convert this book to HTML whilst reading and learning from it.

Seeing as this book is a freely downloadable PDF and is very unlikely to experience another print run, I'm not expecting anyone to object although I and everyone else should acknowledge that it is a copyrighted work. What I found particularly poignant when transcribing this material is that Tim Hartnell -- an extremely prolific, bestselling author of books and magazines (->) -- who wrote the foreword, died of cancer in 1991 aged 40.

As far as my transcription goes, I've accomplished the following:

  • Corrected spelling mistakes and Anglicised the English.
  • Proof-read each paragraph or block at transcription time to minimise errors.
  • Removed surplus words and erroneous information using strikethrough.
  • Added missing words, corrections and additional information [within square brackets] with the following exceptions:
    • When adding corrections to program listings (I don't want to introduce characters into code listings) although it is quite clear that my corrected code follows the erroneous code, and in some cases I've added a comment.
    • When the whole document is an addition (such as the page you are currently reading or appendix six) although there will be a comment or something obvious that indicates the document originates with me.
  • Conventionalised the instruction listings throughout the first half of the book by showing the hex-code on the left of the instruction to avoid confusion with operands.
  • Typed-in the programs for the ZX81 (and some for the ZX80) using the z81 emulator (->), fixing bugs where time, scope and willingness allowed and offered the programs for download.
  • Added comments using this format: [Thunor: This is a comment about something important.].
  • Added links to program downloads using this format: [Download available for 16K ZX81 -> chapter16-lenslist.p].
  • Kept the preformatted code width below 80 characters to aid viewing in a reduced width screen or text only browser such as lynx (->).
  • Used ASCII text equivalents of the original illustrations to aid viewing in a text only browser.
  • Added content such as the ZX80 HEXLD3 listing and the complete Draughts listing.
  • Enhanced content such as the more detailed HEXLD3 listings and the Memory Organisation diagram.
I welcome feedback from readers via email. Possibly something needs correcting or maybe you've managed to debug a program that I couldn't; let me know and I'll credit you with the correction at the bottom of the relevant page.

--
Thunor - 9th August 2009

Sinclair ZX Spectrum

  Previous Page Back Next Page