-
Notifications
You must be signed in to change notification settings - Fork 0
Home
kenan238 edited this page Nov 26, 2021
·
2 revisions
| Opcode | Name | Name (Chicken) | Description |
|---|---|---|---|
| 0 | exit | axe | Stop execution |
| 1 | chicken | chicken | Push the string chicken onto the stack |
| 2 | add | add | Add two top stack values. |
| 3 | subtract | fox | Subtract two top stack values. |
| 4 | multiply | rooster | Multiply two top stack values. |
| 5 | compare | compare | Compare two top stack values for equality, push truthy or falsy result onto the stack. |
| 6 | load | pick | Double wide instruction. Next instruction indicates source to load from. 0 loads from stack, 1 loads from user input. Top of stack points to address/index to load onto stack. |
| 7 | store | peck | Top of stack points to address/index to store to. The value below that will be popped and stored. |
| 8 | jump | fr | Top of stack is a relative offset to jump to. The value below that is the condition. Jump only happens if condition is truthy. |
| 9 | char | BBQ | Interprets the top of the stack as ascii and pushes the corresponding character. |
| 10+ | push | (Empty) | Pushes the literal number n-10 onto the stack. |
Every line in the program is inspected for chickens, and the corresponding number of chickens are pushed onto the stack. Execution is done directly on the stack, which may make the program susceptible to arbitrary chicken injection attacks.