It is totally new to me that a for loop is using the stack. stack is used for nested function calls to find the return adress. For is basicly only a variable and a label including a branch-on-condition command
a=0
amax=100
.label
; whatever
a=a+1
if a< amax then goto .label
the vars are alocated anyway. No stack used as far as I see.
What you cannot do and this would leave trash on the stack is when you would leave functions with a goto, esp. when there are nested calls of multiple functions, or even recursive ones. So you soon would have a stack overrun.
a=0
amax=100
.label
; whatever
a=a+1
if a< amax then goto .label
the vars are alocated anyway. No stack used as far as I see.
What you cannot do and this would leave trash on the stack is when you would leave functions with a goto, esp. when there are nested calls of multiple functions, or even recursive ones. So you soon would have a stack overrun.