✅ 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
Mnemonic | Operation | Description |
---|---|---|
CLA | AC ← 0 | Clear the accumulator |
CLE | E ← 0 | Clear the E (carry) flag |
CMA | AC ← 1’s complement | Complement all bits in the accumulator |
CME | E ← 1’s complement | Complement the carry flag |
CIR | Circular right shift AC + E | Rotate right AC and E |
CIL | Circular left shift AC + E | Rotate left AC and E |
INC | AC ← AC + 1 | Increment the accumulator |
SPA | Skip if AC is positive | If AC ≥ 0, skip next instruction |
SNA | Skip if AC is negative | If AC < 0, skip next instruction |
SZA | Skip if AC = 0 | If AC = 0, skip next instruction |
HLT | Halt the computer | Stops 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
Feature | Register Reference | Memory Reference |
---|---|---|
Memory Access | No | Yes |
Speed | Fast | Slower (needs memory fetch) |
Focus | Internal Registers | Memory and Accumulator |
Example Instructions | CLA, CMA, INC | LDA, 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.