production

PhrozenC

Download 2010_phrozenc.zip

Credits

  • Code — NoRecess
  • Engine — Small-C, by Ron Cain

Credits as they appear in the release.

PhrozenC is a C compiler based on original SmallC K&R compiler (1981 !). I added some minor features such as using #include option or tweaking memory usage. Also made a version running on a real CPC (file-based/ROM version) !

Small-C was written by Ron Cain in 1980, for the CP/M machines of the day — which includes the Amstrad CPC. Early in 2010 I came across its source again, compiled it for the PC, and found it remarkably small in memory. For the fun of it, as with most projects, I tried a real CPC port. It did not work as expected at first; it took a good many headaches before it did.

What it does is simple enough: it turns a C file and everything it includes into a single assembly source, ready for Arnor’s Maxam or Richard Wilson’s WinAPE. It compiles in a single pass, so it never has to hold the whole program in memory at once.

The versions

  • Windows — a stand-alone command-line program.
  • CPC 464 / 464+ — a stand-alone program that uses the entire memory of the machine, destroying whatever was there before. Released for compatibility, and not the version to reach for.
  • CPC 6128 / 6128+ — driven through an RSX, using the extra 64K to hold the compiler compressed and to leave the first 64K as it was.
  • CPC 6128 / 6128+, ROM — an RSX again, using the upper 48K (banks C5, C6 and C7) while leaving resident memory and bank C4 untouched. This is the one to use alongside the Arnor ROMs — Protext, Maxam and Promerge.

Screenshots

A C source open in Protext, including PRINT.C and printing the alphabet in a loop
The source, written in Protext on the machine itself.
The CPC startup banner listing PARADOS, PROTEXT, MAXAM and PhrozenC V1.0, then a compilation reporting no errors
PhrozenC announcing itself among the Arnor ROMs, and a compilation ending on nought errors.
The generated Z80 assembly open in Protext, starting at org &4000
What comes out: one assembly source, ready for Maxam.