In Computer System Architecture, Memory Reference Instructions are a fundamental part of the instruction set architecture (ISA). These instructions interact with memoryβeither by reading data from memory or writing data to memory. They commonly use the Accumulator (AC) register for processing.
π· Definition
Memory Reference Instructions are instructions that involve accessing main memory for either fetching operands or storing results, typically using an address field in the instruction.
π Instruction Format (16-bit)
Most basic computers follow a 16-bit instruction format:
| 15 | 14-12 | 11 - 0 |
| I | Opcode | Address |
- I (1 bit): Addressing Mode
- 0 = Direct Addressing
- 1 = Indirect Addressing
- Opcode (3 bits): Specifies the operation (e.g., ADD, LDA)
- Address (12 bits): Specifies memory location (0β4095)
π§ Types of Memory Reference Instructions
1. LDA (Load Accumulator)
- Syntax:
LDA address
- Operation: AC β M[address]
- Purpose: Loads the content from a memory location into the accumulator.
2. STA (Store Accumulator)
- Syntax:
STA address
- Operation: M[address] β AC
- Purpose: Stores the content of the accumulator into a memory location.
3. ADD
- Syntax:
ADD address
- Operation: AC β AC + M[address]
- Purpose: Adds content of memory to accumulator.
4. SUB
- Syntax:
SUB address
- Operation: AC β AC – M[address]
- Purpose: Subtracts memory content from accumulator.
5. AND
- Syntax:
AND address
- Operation: AC β AC β§ M[address]
- Purpose: Performs bitwise AND between accumulator and memory content.
6. OR
- Syntax:
OR address
- Operation: AC β AC β¨ M[address]`
- Purpose: Performs bitwise OR between accumulator and memory content.
7. BUN (Branch Unconditionally)
- Syntax:
BUN address
- Operation: PC β address
- Purpose: Alters the program flow unconditionally (jump).
8. BSA (Branch and Save Address)
- Syntax:
BSA address
- Operation: M[address] β PC; PC β address + 1
- Purpose: Used for subroutine call; saves return address.
9. ISZ (Increment and Skip if Zero)
- Syntax:
ISZ address
- Operation: M[address] β M[address] + 1
if M[address] == 0 then PC β PC + 1 - Purpose: Useful in looping and counter mechanisms.
π Direct vs. Indirect Addressing
Addressing Mode | I Bit | Description |
---|---|---|
Direct | 0 | Address field directly specifies memory location |
Indirect | 1 | Address field points to memory location containing the effective address |
π Example (LDA Instruction)
Assume instruction:0001 0100 0011 1100
(binary)
- I = 0 (Direct)
- Opcode = 001 (LDA)
- Address = 043C (Hex) = 1084 (Decimal)
πΈ Operation:AC β M[1084]
π Use in Computer Architecture
- Forms the core instruction set of a basic computer.
- Teaches how CPU, memory, and ALU interact.
- Helps understand data path design, control logic, and instruction cycle.
β Conclusion
Memory Reference Instructions are essential to:
- Access and manipulate data in memory.
- Perform arithmetic/logical operations.
- Control program flow (branching and subroutines).
They are foundational in understanding CPU operations, instruction decoding, and microprogramming in Computer System Architecture.