Again, the GCC3 distribution has a port of the IP2K microcontroller.
It has a hardware call stack, but the data stack is implemented
entirely in software.
You will have to dedicate a register to act as the data-stack
pointer. I suppose if you limit yourself to
writing functions with NO stack-local data you might be able to keep
the SP as a virtual register and make sure
that code generation never tries to actually use it. You will also
be severely limited in the ability to
pass parameters if you only allow register parameters with no
parameter saving.
At this point, why bother writing a C compiler....
On Apr 10, 2006, at 03:54, Colm O' Flaherty wrote:
Does anyone have any ideas about what gcc support is like for
targets with no data stack? The 14 bit cores (16F) mostly have a
2-8 level hardware stack, which is not part of the program or data
memory, and is not addressable. There is no data stack.
I'm hoping that there is an existing backend architecture where
there is no stack, so that I can have a peep to see how the code
fakes stack support, but so far, all the obvious candidates (the
microcontrollers) seem to have a stack.
Ideas, anyone?
Colm