1

mrahmedcomputing

KS3, GCSE, A-Level Computing Resources

Lesson 6. Assembly Language (LMC)


Lesson Objective

  • Explain the Von Neumann architecture, with reference to the Little Man Computer and assembly language.
  • Use basic assembly language code to demonstrates how a processor fetches, decodes and executes data.
  • Create complex assembly language code to implement your own ideas/programs in the Little Man Computer.

Lesson Notes

Assembly Language

The Little Man Computer

This is an imaginary computer with a very limited instruction set, created by Dr Stuart Madnick in 1965.

For the purpose of the simulation, the table shows some instruction that can be used.

Note: There is no 4! This code is unused and gives an error.

The LMC has only 11 instructions, and the imaginary computer on which it runs has only 100 memory locations.

On a real computer, there will be many more instructions.

  • Multiply and divide instructions
  • Shift left and shift right instructions

Memory Instructions - Opcode, Operand

An instruction register to hold the first digit of the instruction read from memory - this is opcode.

An address register to hold the second and third digit of the instruction read from memory - this is operand.

LMC Instruction Set

Code Mnemonic Instruction Code+ Description
1 ADD ADD 1xx Add the contents of the memory address to the Accumulator.
2 SUB SUBTRACT 2xx Subtract the contents of the memory address from the Accumulator.
3 STA STORE 3xx Store the value in the Accumulator in the memory address given.
5 LDA LOAD 5xx Load the Accumulator with the contents of the memory address given.
6 BRA BRANCH (unconditional) 6xx Branch - use the address given as the address of the next instruction.
7 BRZ BRANCH IF ZERO (conditional) 7xx Branch to the address given if the Accumulator is zero.
8 BRP BRANCH IF POSITIVE (conditional) 8xx Branch to the address given if the Accumulator is zero or positive.
9 INP INPUT 901 Input into the accumulator.
9 OUT OUTPUT 902 Output contents of accumulator.
0 HLT Halt 0 Stops the execution of the program.
DAT DATA Used to indicate a location that contains data.

3