English Binerdy
Jump to navigation
Jump to search
English Binerdy was created by user:Iamcalledbob to make Binerdy easier to program.
Instructions
English Binerdy supports the following instructions:
Alternations | Name | Description |
---|---|---|
Push 0.
|
init | Add 0 to the top of the stack. |
Increment top by 1.
|
inc | Increases the top stack value with 1, overflows to 0 at 256 |
Decrement top by 1.
|
dec | Decreases the top stack value with 1, overflows to 255 at -1 |
Do addition.
|
add | Removes the top stack value and add it to the second stack value. This will be the new top stack value |
Do subtraction.
|
sub | Removes the top stack value and substract it from the second stack value. This will be the new top stack value |
Turn top into label.
|
label | Removes the top stack value and turns it into a label |
Pop and store and jump if equal.
|
je | Removes the top stack value and stores it as label to jump to. Removes next top stack value and compares it to the stack value after that. If equals, jump to label |
Pop and store and jump if unequal.
|
jne | Removes the top stack value and stores it as label to jump to. Removes next top stack value and compares it to the stack value after that. If not equals, jump to label |
Input, push.
|
input | Stores user input at the top of the stack |
Swap tops.
|
swap | Swap the 2 top stack values |
Print top as char.
|
char | Read the top stack value, interpret it as character and print it |
Print top.
|
Read the top stack value and print it | |
Pop.
|
rem | Remove the top stack value |
Any code with no instructions is interpreted as exit.
Examples
Truth test
Input, push. Push 0. Increment top by 1. Increment top by 1. Increment top by 1. Increment top by 1. Increment top by 1. Increment top by 1. Push 0. Turn top into label. Decrement top by 1. Swap tops. Decrement top by 1. Decrement top by 1. Decrement top by 1. Decrement top by 1. Decrement top by 1. Decrement top by 1. Decrement top by 1. Decrement top by 1. Swap tops. Push 0. Push 0. Pop and store and jump if unequal. Increment top by 1. Turn top into label. Print top. Push 0. Push 0. Increment top by 1. Pop and store and jump if unequal.