The machine manual
Emoji instruction reference
Type the emoji or its keyword. Registers R0–R7 hold safe integers; R0 is the accumulator. Memory has 256 byte addresses (0–255). Arithmetic keeps full integer values; bitwise operations use signed 32-bit values.
Labels end in a colon. Jumps target labels or zero-based instruction indexes, ignoring blank lines and comments. A # begins a comment. LOAD [10] reads memory; LOAD 10 loads the literal number 10.
| Emoji | Keyword and operands | Behavior | Lab |
|---|---|---|---|
| 📥 | LOAD value [register] | Load a value, register, or memory byte. | |
| 💾 | STORE [value] address | Write the low byte of a value to memory. | STORE · Try an instruction in the lab →LOAD 42 STORE 10 STORE 511 11 LOAD [10] PRINT LOAD [11] PRINT HALT Expected output: |
| 📋 | COPY source-register destination-register | Copy one register into another. | COPY · Try an instruction in the lab →LOAD 7 R1 COPY R1 R2 LOAD R2 PRINT HALT Expected output: |
| ➕ | ADD value | Add a value to R0. | |
| ➖ | SUB value | Subtract a value from R0. | |
| ✖️ | MUL value | Multiply R0 by a value. | |
| ➗ | DIV nonzero-value | Divide R0, rounding toward negative infinity. | |
| 📊 | MOD nonzero-value | Take the signed remainder of R0. | |
| 🔀 | AND value | Bitwise AND of R0 and a value. | |
| 🔃 | OR value | Bitwise OR of R0 and a value. | |
| ❌ | NOT | Invert the signed 32-bit bits of R0. | |
| 🔄 | XOR value | Bitwise XOR of R0 and a value. | |
| ⚖️ | CMP value | Set flags from R0 minus a value; keep R0. | CMP · Try an instruction in the lab →LOAD 7 CMP 7 JUMP_IF_ZERO same LOAD 0 JUMP show same: LOAD 1 show: PRINT HALT Expected output: |
| ⏭️ | JUMP target | Jump to a label or zero-based instruction index. | JUMP · Try an instruction in the lab →LOAD 1 JUMP show LOAD 99 show: PRINT HALT Expected output: |
| ❓ | JUMP_IF_ZERO target | Jump when the stored zero flag is true. | JUMP_IF_ZERO · Try an instruction in the lab →LOAD 0 JUMP_IF_ZERO show LOAD 99 show: PRINT HALT Expected output: |
| 🔁 | LOOP count | Repeat the block ending at its matching RETURN. | LOOP · Try an instruction in the lab →LOOP 0 LOAD 99 PRINT RETURN LOAD 1 LOOP 3 PRINT ADD 1 RETURN HALT Expected output: |
| 🛑 | RETURN | Finish a loop iteration or return from a subroutine. | RETURN · Try an instruction in the lab →LOAD 7 CALL increment PRINT HALT increment: ADD 1 RETURN Expected output: |
| 📞 | CALL target | Call a subroutine and save the next instruction. | CALL · Try an instruction in the lab →LOAD 3 CALL square PRINT LOAD 4 CALL square PRINT HALT square: MUL R0 RETURN Expected output: |
| 🖨️ | PRINT | Append the current R0 value to output. | |
| 📲 | INPUT | Read an integer into R0; wait when input is empty. | INPUT · Try an instruction in the lab →INPUT PRINT HALT Integer input: Expected output: |
| ⬆️ | PUSH | Push R0 onto the data stack. | PUSH · Try an instruction in the lab →LOAD 42 PUSH LOAD 0 POP PRINT HALT Expected output: |
| ⬇️ | POP | Pop the data stack into R0. | POP · Try an instruction in the lab →LOAD 11 PUSH LOAD 22 PUSH POP PRINT POP PRINT HALT Expected output: |
| ⏹️ | HALT (or STOP) | Stop at the current instruction. | HALT · Try an instruction in the lab →LOAD 7 PRINT HALT LOAD 99 PRINT Expected output: |
| 💤 | SLEEP milliseconds | Request a delay in milliseconds from the caller. | SLEEP · Try an instruction in the lab →LOAD 1 PRINT SLEEP 100 LOAD 2 PRINT HALT Expected output: |
| ⏸️ | NOP | Advance without changing values or flags. | NOP · Try an instruction in the lab →LOAD 7 CMP 7 NOP JUMP_IF_ZERO show LOAD 0 show: PRINT HALT Expected output: |
Flags, loops and calls
Z means the latest result equals zero. N means it is negative; O means it is outside the signed 32-bit range. LOAD into any register, COPY, arithmetic, bitwise instructions, POP and INPUT update flags. CMP sets flags from R0 minus its operand without changing R0. JUMP_IF_ZERO tests Z, including a comparison result.
LOOP captures its count once and repeats its block through the matching RETURN; zero skips the block. CALL uses a separate return-address stack. RETURN in a called function returns to its caller before continuing an outer loop. PUSH and POP use a separate data stack. SP starts at 255 and decreases with the combined data and call depth, up to 256 entries.
DIV rounds toward negative infinity; MOD is signed remainder. STORE writes the low byte (−1 becomes 255). INPUT waits until you provide a safe integer. SLEEP requests a timed delay in the lab; the deterministic VM itself does not wait. Programs can finish by HALT or by reaching the end; invalid branch targets are errors.
Try an instruction in the lab →