• Homework
  • Thirds
  • Upper Thirds
  • Fourth
  • Divisions
    • ICT
    • Computer Science
  • Fifth
  • Lower Sixth
  • Upper Sixth
    • Upper Sixth Theory
  • Blog
  • Careers
  • Unity
  • Networking

The Little Man Computer

Picture

The little man simulator

Presentation from Durham University

Instruction Set
Exercise One
Exercise Two

Program 1 - Input and Output
INP
OUT
HLT
Program 2 - Using Memory
INP
STA FIRST
INP
STA SECOND
LDA FIRST
OUT
LDA SECOND
OUT
HLT
FIRST DAT
SECOND DAT
Program 3 - Addition and Subtraction
INP
STA FIRST
INP
ADD FIRST
OUT
INP
SUB FIRST
OUT
HLT
FIRST DAT

Program 4 - Making decisions
INP
STA FIRST
INP
STA SECOND
SUB FIRST
BRP SECONDBIG
LDA FIRST
OUT
BRA PROGRAMEND
SECONDBIG LDA SECOND
OUT 
PROGRAMEND HLT
FIRST DAT
SECOND DAT
Picture

Program 5 - Multiply two numbers
INP
STA X
INP
STA Y
LOOP LDA Y
BRZ END
LDA ANSWER
ADD X
STA ANSWER
LDA Y
SUB ONE
STA Y
BRA LOOP
END LDA ANSWER
OUT
HLT
ONE DAT 1
ANSWER DAT 0
X DAT 0
Y DAT 0
Picture
Powered by Create your own unique website with customizable templates.