Framework for extended opcodes and enables user stacks with push_stack and pop_stack.
You can find a working example in examples/test_assembly_files/user_stack.zap.
Since there is no functionality for top on user stacks, I implemented this functionality in an custom routine. Might be worth to add this as a library function.
There's also no direct way of finding out whether a stack is empty or not (kind of a bummer when you don't know how much data was pushed on the stack). You'd have to keep track of the size of the stack and check against the first word on the stack.
Framework for extended opcodes and enables user stacks with
push_stack
andpop_stack
.You can find a working example in
examples/test_assembly_files/user_stack.zap
.Since there is no functionality for
top
on user stacks, I implemented this functionality in an custom routine. Might be worth to add this as a library function.There's also no direct way of finding out whether a stack is empty or not (kind of a bummer when you don't know how much data was pushed on the stack). You'd have to keep track of the size of the stack and check against the first word on the stack.