We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Little Man Computer
- For the language defined for ICFP contest 2026, see Littleman.
Little Man Computer is a non-esoteric educational programming language that works similar to a simple 80s practical CPU. The computer has an accumulator and a random accessible read-write memory of 100 cells, each cell and the accumulator storing a signed number of 3 decimal digits.
Instructions are stored in the RAM. Instructions are encoded as an address in the two lower digits and an opcode in the hundreds digit. The computer requires self-modifying code for indirect addressing: to make this easier, there's a store address instruction that overwrites only the two lower digits of a memory cell.
The arithmetic add and subtract instructions use the accumulator as the first input operand, read a value from the memory at the address that is encoded in the two lower digits of the instruction, and put their result into the accumulator. There are two branch instructions: branch on zero and branch on nonnegative, both conditional on the value of the accumulator. An arithmetic overflow sets the digits of the accumulator to an undefined value, but the sign is set correctly, so you can use the subtract instruction to compare any two signed three-digit numbers. The instructions are:
- 000
- halt (operand must be 0)
- 100
- add
- 200
- subtract (memory from accumulator)
- 300
- store
- 400
- store address
- 500
- load
- 600
- branch unconditional
- 700
- branch if accumulator is zero
- 800
- branch if accumulator is positive or zero
- 900
- I/O