LLVM-based C/C++ compiler for Challenger 1P

Post Reply
stm
Posts: 63
Joined: Mon Oct 27, 2014 10:23 pm
Location: Germany

LLVM-based C/C++ compiler for Challenger 1P

Post by stm »

Hi,

I had watched the llvm-mos and llvm-mos-sdk project already for a while. These two projects together provide a 6502 C/C++ compiler, based on very current LLVM compiler technology.

With a great deal of help by the project owners I was able to contribute a target for the C1P over the past few weeks. It is now in a state where it starts to become useful. One can write to the screen and read from the keyboard.

In the current state it is not yet an equal competitor for cc65, because there's only rudimentary library support, but this will likely improve over time. But from the point of view of C and C++ language standards support llvm-mos wins hands down... And one could even build a Rust compiler based on this technology (cough).

If anybody wants to try this, building programs for the Challenger 1P is not well documented yet. The SDK can be built easily according to the instructions in the llvm-mos-sdk README file, but the binary programs must be converted with the SRecord srec_cat tool into a format that can be loaded over the serial port.

After successfully building the SDK this would be an example how to convert one of the OSI C1P example programs into a loadable file that can be loaded over the serial port at address 0x200 and which is started then automatically:

Code: Select all

srec_cat build/examples/osi-c1p/hello-getchar -binary -offset 0x200 -o hello-getchar.hex -Ohio_Scientific -execution-start-address=0x200
Best regards
Stephan
C1P Model 600 CPU 1978 REV B, 40K (8K original and 32K BillO memory expansion), RS-232
Maintainer of cc65 OSI target and llvm-mos-sdk C1P target
Post Reply