Little Man Computer (LMC)
What is Assembly Language?
Assembly language sits between high-level languages (e.g., Python, Java) and machine code (binary).
Allows direct control over the CPU using simple symbolic instructions.
Used to write efficient, low-level code that interacts closely with the hardware.
Gives access to components like registers and memory addresses.
Each type of CPU has its own assembly language—LMC is a simplified, standardised model for learning.
Levels of Abstraction of Programming Languages
High-level languages (e.g., JavaScript, Python) are easier to write and read but abstract away from hardware.
Assembly language provides low-level control, closer to how the CPU operates.
Machine code (binary) is the lowest level, directly executed by the processor.
Abstraction helps hide unnecessary complexity depending on the programmer’s needs.
What is Little Man Computer?
LMC is a simplified, visual model of a basic CPU used to teach assembly-style programming.
It represents a computer as a mailroom with the "Little Man" acting as the CPU.
Includes basic components: accumulator, memory (mailboxes), calculator, and input/output tray.
Helps students understand key concepts like fetch-decode-execute cycle, instructions, and control flow.
Little Man Computer Instruction Set
Each instruction is written using a mnemonic (e.g., LDA, STA, ADD) to represent a specific action.
All instructions correspond to a 3-digit code that the LMC can execute.
Covers basic actions such as:
Input/output (INP, OUT)
Memory operations (LDA, STA)
Arithmetic (ADD, SUB)
Control flow (BRA, BRZ, BRP)
Also includes HLT to stop the program, and DAT to store data.