Ruud's Commodore Site: Pascal Compiler Home Email

Pascal Compiler

What is it

Preferring Pascal above C, I decided to write a Pascal compiler for my C64. Yes, there are various compilers available like Oxford-Pascal and the Data-Becker version but I wanted one with the capabilities Borlands Turbo Pascal.

The first idea was to write one in ML but then the idea rose to write it in Pascal with the idea that, in the end, it should be capable of compiling itself. Pascal alone is not enough, there must be a ML component anyway. The next idea was to generate ML after splitting a line up in its components. But the general idea was that the compiler should run on various machines: C64, PET, CBM, Plus/4 etc., etc. I even had some Z80 machines in mind. This meant that I had to reserve programlines for every type of machine for every component and that was a bit too much. Then I got the great idea to generate macros only! Macros can be completely independent of the used machine and/or processor. The only thing I had to do was to tell the assembler what file to use when translating the macros into ML.

At this moment I'm writing the macro file for the C64. The only thing that works reasonibly well is WRITELN. And writing to files is not covered yet :( The reason for this is that I keep on running into problems I simply hadn't expected. And most problems had nothing to do with WRITELN itself. On the other hand, with "FOR ... (DOWN)TO ... DO ..." I had results within minutes. But here I encountered other problems. Still lot of work to do.....

Sources of both the compiler and assembler are free. If you want to know more about the whole thing, email me.

Having questions or comment? You want more information?
You can email me here.