Home » 2021 » March » 21

function stack ...option

// function or subroutine call
inside curly baraces is internal interpreter code


myFunc()
{ fnStack[index] : fst = index }
...
label CONTINUE
..
.|.
.V.
...................
func myFunc()
....................
label HERE:
{ fst = fst - 1 }

// recursive call from inside //

if TRUE
..............
myFunc()
..............
{ fst = fst + 1 }
{ index = fst }
{ pos = fnStack[index] } -> return to label HERE
end if

.........
endFn
.........
{ fst = fst + 1 }
{ pc = fnStack[fst] } -> return to label CONTINUE
Views: 59 | Added by: Zlatko | Date: 2021-03-21 | Comments (0)