I have a program here that sits very low on memory.
Something like 35 bytes are free. One function in that
program is a stack-eater - it eats up about 20 bytes on
a stack. If the interrupt handler is executed while whithin
that function - stack overflow.
I tried to avoid the problem by marking the stack-hungry
function "critical" to prevent the possibility of it to be
interrupted. But it still locked up after some time.
It turned out that the interrupts gets disabled after the
stack pointer gets incremented in the function prolog,
which leaves a small window where the inthandler kills
I think making sdcc to disable the interrupts before
incrementing the stack pointer, may not be difficult.
Can this be done?
Right now I have to enforce the callers to
disable/reenable interrupts themselves.