The "Little Man Computer" Instruction Format
and Instruction Set

Every instruction in the LMC is encoded as a 3 decimal digit number.  To know what should be done for any single instruction, the "little man" compares the first digit of whatever Instruction value he is currently remembering with a list of values in an Instruction Set Table and then performs what ever action is indicated in the table next to the matching code.  The Instruction Format is:
  1. Operation Code (opcode): the left-most digit indicates the specific type of action or operation the "little man" should perform.
  2. Address Operand Field: the right-most two digits generally refer to a Mailbox number which the "little man" is to use in performing the requested operation; however, for some operations, these two digits may be ignored or may have some other special meaning.
 
FmtOperationMnemMeaning
1xyLOADLDAcopy value from Mailbox with the supplied Mailbox number (xy) into the Calculator
2xySTORE STOcopy value from the Calculator into the Mailbox with the supplied Mailbox number (xy)
3xyADDADDadd the value in the Mailbox at the supplied Mailbox number to the Calculator; set lights
4xySUBTRACTSUBsubtract the value in the Mailbox at the supplied Mailbox number from the value in the Calculator; set lights
500INPUTINcopy the value currently in the Input basket to the Calculator
600OUTPUTOUTcopy the value from the Calculator to the Output basket
700HALTHLTstop processing; sleep until the Reset button rings the bell
800SKIP_IF_NEGSKN increment the Counter an extra time (skip next instruction) if the Calculator Negative indicator is on
801SKIP_IF_ZEROSKZ increment the Counter an extra time (skip) if the Calculator Zero indicator is on
802SKIP_IF_POSSKP increment the Counter an extra time (skip) if the Calculator Positive indicator is on
803SKIP_NON_ZEROSKNZ increment the Counter an extra time (skip) if the Calculator Zero indicator is *NOT* on
9xyJUMPJMPset the counter to be the value (xy) (jump to this instruction next)
0xySUBRTN_CALLCALLstore 900 + <contents of counter> into Mailbox number (xy-1), then set counter to be value (xy)