Little Man Computing is an instruction set for assembly language, composed of 12 instructions, using Memory Addressing.
Example
Adding two numbers.
INP
STA NUM1
INP
ADD NUM1
OUT
NUM1 DAT 0Labels
A label is a reference to a location within the RAM.
Defining
{label} OPCODE OPERANDReferencing
The label is replaced with the location associated with the label in RAM.
OPCODE {label}Instructions
| Instruction | Name | Description |
|---|---|---|
| HLT | Halt | Stops the proogram. |
| ADD | Add | Adds the content of the memory address (operand) to the accumulator. |
| SUB | Subtract | Subtracts the content of the memory address (operand) to the accumulator. |
| LDA | Load | Loads the content of the memory address (operand) to the accumulator. |
| BRA | Branch | Branches to the memory address (operand). |
| BRZ | Branch if Zero | Branches to the memory address (operand) if the accumulator is zero. |
| BRP | Branch if Positive | Branches to the memory address (operand) if the accumulator is positive. |
| INP | Input | Takes an input as a number and stores it in the accumulator. |
| OUT | Output | Outputs the accumulator as a number. |
| OTC | Output as Character | Outputs the accumulator as an ASCII character. |
| DAT | Data | Indicates a location in memory to store data. |