r/c64 • u/hobbycollector • Jul 06 '26
Software Made some progress on the Tiny Pascal compiler for the c64
Currently it doesn't run the Pascal program, it just creates p-codes in memory. https://github.com/wfahle/c64-tiny-pascal See : https://archive.org/details/the-byte-book-of-pascal/page/68/mode/2up for more information.
42
Upvotes
11
u/TwoBitRetro Jul 07 '26
Cool! I wrote a Pascal compiler for the MEGA 65. I wrote it mainly because I wanted to write a compiler.
2
u/Alarming_Cap4777 Jul 06 '26
Are there issues with the current C64 Pascal compilers that you're trying to solve?
1
u/LiqvidNyquist Jul 08 '26
Nice project. I wrote a DOS-hosted Pascal for z80 back in the early 1990s, it emitted p-code style virtual insns to a text file which I then treated as macros and ran through a sefcond translator which emitted sequences of actual assembly insns. Worked well enough for some example programs like a calculator, but there were so many corner cases with stuff like records and pass-by-reference IIRC that it started to become diffcult to keep a decent regression test suite going. Always a fan of people building these kinds of things, so good luck with it!