zeroflag / punyforth

Forth inspired programming language for the ESP8266
Other
406 stars 43 forks source link

TASKS - when restarting a task, the data and return stack are not empty #61

Closed bob-g4bby closed 3 years ago

bob-g4bby commented 3 years ago

I may be misusing TASKS or there's a bug in my code, but when restarting a task that has deactivated itself, the data stack seems to be decremented by 8 and the return stack by 4. To patch this, I initialise the re-run tasks stacks with s0 sp! r0 rp! and all runs properly. See attached test file. multitask test.zip

bob-g4bby commented 3 years ago

Must be a bug in my code - a simpler version works just fine, with no stack creep. Sorry for false issue. multitask test 3.zip