Quantx/dgnsdk

C compiler usable?

Opened this issue · 5 comments

Hi,

I compiled the assembler on my raspberry pi, and it works well - unfortunately not on microsoft C though (0b constants and in-line declarations away from the beginning of the block are not standard C). I have added the K command to my own Nova 1210 console (that runs in a Teensy microcontroller on my custom built front panel), so that I can load the output. So far so good. I also noted a minimal C compiler - but this is incomplete in this repository. If it were complete (as in the dgmcc repository), would it be usable in any way?

Just curious!

Marcel

The C compiler I originally wrote in the dgnmcc repository had a number of glaring flaws and was in desperate need of a rewrite. Now that dgnasm is mostly done, rewriting the minimal C compiler will be my next project.

Hi, let me know when the compiler is ready for a bit of testing. Like ti run some more stuff on my Nova!

The C compiler is definitely in the home stretch, but as the saying goes, "The last 10% of the project takes 90% of the time." I'm currently working on re-writing the assembler to better support the features needed by the C compiler. Once that's done I'll be able to finish the compiler and then write a linker which can actually spit out a program you can run on a Nova.

I should point out that while this C compiler is (mostly) compatible with C89 it is in no way comparable to a modern compiler. This compiler requires some understanding of what is going on under the hood. While it is capable of preforming some optimizations for you, the programmer is expected to know what pitfalls to avoid and to be able to structure their code in an efficient way if they intend for it to be run in an especially efficient manner.