Memory-Reference Instructions

Interactive Guide to Computer Architecture Fundamentals

🎯 What are Memory-Reference Instructions?

Memory-Reference Instructions are computer instructions that require an operand from memory to perform their operations. They are identified when the operation code (opcode) in bits 12-14 of the Instruction Register corresponds to codes D0 through D6.

7
Instruction Count

The basic computer supports exactly 7 memory-reference instructions, each with a unique opcode from D0 to D6.

⚡
Execution Phases

Instructions execute during timing signals T4, T5, and sometimes T6 after the addressing phase is complete.

🔄
Cycle Reset

After execution, the Sequence Counter (SC) is cleared to 0, returning to the fetch phase for the next instruction.

📍
Effective Address

Direct Addressing (I=0): The address part of the instruction (bits 0-11) is already in AR by T2.

Indirect Addressing (I=1): The effective address is fetched from memory at AR during T3.

⏱️
Execution Phase

Microoperations typically occur during timing signals T4 and T5 (and sometimes T6 for complex operations like ISZ).

🔄
Cycle Completion

Upon completion, SC ← 0 signals the control unit to return to the fetch phase (T0) for the next instruction.

D0
AND
Purpose: Performs bit-wise AND logic operation between AC and memory word.
T4
DR ← M[AR]
Read operand from memory
T5
AC ← AC ∧ DR,
SC ← 0
AND operation and reset counter
D1
ADD
Purpose: Adds memory word to AC, stores carry in E flip-flop.
T4
DR ← M[AR]
Read operand from memory
T5
AC ← AC + DR,
E ← Cout,
SC ← 0
Addition with carry handling
D2
LDA
Purpose: Load memory word into Accumulator.
T4
DR ← M[AR]
Read data from memory
T5
AC ← DR,
SC ← 0
Transfer to AC and reset
D3
STA
Purpose: Store AC content into memory location.
T4
M[AR] ← AC,
SC ← 0
Write AC to memory and reset
D4
BUN
Purpose: Unconditional branch to new program location.
T4
PC ← AR,
SC ← 0
Jump to effective address
D5
BSA
Purpose: Branch and Save return Address for subroutine calls.
T4
M[AR] ← PC,
AR ← AR + 1
Save return address
T5
PC ← AR,
SC ← 0
Branch to subroutine
D6
ISZ
Purpose: Increment memory word and skip next instruction if zero.
T4
DR ← M[AR]
Read memory word
T5
DR ← DR + 1
Increment the value
T6
M[AR] ← DR,
if (DR = 0) then
  (PC ← PC + 1),
SC ← 0
Store back and conditionally skip

🖥️ Instruction Execution Simulator

Select an instruction to see how it executes step by step:

AC
0000
DR
0000
AR
0100
PC
0021
E
0
SC
0
Simulation Log:
Select an instruction to begin simulation...

🧠 Test Your Knowledge

1. Which instruction performs a bitwise AND operation between the AC and memory?
ADD (D1)
AND (D0)
LDA (D2)
ISZ (D6)
2. What happens to the carry output during an ADD instruction?
It's ignored
It's stored in the E flip-flop
It's stored in the AC
It's stored in the DR
3. Which instruction is specifically designed for subroutine calls?
BUN (D4)
BSA (D5)
ISZ (D6)
STA (D3)