YEAR 1 CO1 WEEK 10 LITTLE MAN COMPUTER Flashcards
LOAD
LDA
Machine code 5xx
Loads contents of address xx onto the accumulator.
STORE
STA
Machine code 3xx
Stores the contents of accumulator to address xx
ADD
ADD
Machine code 1xx
Adds contents of address xx to the accumulator.
SUBTRACT
SUB
Machine code 2xx
Subtracts contents of address xx from the accumulator
INPUT
INP
Machine code 901
Copies value from the “in box” onto the accumulator.
OUTPUT
OUT
Machine code 902
Copies value from accumulator to the “out box”
END
HLT
Machine code 000
Stops LMC simulator executing the program
BRANCH ALWAYS
BRA
Machine code 6xx
Sets program counter to address xx
BRANCH IF ZERO
BRZ
Machine code 7xx
If contents of accumulator are ZERO set program counter to address xx
BRANCH IF ZERO OR POSITIVE
BRP
Machine code 8xx
If contents of accumulator are ZERO or POSITIVE set program counter to address xx
DATA STORAGE
DAT
No machine code
Reserve as data the memory address reached when this instruction is compiled