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.

All 25 instructions
EmojiKeyword and operandsBehaviorLab
📥LOAD value [register]Load a value, register, or memory byte.
LOAD · Try an instruction in the lab →
LOAD 42
PRINT
HALT

Expected output: 42

Open the lab →
💾STORE [value] addressWrite 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: 42, 255

Open the lab →
📋COPY source-register destination-registerCopy one register into another.
COPY · Try an instruction in the lab →
LOAD 7 R1
COPY R1 R2
LOAD R2
PRINT
HALT

Expected output: 7

Open the lab →
➕ADD valueAdd a value to R0.
ADD · Try an instruction in the lab →
LOAD 10
ADD 5
PRINT
HALT

Expected output: 15

Open the lab →
➖SUB valueSubtract a value from R0.
SUB · Try an instruction in the lab →
LOAD 10
SUB 3
PRINT
HALT

Expected output: 7

Open the lab →
✖️MUL valueMultiply R0 by a value.
MUL · Try an instruction in the lab →
LOAD 6
MUL 7
PRINT
HALT

Expected output: 42

Open the lab →
➗DIV nonzero-valueDivide R0, rounding toward negative infinity.
DIV · Try an instruction in the lab →
LOAD -9
DIV 4
PRINT
HALT

Expected output: -3

Open the lab →
📊MOD nonzero-valueTake the signed remainder of R0.
MOD · Try an instruction in the lab →
LOAD -9
MOD 4
PRINT
HALT

Expected output: -1

Open the lab →
🔀AND valueBitwise AND of R0 and a value.
AND · Try an instruction in the lab →
LOAD 13
AND 5
PRINT
HALT

Expected output: 5

Open the lab →
🔃OR valueBitwise OR of R0 and a value.
OR · Try an instruction in the lab →
LOAD 5
OR 2
PRINT
HALT

Expected output: 7

Open the lab →
❌NOTInvert the signed 32-bit bits of R0.
NOT · Try an instruction in the lab →
LOAD 255
NOT
PRINT
HALT

Expected output: -256

Open the lab →
🔄XOR valueBitwise XOR of R0 and a value.
XOR · Try an instruction in the lab →
LOAD 42
XOR 6
PRINT
HALT

Expected output: 44

Open the lab →
⚖️CMP valueSet 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: 1

Open the lab →
⏭️JUMP targetJump 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: 1

Open the lab →
❓JUMP_IF_ZERO targetJump 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: 0

Open the lab →
🔁LOOP countRepeat 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: 1, 2, 3

Open the lab →
🛑RETURNFinish 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: 8

Open the lab →
📞CALL targetCall 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: 9, 16

Open the lab →
🖨️PRINTAppend the current R0 value to output.
PRINT · Try an instruction in the lab →
LOAD 3
PRINT
PRINT
HALT

Expected output: 3, 3

Open the lab →
📲INPUTRead an integer into R0; wait when input is empty.
INPUT · Try an instruction in the lab →
INPUT
PRINT
HALT

Integer input: -5

Expected output: -5

Open the lab →
⬆️PUSHPush R0 onto the data stack.
PUSH · Try an instruction in the lab →
LOAD 42
PUSH
LOAD 0
POP
PRINT
HALT

Expected output: 42

Open the lab →
⬇️POPPop 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: 22, 11

Open the lab →
⏹️HALT (or STOP)Stop at the current instruction.
HALT · Try an instruction in the lab →
LOAD 7
PRINT
HALT
LOAD 99
PRINT

Expected output: 7

Open the lab →
💤SLEEP millisecondsRequest 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: 1, 2

Open the lab →
⏸️NOPAdvance 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: 7

Open the lab →

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 →