Difference between revisions of "Talk:ZSAVE"

From IFWiki
Jump to: navigation, search
(an idea to fix the problem with it)
 
Line 7: Line 7:
 
--[[User:Vaporware|Vaporware]] 15:52, 8 July 2013 (UTC)
 
--[[User:Vaporware|Vaporware]] 15:52, 8 July 2013 (UTC)
  
:Actually, Aimfiz and Fweep just allocate local variables on the data stack (so there might be less than fifteen); each frame stores a pointer to the start of its data stack (so that it can be discarded when the call returns). I did omit the variable number to store the result for the reason you have specified (the documentation even explicitly says this). However, I did forget the argument count, though. --[[User:Zzo38|Zzo38]] 18:00, 8 July 2013 (UTC)
+
:Actually, Aimfiz and Fweep just allocate local variables on the data stack (so there might be less than fifteen); each frame stores a pointer to the start of its data stack (so that it can be discarded when the call returns). I did omit the variable number to store the result for the reason you have specified (the documentation even explicitly says this). However, I did forget the argument count, though (an idea for a way to fix it might be: <tt>snnncccc cccccccc aaaaaaaa aaaaaaaa aaaaaaaa</tt>, where n is the number of arguments; if I implement this then I will also update the documentation). --[[User:Zzo38|Zzo38]] 18:00, 8 July 2013 (UTC)

Latest revision as of 18:18, 8 July 2013

Call stack fields

The call stack format described here has fewer fields than Quetzal's:

  • No variable number to store result. This isn't required: for frames whose result is not being discarded, the interpreter can look at the byte before the return PC to get the @call opcode's store target.
  • No count of local variables. This is required for some interpreters, but presumably Aimfiz and Fweep always allocate 15 local variables for each routine.
  • No count of arguments passed into the routine. I believe this is required for @check_arg_count to work.

--Vaporware 15:52, 8 July 2013 (UTC)

Actually, Aimfiz and Fweep just allocate local variables on the data stack (so there might be less than fifteen); each frame stores a pointer to the start of its data stack (so that it can be discarded when the call returns). I did omit the variable number to store the result for the reason you have specified (the documentation even explicitly says this). However, I did forget the argument count, though (an idea for a way to fix it might be: snnncccc cccccccc aaaaaaaa aaaaaaaa aaaaaaaa, where n is the number of arguments; if I implement this then I will also update the documentation). --Zzo38 18:00, 8 July 2013 (UTC)