-
Notifications
You must be signed in to change notification settings - Fork 1
Instruction List
Aaron Miller edited this page Apr 8, 2021
·
2 revisions
- For clarity, capitalized commands are preceded by
↑ +
. - As a general rule, the capitalized form of a command indicates register manipulation.
Command | Function |
---|---|
h j k l |
Move IP left, down, up, right, respectively. |
x |
Pop a off the Document and discard. |
↑ + X |
Pop the value saved in the register and discard. |
d |
Pop a off the Document, then pop a values off the Document and discard.1d will discard the top value. 0d will push the top value to the register. |
y |
Pop a off the Document, then duplicate the a th value on the Document and push it to the register. The top value on the stack is the 0th value. |
↑ + Y |
Duplicate the top value from the Document to the register. |
p |
Pop the value saved in the register, then push it to the Document. |
↑ + P |
Duplicate the value saved in the register to the Document. |
i |
Enter insert mode. |
↑ + I |
Enter regin (register insert) mode. |
` |
Escape. Exit insert mode and return to command mode. If used outside of insert mode, it acts as a trampoline. |
w |
Pop the top value off the Document and output it as a character. |
↑ + W |
Pop the value stored in the Register and output it as a character. |
z |
Pop the top value off the Document and output it as an integer. |
↑ + Z |
Pop the value stored in the Register and output it as an integer. |
q |
Stop execution. |
: |
Get input from the user and push it. |
{ |
Pop a off the Document. If a is 0, rotate IP direction left (counterclockwise) 90°. |
} |
Pop a off the Document. If a is 0, rotate IP direction right (clockwise) 90°. |
+ - * / %
|
Addition, Subtraction, Multiplication, Division, Modulo. Pop a and b off the Document, then do b <operator> a and push the result to the Document. |
> |
Pop a and b off the Document. If b > a, push 1 to the Document, otherwise, push 0. |
= |
Pop a and b off the Document. If b = a, push 1 to the Document, otherwise, push 0. |
! |
Logical NOT. Pop a off the Document. If a is 0, push 1 to the Document. Otherwise, push 0. |
0-9 |
Push the corresponding number to the Document. |