How to explicitly push / pop onto the C return stack?

Is there a way to explicitly point / put data on the C return stack? (Ideally, in the C standard, but the GCC solution will also be fine.)

I am implementing Forth in C on a microcontroller that works very tightly in RAM (kbytes, not megabytes).

I allocate RAM for the data stack, but I hope to save some RAM by splitting the Forth return stack with the C-stack return via explicit push / pops.

Can this be done in C?

+4
source share
1 answer

GCC has a __builtin_return_addressfeature that is likely to be closest to you.

+1
source

Source: https://habr.com/ru/post/1693011/


All Articles