chibicc
chibicc copied to clipboard
A small C compiler… for uxn
C has a single address space for the stack and other variables. I am building stack machines running Forth. I am considering buiding a Uxn compatible stack machine that can...
I'm trying to see if I can compile rxi's `fe` with `chibicc-uxn`, and the former has a bunch of function pointer typedefs it uses all around the code: ```c typedef...
There are really two steps here: 1. Get the project to a point where `chibicc-uxn.exe` (running in Windows/Linux/etc) can compile the codebase to `cc.rom`, and this `cc.rom` can compile something...
Right now something like ```c #include void main(void) { int n = asm("#1234"); } ``` compiles to ```tal |0100 LIT2r 0000 main_ POP2r BRK ( bss ) ( data )...
Hello :) I have a couple more ideas for optimizations. - I see in the generated code a few instances of `#00 ORA`, which could be removed. - Static arithmetic...
If `x` and `y` are structs of the same type, `y = x` should copy all the fields, maybe using something like `memcpy`. A test that should pass: ```c assert(9,...
Hi, First off, following the changes to chibicc is exhilarating! Amazing work you two. The following suggestion is taking advantage of _not using Harvard Achitecture_, I was wondering if maybe...
Currently all local variables and function arguments get written to and read from an in-memory stack (`@rbp`). This makes for pretty ugly and inefficient assembly. In many cases such variables...
Currently we do all arithmetic in 16-bit, even when the operands and destination are 8-bit (i.e. `char` types). This is a very single-pass-compiler and C thing to do (surely this...
initialization uses `store` to load the initial value, but `store` only loads the first two bytes, so the rest of the struct is left uninitialized. ``` typedef struct { char...