stl.call (arity 2)¶
Saves the return address to the stack and jumps to the given “address”.
When returned, it removes the return-address from the stack, and pops “params_stack_length” cells from the stack.
note: the pop_ret_address is for the future return (counts as space, but not time, complexity).
@Assumes: stack has room (caller-side responsibility).
@Assumes: stack has room (caller-side responsibility)
Signature¶
def call address, params_stack_length @ return_label { ... }
Defined in ptrlib.fj — lines 52–60 (view on GitHub).
Complexity¶
Time:
<3w@ (exact: w(2.25@+10) + 37@+57)Space:
<3w@ (exact: w(2.625@+49) + 43@+251)
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires init¶
The following must be initialised before this macro is invoked:
the stack_init.
Source¶
Click to view the macro body
def call address, params_stack_length @ return_label {
hex.push_ret_address return_label
;address
pad 2
return_label:
hex.pop_ret_address return_label
hex.sp_sub params_stack_length
}
Depends on¶
← Previous: stl.call/1
Next: stl.return →