Computer Architecture
Computer Architecture
Sc CS - Computer Architecture
4. ADDRESSING MODES
• Addressing modes refers to the way in which the operand of an instruction is
specified.
• The addressing mode specifies a rule for interpreting or modifying the address
field of the instruction before the operand is actually executed.
27
II B.Sc CS - Computer Architecture
Implied Mode
In this addressing mode, the instruction itself specifies the operands implicitly. It is
also called as implicit addressing mode. All register-reference instructions that make
use of the Accumulator are Implied Mode instructions.
Examples:
- The instruction “Complement Accumulator” is an implied mode instruction.
- RAL – Rotate Left with Carry
Immediate Mode
In this addressing mode, the operand is specified in the instruction explicitly.
Instead of address field, an operand field is present that contains the operand.
• Examples:
- ADD 10 will increment the value stored in the accumulator by 10.
- MOV R,20 initializes register R to a constant value 20.
Register Mode
In this mode the operand is stored in the register and this register is present in CPU.
The instruction has the address of the Register where the operand is stored.
Advantages
• Shorter instructions and faster instruction fetch.
• Faster memory access to the operand(s)
Disadvantages
• Very limited address space
• Using multiple registers helps performance but it complicates the instructions.
Register Indirect Mode
• In this mode, the instruction specifies the register whose contents give us the
address of operand which is in memory. Thus, the register contains the address
of operand rather than the operand itself.
28
II B.Sc CS - Computer Architecture
Effective Address
• The memory address of an operand consists of two components:
- Starting address of memory segment.
- Effective address or Offset: An offset is determined by adding any
combination of three address elements: displacement, base and index.
• Displacement: It is an 8 bit or 16 bit immediate value given in the instruction.
• Base: Contents of base register, BX or BP.
• Index: Content of index register SI or DI.
Direct Addressing Mode
• In this mode, effective address of operand is present in instruction itself. Single
memory reference to access data.No additional calculations to find the effective
address of the operand.
Example: ADD R1, 4000 - In this the 4000 is effective address of operand.
29