Retargeting a C Compiler to 6502 — 8bitworkshop documentation #82
Replies: 3 comments 1 reply
-
I have written a C compiler specifically for 6502. It is of course still a work in progress but I do have support for most of C.
And the list the things I do have:
The compiler is written in C#. Optimisation could of course be better (it always can). Stuff that the optimiser does:
In case this is of interest to anyone I would be happy to write a short article about it. Obviously I'm not doing this for commercial purposes and I would be happy to share this source sourcecode. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a fun project! I'm sure someone would find it informative, and it's an interesting design space to explore. I've found that getting a test suite to run and pass is the hardest part ;) One idea I've been kicking around is a hybrid model, where you have 8/16 bit native 6502 code mixed in with 16-bit VM code (I think PLASMA attempts this). The more I play with small systems, the more I realize how much can be done with metaprogramming and mixing execution models, like Infocom's Z-Machine. I also hope that 8bitworkshop can use C# code someday. Maybe Blazor can translate to JS? I haven't looked into it much. |
Beta Was this translation helpful? Give feedback.
-
You should look at kickc ... |
Beta Was this translation helpful? Give feedback.
-
Retargeting a C Compiler to 6502 — 8bitworkshop documentation
I’ve written before about cc65 and some of its optimization challenges. It’s a stable compiler with a robust toolchain, but its code generator doesn’t full advantage of the 6502 when performing 8-b...
https://8bitworkshop.com/docs/posts/2020/retargeting-a-c-compiler-to-6502.html
Beta Was this translation helpful? Give feedback.
All reactions