hex.push¶
Like: stack[sp+1:][:M] = hex[:n]; sp += n.
Pushes the given hex[:n] to the next M cells in the stack. Increments sp by M.
M is (n+1)/2, which is because the function pushes the entire parameter as bytes.
Note: This macro pushes bytes to the stack (2 hexs in one stack-cell).
Note: The push/pop usage must be coordinated, and every push X must be untangled by a pop X (or a sp_sub (X+1)/2)
For example: “push 3; push 3” can’t be read with a “pop 6”. That’s because each “push 3” takes 2 stack cells,
while the "pop 6" only pops out 3 stack cells (so there is another cell that needs to be popped.
Signature¶
def push n, hex { ... }
Defined in hex/pointers/stack.fj — lines 85–88 (view on GitHub).
Complexity¶
Time:
n(w(0.38@+ 3) + 13@+ 25)Space:
n(w(0.56@+16) + 11@+128)
See the complexity glossary for what @, w, dw, dbit, n mean.