Skip to content

Register Reference Instructions


Definition

Register Reference Instructions are instructions that operate directly on CPU registers, especially the Accumulator (AC), without referencing memory.

These instructions perform simple data manipulations, control operations, and affect CPU flags or internal states.


🧩 Instruction Format (16-bit)

Register Reference Instructions have a special format where:

| 15-13 | 12 - 1         | 0 |
| 111 | Control Bits | 0 |
  • Bits 15-13 (Opcode): 111 indicates it is either register or I/O instruction.
  • Bit 0 (I bit): 0 for Register Reference
  • Bits 1-12: Used as control bits to trigger specific micro-operations

🛠️ Key Features

  • Operate only on registers (not memory)
  • Mostly affect the Accumulator (AC) and E (carry)
  • Fast execution (since memory is not accessed)
  • Mainly used for data manipulation, testing, and control

🔍 List of Register Reference Instructions

MnemonicOperationDescription
CLAAC ← 0Clear the accumulator
CLEE ← 0Clear the E (carry) flag
CMAAC ← 1’s complementComplement all bits in the accumulator
CMEE ← 1’s complementComplement the carry flag
CIRCircular right shift AC + ERotate right AC and E
CILCircular left shift AC + ERotate left AC and E
INCAC ← AC + 1Increment the accumulator
SPASkip if AC is positiveIf AC ≥ 0, skip next instruction
SNASkip if AC is negativeIf AC < 0, skip next instruction
SZASkip if AC = 0If AC = 0, skip next instruction
HLTHalt the computerStops program execution

💡 Examples

🟢 Example 1: CLA

  • Binary: 0111 1000 0000 0000
  • Meaning: Clear Accumulator
  • Action: AC ← 0

🟢 Example 2: CMA

  • Binary: 0111 0100 0000 0000
  • Meaning: Complement Accumulator
  • Action: AC ← NOT(AC)

🔁 Control Logic (Simplified)

When a Register Reference Instruction is identified (Opcode = 111, I = 0), the control unit executes micro-operations based on which control bit is set to 1.

Only one bit in positions 1 to 12 is set for each instruction.


📘 Use in CSA

These instructions help in:

  • Understanding micro-operations
  • Designing the control unit
  • Implementing basic CPU operations
  • Learning bit-level operations

📊 Comparison: Register Reference vs Memory Reference

FeatureRegister ReferenceMemory Reference
Memory AccessNoYes
SpeedFastSlower (needs memory fetch)
FocusInternal RegistersMemory and Accumulator
Example InstructionsCLA, CMA, INCLDA, ADD, STA, BUN

Conclusion

Register Reference Instructions are crucial for:

  • Performing low-level operations
  • Controlling processor behavior
  • Learning how CPU control logic works

They form the foundation of how a simple computer performs logic, data transfer, and control operations without memory involvement.