in reply to Is recursion allowed?
in thread Algorithm Pop Quiz: Sorting
set I0, 100 bsr FUNC print I0 # Gives 100 end FUNC: pushi set I0, 56 popi ret
local() for a particular registister can be emulated but it's a pain in the ass with something like:
The answer to your other question (asked in /msg) is that no, you can't peer down the stack or get the stack's depth at this time. However you can simulate peering into the stack just fine with the tools given.set I0, 100 set I1, 200 set I6, 700 bsr FUNC # print I0 # 100, original value print I1 # 0, new value print I6 # 0, new value end # Local changes to I1 and I6 preserved # think of this as unlocal() :) FUNC: pushi # saves all integer registers set I0, 0 set I1, 0 set I6, 0 save I1 save I6 popi restore I6 restore I1 ret
|
---|