| Assembly Mnemonic | Meaning |
|---|---|
LDD | Load (direct addressing) |
STO | Store a value in memory |
ADD | Add a value |
SUB | Subtract a value |
INC | Increment (add 1) |
DEC | Decrement (subtract 1) |
JMP | Jump to an address (unconditional) |
JPE | Jump if equal |
JPN | Jump if not equal |
CMI | Compare (immediate) |
END | End of program |
| Part | Description |
|---|---|
| Opcode | Tells the CPU what operation to perform (e.g., ADD, LOAD, JUMP) |
| Operand | Tells the CPU what data or address to use |
ADD (perform addition)005 (the memory address or value to add)LDD 050 — Load the value at memory address 050 into the AccumulatorSTO 050 — Store the Accumulator's value into memory address 050ADD 010 — Add the value at address 010 to the AccumulatorSUB 010 — Subtract the value at address 010 from the AccumulatorINC ACC — Increase the Accumulator by 1DEC ACC — Decrease the Accumulator by 1CMI 5 — Compare the Accumulator with the immediate value 5JMP 020 — Jump unconditionally to address 020JPE 030 — Jump to address 030 if the comparison result was equalJPN 040 — Jump to address 040 if the comparison result was not equalIN — Input a value (store in Accumulator)OUT — Output the value in the AccumulatorEND — Terminates the programTip: A #symbol before the operand usually indicates immediate addressing.
| Address | Instruction | Comment |
|---|---|---|
| 000 | LDD 050 | Load value at address 050 into ACC |
| 001 | ADD 051 | Add value at address 051 to ACC |
| 002 | STO 052 | Store result into address 052 |
| 003 | END | End the program |
| Address | Value |
|---|---|
| 050 | 12 |
| 051 | 8 |
| 052 | (result = 20) |
| Term | Definition |
|---|---|
| Instruction Set | The full set of binary instructions a CPU can execute |
| Machine Code | Binary instructions directly executed by the CPU |
| Assembly Language | Low-level language using mnemonics; converted by an Assembler |
| Assembler | A program that translates assembly language into machine code |
| Opcode | The part of an instruction specifying the operation to perform |
| Operand | The data or address the opcode acts upon |
| Accumulator (ACC) | A CPU register used to store results of operations |
| Mnemonic | A short, memorable code representing a machine code instruction |
# before a number = immediate (the number itself); no # = direct (a memory address).