โ 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):
111indicates it is either register or I/O instruction. - Bit 0 (I bit):
0for 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.
