LMC Simulator

Write Little Man Computer assembly programs, load them into memory, and step through execution with a visual accumulator and mailbox display.

Example Programs
Assembly Code Labels supported · // comments
Load a program to begin.
Registers
ACC
000
Accumulator
PC
00
Program Counter
IR
---
Instruction Reg.
Input / Output
Input Queue (comma-separated)
Output
Memory (Mailboxes 0–99)
Instruction Set
MnemonicOpcodeDescription
ADD xx1xxACC = ACC + mailbox[xx]
SUB xx2xxACC = ACC − mailbox[xx]
STA xx3xxmailbox[xx] = ACC
LDA xx5xxACC = mailbox[xx]
BRA xx6xxPC = xx (always branch)
BRZ xx7xxPC = xx if ACC = 0
BRP xx8xxPC = xx if ACC ≥ 0
INP901ACC = next input value
OUT902Print ACC to output
HLT000Stop execution
DAT nDefine data; initial value n
Tips

Labels — write a label before any instruction or DAT to give it a name. Labels are resolved to addresses at load time.

Negative accumulator — if ACC goes below 0, BRP will not branch. The accumulator is stored as a signed value internally.

Comments — anything after // on a line is ignored.

Blue highlight on mailbox = current PC position.

Input queue — enter comma-separated integers. Each INP instruction consumes the next value.