Stacks
Jump to navigation
Jump to search
Stacks
This is Stacks.
Stacks uses 2 stacks, the main and sub stacks. (It doesn't have I/O)
Here are the instructions.
| Instruction | Shortform | Use |
|---|---|---|
| push | u | Pops the top value of the sub stack and pushes it on the main stack. (It will push 0 if there isn't anything in the sub stack) |
| pop | o | Pops the top value of the main stack and pushes it on the sub stack. (It will push 0 if there isn't anything in the main stack) |
| delete | d | Removes the top value of the main stack. |
| count | c | Takes the number of items in the main stack and pushes it back to the main stack. |
| sub | s | Subtracts the top value on the sub stack from the main stack. |
| iu | i | If the last sub instruction executed causes integer underflow, (each item is 8 bits) it will skip the next instruction. |
| jumptothebeginning | j | Jumps to the beginning. |
It is also stuck in an implicit loop.