[Tinycc-devel] call out from assembler

2024-04-27 Thread Paul Moore
I expected to be able to use .extern to declare a symbol that exists in another compile unit so I can call out. But there is no .extern directive. I see globl and global but they seem to be identical and used for exporting symbols not importing them.

[Tinycc-devel] trying to make absolute jump

2024-04-21 Thread Paul Moore
Weird processor. It only supports absolute jumps. So this is something that needs to be fixed up during link time. I do not know the elf details well enough to be able to work out how to do it Seems like I need the jmp instruction to be a have reloc that refers to a symbol that matches the

Re: [Tinycc-devel] new backend

2024-04-17 Thread Paul Moore
I want to create a lite c compiler for the HACK computer described in “the elements of computing systems” aka ‘nand to tetris’ – here, Home | nand2tetris. A fun read. I have implemented the system on an fpga and want to cross compile c code to it. It’s a 16bit

Re: [Tinycc-devel] warning: function might return no value:

2024-04-16 Thread Paul Moore
ion> seems way way out of date Any guidance, gotchas, tips are welcome From: tinycc-devel-bounces+paulmoore100=hotmail@nongnu.org On Behalf Of Paul Moore Sent: Tuesday, April 16, 2024 2:42 PM To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] warning: function might return no value:

[Tinycc-devel] warning: function might return no value:

2024-04-16 Thread Paul Moore
Right at the start of creating my own backend, just making it trace all calls to it and do the minimum to not have the compiler complain. Overcome a few issues but: Compiling examples/fib.c I get warning: function might return no value: I simplified it a bit so I could follow the code path

Re: [Tinycc-devel] confused about reg_classes

2024-04-16 Thread Paul Moore
>>I hope this helps, >>Ekaitz My original confusion stemmed from R_RET, I read it as returning what type of register to use for return values. Plus the fact that the upper level tccgen code deals in register types not registers (gv(rc), not gv(r)). Now I get it: R_RET says "use this

[Tinycc-devel] confused about reg_classes

2024-04-15 Thread Paul Moore
Writing my own backend. I am trying to understand reg_classes On the face of it, it looks like a list of registers with flags saying what classes they are in (int , float..) So get_reg works down the table looking for registers of the right class, fine, got it. But the RC_RET function uses a