04 ISA AddressingModes
04 ISA AddressingModes
1
23/01/24
Introduc2on
2
23/01/24
PUSH X
PUSH Y
ADD
POP Z
• The ADD instruc/on pops two
elements from stack, adds them, and
ALU
pushes back result.
3
23/01/24
Registers
c) Register-Memory machine:
LOAD R2,X // R2 = Mem[X]
ADD R2,Y // R2 = R2 + Mem[Y]
STORE Z,R2 // Mem[Z] = R2
• One of the operands is assumed to be in ALU
register and another in memory.
From
memory
4
23/01/24
Registers
d) Register-Register machine:
LOAD R1,X // R1 = Mem[X]
LOAD R2,Y // R2 = Mem[Y]
ADD R3,R1,R2 // R3 = R1 + R2
STORE Z,R3 // Mem[Z] = R3
5
23/01/24
6
23/01/24
7
23/01/24
8
23/01/24
9
23/01/24
10
23/01/24
11
23/01/24
Instruc2on Format
12
23/01/24
Instruc2on Format
opcode operand (s)
13
23/01/24
ADDRESSING MODES
14
23/01/24
15
23/01/24
• Example:
• ADD R1,20A6H // R1 = R1 + Mem[20A6]
• Single memory access is required to access the operand.
• No addi/onal calcula/ons required to determine the operand address.
• Limited address space (as number of bits is limited, say, 16 bits).
operand
16
23/01/24
operand
pointer
17
23/01/24
opcode register no
Register Bank
operand
18
23/01/24
opcode register no
Memory Address
operand
19
23/01/24
20
23/01/24
ADDER operand
21
23/01/24
22