Close

C Compiler

A project log for SPAM-1 - 8 Bit CPU

8 Bit CPU in 7400 with full Verilog simulator and toolchain

john-lonerganJohn Lonergan 05/09/2022 at 17:130 Comments

Currently struggling with undertstanding the VBCC C compiler with the idea of creating a back end for SPAM-1.

I read up on LLVM and decided that was probably impossible for me.

VBCC looks a lot simpler, certainly lines of code needed, but it's the style of C code with lots of single letter variables and little commenting in the code and some massive functions. It would be nice if the code were documented with the text that's in the PDF that's been written. I don't like having to switch to a PDF to figure things out.

Still others have done it. 

There is an existing 6502 back end and another 8 bit port called 832 but I really wanted to start by seeing a really minimal impl with no optimisations at all as otherwise it's pretty incomprehensible understanding what's needed. I wrote C for yearas and never regretted moving on and this stuff is hard work.

If (when) I figure it out then I may do a write up or video on what I did if it seems useful to others.

Discussions