LMC


Little man computer is a simulator that allows you to write and run assembly code. It is a simple computer architecture that is used to teach the basics of computer science.

Taking the table from assembly instructions we can see how the instructions are used in the LMC. LMC will use a number to represent the instruction instead of the mnemonic code. For example, ADD will be represented as 1 and SUB will be represented as 2.

Instruction (Mnemonic code)ExplanationLittle man computer code number
ADDAdd the current item in the accumulator with the address defined1XX
SUBSubtract the current item in the accumulator with ther address defined2XX
STAStore the current item in the accumulator into memory3XX
LDALoad from memory5XX
BRABranch always6XX
BRZBranch if the accumulator is zero7XX
BRPBranch if the accumulator is positive8XX
INPTake in a input and store into the accumilator901
OUTPrint out the current state of the accumulator902
HLTEnd the program0
DATData location

See also

References