lynn/chibicc

Accessing Values deep in the Stack

PythonLinks opened this issue · 0 comments

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 run your C compiler. My question is, can your C compiler access variables lower on the stack? The problem is that on FPGAs often stacks are implemented in registers, or in a different memory block. Forth only gives access to the top two elements of the stack.

If you do not allow access to items lower on the stack, perfect. If you do, then there would be a problem using this software.

Thank you.