10 Difference Between Direct and Indirect Addressing Modes

October 2022 · 3 minute read

What Is an Addressing Mode?

An addressing mode is basically a technique used for determining the operand that associates with any given instruction. The job of a microprocessor is to execute a set of instructions stored in memory to perform a specific task. Operations require the following:

  • The operator or opcode which determines what will be done
  • The operands which define the data to be used in the operation
  • For example, if we wanted to add the numbers 1 and 2 and get a result, mathematically we would likely write this as 1 + 2. In this case, our operator is (+), or the addition, and our operands are the numbers 1 and 2.

    In a microprocessor, the machine needs to be told how to get the operands to perform the operation. The effective address is a term that describes the address of an operand that is stored in memory. There are several methods to designate the effective address of those operands or get them directly from the register. These methods are known as addressing modes.

    Direct Address Mode − In this mode, the effective address is equal to the address part of the instruction. The operand resides in memory and its address is given directly by the address field of the instruction. In a branch-type instruction, the address field specifies the actual branch address.

    Indirect Address Mode − In this mode, the address field of the instruction gives the address where the effective address is stored in memory. Control fetches the instruction from memory and uses its address part to access memory again to read the effective address.

    Direct Addressing Mode

    Indirect Addressing Modes

    Direct Addressing Mode vs Indirect Addressing Mode

    Direct Addressing ModeIndirect Addressing Mode
    Address field contains effective address of operand.Address field contains memory location where effective address is present
    One memory reference to access operandTwo memory reference to access operand
    FastSlow
    Address size of operand is limited to size of address field.No such limitation. Because operand address is stored in main memory.
    Less calculation to access operandMore calculation to access operand.
    Previous article12 Difference between DDR3 and DDR4Next article7 Difference between Definition and Declaration

    ncG1vNJzZmiumauupbXFn5yrnZ6YsrR6wqikaJyZm7OmvsSnmp5lkprBuLHEp2SdoaKasLV5wKebZqGembazscKtZJqclKeytL%2FIp55mpZ%2BZsrR7