Instruction Memory value Description ADD1xx Add the value stored at memory address xx to the value in the accumulator register SUB2xx Subtract the value stored at memory address xx from the value in the accumulator register STA3xx Store the value from the accumulator register to the memory address xx LDA5xx Load the value from the memory address xx into the accumulator register BRA6xx Branch to xx (store xx in the program counter register so that the program will jump to xx on the next instruction cycle) BRZ7xx Branch if the accumulator register stores the value zero, otherwise carry on as normal BRP8xx Branch if the accumulator register stores zero or a positive number INP9x1 Read a value from the input device x and store it in the accumulator register OUT9x2 Send the contents of the accumulator register to the output device x HLT000Halt / Stop the processor DATxxxStores xxx in memory to be used as data Little Man Computer Instruction set
AddressValueDescription 0901Input from device Store in memory address Input from device Store in memory address Load memory address 8 into accumulator 5109Add memory address 9 to accumulator 6902Output to device Halt 8000data: data: 0 Little Man Computer Example Program
Program Counter register
Instruction register
Accumulator register
Address: 0 Value: 901
Address: 1 Value: 308
Address: 2 Value: 901
Address: 3 Value: 309
Address: 4 Value: 508
Address: 5 Value: 109
Address: 6 Value: 902
Address: 7 Value: 000
Address: 8 Value: 000
Address: 9 Value: 000