Sums up the entire stack, and replaces contents of the stack with the sum.
Clears the entire stack.
Adds 1
/0
/-1
to stack if the topmost value on stack is >
/==
/<
than the second topmost value.
Pops a value from stack. Removes that many additional values from stack.
Duplicates the topmost value on stack.
Reverses the entire stack.
Merges all numbers on stack together, character-wise.
[1, 20, 300] -> [120300]
Increments a value on stack. Someone told you that this instruction is dangerous, and might blow up the whole ship if used carelessly.
Pops two values from stack. Pushes topmost % second_topmost
onto the stack.
Pops two values from stack. Pushes topmost * second_topmost
onto the stack.
Pops two values from stack and combines them together. The result is appended to the stack.
This can be reversed using UNPACK2
.
Pops a value from stack, and pushes it into stack, digit by digit.
[ 123 ] -> [ 1, 2, 3 ]
The result is undefined for negative values.
Removes the second topmost value from stack.
Pops two values from stack. Pushes topmost ^ second_topmost
onto the stack.
Accepts a value as a parameter. Pushes the value onto the stack.
Takes number of items to rotate as parameter. Extracts N topmost elements, reverses them, and puts them back onto stack.
Pops number of element to sort from the stack. If it is negative, the elements will be sorted in descending order.
Sorts that many topmost elements on stack.
Swaps two topmost values on stack.
Unpacks value into multiple ones. Reverses PACK2
.
Substracts values on stack.
[ a, b, c, d ] -> [ a-b, c-d ]
If the stack has odd number of elements, 42
is written into memory at index 1
instead.
Accepts index and count as parameters. Pushes count
values starting from index
to stack.
Accepts index as parameter. Saves number of elements on stack into memory at that index.
Pops the topmost value from stack. The popped value is used as index into memory.
The value at that index is pushed onto stack (or -1, if the index is out of bounds).
Appends the biggest index used in memory to stack.
Reads a value from stack, and saves it into memory at first unused index.
Adds the index used to stack.
Reads a value from stack, and removes memory record at that index.
Accepts a value as parameter. Saves the value into memory at first unused index, and pushes that index to stack.
Jumps to specified instruction/label.
Saves address of next instruction to stack, and jumps to specified instruction/label.
This can be used to call functions.
foo:
...
RET
...
PROC foo
Pops an address from stack, and jumps to that address.
Takes one parameter: GT0
, LE0
, LT0
, GE0
, EQ0
, NE0
.
Inspects the topmost value on stack. If the condition specified as a parameter holds, skips the next instruction.
PUSH 4
SKIP_IF GT0
UNREACHABLE
...
Terminates program.
Do nothing.
Accepts filename as a parameter. Reads stack dump from the file specified, and adds it at the top of the stack. See STF
.
Optionally accepts limit (integer) as a parameter.
Inspects topmost value on stack. This is target filename (as read by FTS
). Dumps the
whole stack (or only limit
elements) into the file specified.
Pushes current seconds, minutes and hours onto the stack.
Triggers an error.
Accepts time in milliseconds as a parameter. Waits for that amount of time.