I need a C compiler for my homebrew CPU project SPAM-1.
I tried porting GCC and LLVM but it's a hopeless task.
Luckily the VBCC compiler is a hell of a lot easier to port and there are some other examples to look at.
If you want to see the VBCC code then
I've written some test scripts here for the compiler https://github.com/Johnlon/spam-1-vbcc/tree/main/demo
The SPAM-1 back end for the compiler is https://github.com/Johnlon/spam-1-vbcc/blob/main/vbcc/machines/g/machine.c
Hi I don't understand the question. SPAM-1 has a 64k address space and VBCC like many C compiler use a short by default.
In C if you only want to range your values to 10 or 12 bits then isn't that feasible ? As far as I am aware there is no 10 or 12 bit datatype in most C.
I am aware that the CHIP-8 interpreter uses 12bit address but that's not C.