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:
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
- The direct addressing mode contains the concerned operand in the instruction code’s address field.
- It requires no memory references for accessing the data.
- It makes use of a comparatively smaller space than the indirect mode.
- One requires no additional overhead for searching the effective address of an operand.
- One requires no additional overhead for searching the effective address of an operand.
- The direct method is comparatively faster. One can easily access memory.
- The Direct Addressing Mode does not classify further into any categories.
Indirect Addressing Modes
- In the case of an indirect addressing mode, the operand’s address stays in the address field of any instruction.
- It requires multiple memory references for searching an operand.
- It makes use of a comparatively larger space than the direct mode.
- The additional calculation is a prerequisite to performing any given operation here.
- You would always require overhead to search for the operand’s address.
- The indirect method performs at a comparatively slower speed. It takes time to access memory.
- The Indirect Mode is further classified into two major categories- the Memory Indirect and the Register Indirect modes.
Direct Addressing Mode vs Indirect Addressing Mode
Direct Addressing Mode | Indirect Addressing Mode |
Address field contains effective address of operand. | Address field contains memory location where effective address is present |
One memory reference to access operand | Two memory reference to access operand |
Fast | Slow |
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 operand | More calculation to access operand. |
ncG1vNJzZmiumauupbXFn5yrnZ6YsrR6wqikaJyZm7OmvsSnmp5lkprBuLHEp2SdoaKasLV5wKebZqGembazscKtZJqclKeytL%2FIp55mpZ%2BZsrR7