Photo AI
Last Updated Sep 27, 2025
Revision notes with simplified explanations to understand Assembly Language & Little Man Computer quickly and effectively.
441+ students studying
Assembly Language is a low-level programming language that provides a way to write instructions directly for a computer's CPU. It operates close to the hardware, allowing precise control over memory and CPU operations. Assembly language is specific to a computer's architecture, making it more efficient but harder to write and understand than high-level languages. One tool to learn assembly language concepts is the Little Man Computer (LMC), a simple educational model that mimics the CPU's basic operations. LMC uses a limited set of instructions to illustrate how assembly works.
The Little Man Computer is a simplified CPU model that helps beginners understand assembly language concepts without the complexities of a real CPU. It uses an imaginary "little man" who follows basic instructions to perform tasks with a limited set of commands, representing core concepts in assembly programming.
Here are the basic instructions for LMC, each represented by a 3-digit code:
Mnemonic | Instruction Code | Description |
---|---|---|
ADD | 1XX | Add the value at address XX to the accumulator. |
SUB | 2XX | Subtract the value at address XX from the accumulator. |
STA | 3XX | Store the value from the accumulator into address XX . |
LDA | 5XX | Load the value at address XX into the accumulator. |
BRA | 6XX | Branch always (jump) to address XX . |
BRZ | 7XX | Branch to address XX if the accumulator is zero. |
BRP | 8XX | Branch to address XX if the accumulator is positive. |
INP | 901 | Input a value into the accumulator. |
OUT | 902 | Output the value in the accumulator. |
HLT | 000 | Halt the program. |
This program adds two numbers entered by the user and outputs the result.
INP // 901 - Input first number into the accumulator
STA 10 // 310 - Store the first number at address 10
INP // 901 - Input second number into the accumulator
ADD 10 // 110 - Add the number at address 10 to the accumulator
OUT // 902 - Output the result
HLT // 000 - Halt the program
Explanation:
This program subtracts one user-entered number from another.
INP // 901 - Input the first number
STA 10 // 310 - Store the first number in address 10
INP // 901 - Input the second number
SUB 10 // 210 - Subtract the number at address 10 from the accumulator
OUT // 902 - Output the result
HLT // 000 - Halt the program
Explanation:
This program accepts a positive integer and counts down to zero, displaying each number.
INP // 901 - Input a number
STA 10 // 310 - Store the input in address 10
LDA 10 // 510 - Load the value at address 10 into the accumulator
OUT // 902 - Output the current number
SUB 12 // 212 - Subtract 1 (at address 12) from the accumulator
STA 10 // 310 - Store the updated value back in address 10
BRP 06 // 806 - Branch to address 06 if the accumulator is positive
HLT // 000 - Halt the program
// Data
12 DAT 1 // Stores the value 1 to decrement the counter
Explanation:
BRP
instruction to check for a positive number.Tracing a program involves following each instruction step-by-step, noting changes to the accumulator and mailbox values. Here's an example trace for the Simple Addition Program above, assuming inputs 4
and 3
.
Step | Instruction | Accumulator | Mailbox 10 | Output |
---|---|---|---|---|
1 | INP (901) | 4 | ||
2 | STA 10 (310) | 4 | 4 | |
3 | INP (901) | 3 | 4 | |
4 | ADD 10 (110) | 7 | 4 | |
5 | OUT (902) | 7 | 4 | 7 |
6 | HLT (000) | - | - | - |
HLT
command is missing, the program may continue running, leading to errors.Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!
40 flashcards
Flashcards on Assembly Language & Little Man Computer
Revise key concepts with interactive flashcards.
Try Computer Science Flashcards4 quizzes
Quizzes on Assembly Language & Little Man Computer
Test your knowledge with fun and engaging quizzes.
Try Computer Science Quizzes29 questions
Exam questions on Assembly Language & Little Man Computer
Boost your confidence with real exam questions.
Try Computer Science Questions27 exams created
Exam Builder on Assembly Language & Little Man Computer
Create custom exams across topics for better practice!
Try Computer Science exam builder12 papers
Past Papers on Assembly Language & Little Man Computer
Practice past papers to reinforce exam experience.
Try Computer Science Past PapersDiscover More Revision Notes Related to Assembly Language & Little Man Computer to Deepen Your Understanding and Improve Your Mastery
Join 500,000+ A-Level students using SimpleStudy...
Join Thousands of A-Level Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!
Report Improved Results
Recommend to friends
Students Supported
Questions answered