Open vitiral opened 1 year ago
I realized that creating tmp variables is fairly trivial actually. The basic syntax is:
tmp( myTmp1: Type1 = (...), myTmp2: Type2 = (...) ) do ( ... use tmp variables ...)
Basically what this does is
tmp <grow return stack by size of tmp variables > do <use tmp variables> <shrink return stack by size of tmp variables>
What the compiler does is:
tmpOffset
tmp
var
GRS
no ret
Something like that
I realized that creating tmp variables is fairly trivial actually. The basic syntax is:
Basically what this does is
What the compiler does is:
tmpOffset
. This starts at the function locals offset.tmp
is executed it creates a comp function that treats every symbol as a tmp variablevar
to behave this way as welltmpOffset
and incrementtmpOffset
by size, just likevar
GRS
(Grow Return Stack) to grow the RS by that amountno ret
-- no continues, breaks, or returns inside of atmp
variable (the stack will never be reduced).Something like that