Skip to content

Types of Instructions

Instructions are the fundamental commands given to the CPU to perform specific operations. Based on how they operate and where they fetch or store data, instructions are broadly classified into:

✅ 1. Memory Reference Instructions

✅ 2. Register Reference Instructions

✅ 3. Input-Output Instructions


🧠 1. Memory Reference Instructions

These instructions access memory to perform operations. They are the most commonly used instructions and usually involve the Accumulator (AC).

🔸 Features:

  • Involve memory locations for operands.
  • Use the Accumulator (AC) as default.
  • Can be of direct or indirect type.

🔹 Instruction Format (16-bit):

| 15 | 14 13 12 | 11..................0 |
| I | Opcode | Address |
  • I = 0: Direct Addressing
  • I = 1: Indirect Addressing

🔹 Common Memory Reference Instructions:

MnemonicOperationDescription
LDAAC ← M[addr]Load memory content into AC
STAM[addr] ← ACStore AC content into memory
ADDAC ← AC + M[addr]Add memory value to AC
SUBAC ← AC – M[addr]Subtract memory value from AC
ANDAC ← AC ∧ M[addr]Logical AND operation
ORAC ← AC ∨ M[addr]Logical OR operation
BUNPC ← addrUnconditional jump
BSAM[addr] ← PC; PC ← addr + 1Branch & Save Address (Subroutine call)
ISZM[addr] ← M[addr] + 1; if 0 skipIncrement and skip if result is 0

🧠 2. Register Reference Instructions

These instructions operate only on CPU registers, without accessing memory. Typically, they perform simple, fast operations on the Accumulator (AC) or control bits.

🔸 Features:

  • Do not access memory.
  • Involve AC or control flags.
  • Execute micro-operations like clear, complement, or increment.

🔹 Instruction Format:

| 15 14 13 | 12....................1 | 0 |
| 111 | 00000000000 | 0 |

Opcode is 111, and the I-bit = 0 distinguishes it as register reference.

🔹 Common Register Reference Instructions:

MnemonicOperationDescription
CLAAC ← 0Clear the Accumulator
CLEE ← 0Clear the carry flag (E)
CMAAC ← 1’s complementComplement bits of AC
CMEE ← 1’s complementComplement the carry flag
INCAC ← AC + 1Increment AC by 1
SPASkip if AC > 0Skip next if AC is positive
SNASkip if AC < 0Skip next if AC is negative
SZASkip if AC = 0Skip next if AC is zero
HLTHaltStop the computer

🧠 3. Input-Output Instructions

These instructions allow data transfer between the CPU and I/O devices. The communication happens using the I/O interface.

🔸 Features:

  • Use special I/O control signals.
  • Operate through Input/Output flags.
  • No memory address is involved.

🔹 Instruction Format:

| 15 14 13 | 12....................1 | 0 |
| 111 | 00000000000 | 1 |

Opcode is 111, and I-bit = 1 identifies it as I/O instruction.

🔹 Common Input-Output Instructions:

MnemonicOperationDescription
INPAC ← Input bufferRead input from device to AC
OUTOutput buffer ← ACSend AC contents to output device
SKISkip if input flag = 1Skip next if input ready
SKOSkip if output flag = 1Skip next if output ready
IONInterrupt enableAllow interrupts
IOFInterrupt disableDisable interrupts

📊 Comparison Table

FeatureMemory ReferenceRegister ReferenceInput-Output
Access MemoryYesNoNo
Operates onMemory & ACAC & Control FlagsI/O Devices
Opcode Format3-bit + 12-bit addr111 + control bits111 + I/O bits
Addressing ModeDirect/IndirectNot applicableNot applicable
Example InstructionsLDA, ADD, BUNCLA, INC, HLTINP, OUT, ION

🎓 Conclusion

Understanding these instruction types is essential for:

  • CPU instruction decoding
  • Writing low-level programs
  • Studying micro-operations and control logic

Each instruction type plays a vital role in CPU functioning, data processing, and device communication.