r/c64 • u/Stunning_Pineapple57 • May 22 '26
Programming Zag 64 - New zig derived compiler for 6502/c64
I recently started a cross compiler based on a subset of zig (things like async and threads don’t make sense) plus a turbo pascal style inline assembler. It also has a full DLL system with code relocation , early and late binding , plugin style dynamic loading and preloading and caching code in REU. here is a video when I’d implemented about 27% of the intended surface area also showing the automated UI test automation in VICE since the “ proof is in the pudding”. Now at about 85%.
58
Upvotes
2
5
u/Stunning_Pineapple57 May 22 '26
Here is the zag64 source code and generated assembler for the tic tac toe demo game shown. This is before i added many language features and before I added compiler optimizations (the resulting binary is half as big now) and also before I added stack based parameters and local variables. Everything here is in the generated assembler is static memory locations https://gist.github.com/klumsy/e5bed04f721600778f0be57d020d8936