Hacks, science and curiosities

The ZX BASIC Compiler

I finally achieve it!! The ZX Spectrum BASIC compiler does really work! 😉 Yes, my first home computer was the ZX Spectrum 48K, as you surely have already guessed and it left an impressive mark on my soul.

As a child, one of my dreams was to write a compiler for this machine; to have the power of transform the slow ZX Spectrum BASIC to Machine Code, and to be able to develop games or other interesting programs without having to deal with assembler language.

And so the years passed, my ZX Spectrum grew old and disappeared… 🙁 but not that dream of making up my own Spectrum BASIC Compiler. Due to my lack of knowledge at first (I studied Computer Sciences at the university) and the lack of time later it was not possible to me to make it until today (and yes, I’m a bit thrilled). 🙂

If you ever wanted your BASIC programs to be fast, I encourage you to give it a try. Brief Information

Ok, If you’ve reached here, you are probably interested. Read this, please:

What is it exactly?

It’s an SDK entirely written in python (using PLY as LALR parser) which runs on your PC.

What does it do?

You write a program in a BASIC dialect using your preferred text editor, and this program translates it into ZX Spectrum (Z80) machine code.

Which platforms does it run on?

It runs on every platform where python does. This includes, of course, Linux, Windows and Mac. It only requires you to have installed the python interpreter in your computer. For Windows there’s also a .MSI installer version which does not requires python, since it is already bundled with the compiler

How do I transfer the program to my Speccy?

There are several ways. This tool allows you to create .bin and .tzx files. To test your program you can use a ZX Spectrum emulator (there are tons of them on the internet). You can also convert your TZX program to .MP3 or .WAV and record it on a CD or cassette, to load it as you always did! 😉

Where can I find out more?

There are two main sites: The Wiki (in English) and the forum.

Where can I ask for help?

At the forum created for that, and also at the Speccy forum.

Where can I download it?

Go to the download page to get the most recent version.

For more info, please visit the Wiki F.A.Q section. I will put some tutorials there in a short period of time. The compiler keeps developing and extending, until I reach my next goal…