Welcome to the Parallax Discussion Forums, sign-up to participate.
For Spin in the Prop2, I plan to use the CLUT as the Spin stack...
Heater. wrote: »
Are we talking about the call stack only? Or data stack? Or is there only one stack for both?
If parameters and local variables are on the CLUT stack it means Spin programs cannot get their addresses any more.
I suspect not many programs want to do that but it might be worth remembering.
I think it would break Lonesock's F32 floating point object for example.
cgracey wrote: »
It's a combined stack. And, yes, it would make locals only directly addressable. Any indexed variables would have to be declared in main memory using VAR. The upside to this is that you are not likely to run out of stack space having only 256 longs because you wouldn't be putting arrays on the stack. And recursive calls would have to be very limited.
Do you guys see this as much of a problem? I look at it as if locals were something akin to registers.
Bill Henning wrote: »
In an ideal world, it would be nice to have two versions of the Spin interpreter - one with the stack in the CLUT, and one with the stack in the hub.
The CLUT version should be a little faster, but it will break some existing Spin code and limit call stack depth.
The HUB version would not break existing code, and allow deep stack nesting (and recursion)