I finally did it!! The ZX Spectrum BASIC compiler really works! š
Yes, my first home computer was the ZX Spectrum 48Kāas youāve probably already guessedāand it left a lasting impression on me.
As a child, one of my dreams was to write a compiler for this machine: to have the power to transform slow ZX Spectrum BASIC into Z80 machine code and to be able to develop games or other interesting programs without struggling with assembler language.
Years passed, my ZX Spectrum grew old and faded away⦠š but that dream of creating my own Spectrum BASIC compiler never did. At first, it was due to my lack of knowledge (I later studied Computer Science at university), and later, it was because of a lack of time. But today, Iāve finally made it happenāand yes, Iām a little thrilled! š
If youāve ever wanted your BASIC programs to run faster, I encourage you to give it a try.
Brief Information
If youāve made it this far, youāre probably interested. Hereās what you need to know:
What is it exactly?
Itās an SDK entirely written in Python (using PLY as the LALR parser) that runs on your PC.
What does it do?
You write a program in a BASIC dialect using your preferred text editor, and this tool compiles it into ZX Spectrum (Z80) machine code.
Which platforms does it run on?
It runs on any platform that supports Python, including Linux, Windows, and macOS. All you need is the Python interpreter installed on your computer. For Windows users, thereās also an .MSI installer that bundles Python with the compiler, so you donāt need to install it separately.
How do I transfer the program to my Speccy?
There are several ways:
- This tool lets you create .bin and .tzx files.
- To test your program, you can use a ZX Spectrum emulator (there are tons of them available online).
- You can also convert your TZX program to .MP3 or .WAV and record it onto a CD or cassette, just like the old days! š
Where can I find out more?
Check out these two main resources:
Where can I ask for help?
You can ask for help on:
- The dedicated forum
- The Speccy forum
Where can I download it?
Visit the download page to get the latest version.
For more information, check out the FAQ section in the Wiki. Iāll be adding tutorials there soon.
The compiler is still evolving and expanding as I work toward my next goalā¦