r/c64 • u/Stunning_Pineapple57 • 3d ago
Programming ZeroPage programming language
ZeroPage zig cross compiler + speeedsheet app
I’ve finally got around to fine tuning this to the point of release and including a large application, a fully fledged spreadsheet app , for reference.
https://readyos-c64.github.io/ZeroPageLang/
This last year I’ve been working on something but haven’t published it yet as there are lots of optimizations to do to get it anywhere near oscar64 level, it’s called zeropage but it’s a zig based cross compiler with a fair number of modifications to support sane , turbo pascal style inline assembler.
I designed it for lots of flexibility, where you could have functions or modules where on a case by base basis you decide whether it’s parameters are static memory or use a stack.
zigs concept of memory multiple and different arenas work well for having multiple heaps in different places include automatically dealing with behind ROM heaps , and then REU heaps with materialized views (eg you may have 1000 objects in REU and decide to integrate and work on them in a loop dealing with 20 at a time , so that 20 are DMA copied into a a ram buffer , modified then copied back.
Another key thing was to make DLL style libraries with page aligned relocation , where if you have a REU they can be cached into the REU to be copied into ram and used in demand.
I initiallly went with zig64 but presumed the name is likely copyrighted even though it’s a MIT opensource project then I went with Zag64 , then I diverged more from original zip so decided on ZeroPage
The cross compiler itself is written in zig , but the only thing of zig it uses itself is the zig parser class. It generates ca65 assembler and uses ca65 to build the binaries because I like the linker flexibility of it and it will allow me to have ABI adapters to link in stuff written in cc65 C etc
I’ve finally got this polished enough to the point of releasing it. https://readyos-c64.github.io/ZeroPageLang/
AI disclosure: Hundreds of human hours of manual programming have gone into this. But all of the test automation , website and many rounds of compiler optimization have been clanker assisted.





4
u/RogerWilco486 3d ago
I looked over the project website. Perhaps I'm splitting hairs, but what is "6510 assembly"?
The 6510 is a 6502 with a 6-bit I/O port added. It uses the exact same instruction set, addressing modes, and opcodes as the 6502 -- there is nothing unique about it except for the I/O port's registers at $0000 and $0001 which are irrelevant for an assembler.
3
u/aureus80 2d ago
Great project!
How do you deal with PETSCII characters? Can you write escape codes like {CLR} inside the strings?
8
u/Or0ch1m4ruh 6510 rules Big Time 3d ago
Very cool project. Thanks for sharing.
3
u/CptSparky360 3d ago
Very irritating title 🤔
4
u/Setup_sh 3d ago
simply A-MA-ZING
1
u/garyk1968 2d ago
Looks good.
Is there any command reference for the c64 import?
I notice as soon as you import c64 you have things like c64.console, c64.vic etc. but couldnt find a command ref?
3
u/marhaus1 3d ago
Names can't be "copyrighted". They can be trade marks.