Difference between Direct and Indirect Addressing Modes

In this article, we will be discussing two types of addressing modes namely – Direct and Indirect addressing modes, and will also be highlighting the important differences between them.

Addressing is the process of accessing the data required for performing a specific operation. Depending on the type of microprocessor used, there are different types of addressing modes. Basically, an instruction fetched by the microprocessor from the memory has a particular format i.e., it constitutes an opcode and an operand.

What is a Direct Addressing Mode?

Direct addressing mode is a type of addressing in which the memory address of the data on which the operation has to perform is directly available in the instruction format of the accessed instruction taken from the memory. Since the actual memory address of the data to be fetched from the specified memory location is present in the executed instruction, it is also sometimes referred to as absolute addressing mode.

In this case, when an instruction is fetched from the memory of the microprocessor, and executed, no separate calculations have to be performed in order to obtain the memory address location containing the required data.

For instance, if the instruction to be executed is as follows –

“SUB D”

Where, the opcode in the above instruction is ‘SUB’, which performs the operation of subtraction on the operand. While ‘D’ is the memory address location of the data on which the ‘SUB’ operation is to be performed on.

Direct Addressing Mode

The instruction then fetches the address ‘D’ which holds the actual operand on which the ‘SUB’ operation has to be performed, and then finally the microprocessor executes the instruction successfully on fetching the operand from the address location.

What is an Indirect Addressing Mode?

Indirect addressing mode is a type of addressing in which the memory address of the data on which the operation has to be performed is indirectly available in the instruction format of the accessed instruction taken from the memory.

Indirect Addressing Mode

In other words, the actual address of the data or operand on which the operation has to be performed is obtained via a dual memory referencing method, wherein the actual memory address location of the operand is present within another memory address location whose memory or register value is present within the accessed instruction.

In contrast to the direct addressing mode, some special calculations have to be performed in order to obtain the memory address of the location which contains the operand on which the operation has to be performed.

For instance, if the instruction to be executed is as follows –

“ADD B”

Where, the opcode in the above instruction is ‘ADD’, which performs the operation of addition on the operand. While ‘B’ is the memory location of the address containing the operand on which the ‘ADD’ operation is to be performed. The instruction then fetches the address ‘B’ which holds the memory location of the address where the operand is present, and then finally the microprocessor executes the instruction successfully on fetching the operand from this address location.

Difference between Direct and Indirect Addressing Modes

The following table illustrates the key differences between the direct addressing mode and indirect addressing mode as given below –

ParameterDirect Addressing ModeIndirect Addressing Mode
DescriptionThe instruction contains the actual memory address location of the operand.The instruction contains the address of the address containing the operand.
WorkingFirstly, the address of the operand is read and then the operand is fetched from the memory location to perform the specified operation.Firstly, the effective address of the location containing the address of the location where the operand is present is read, and then the data is retrieved from that memory location.
SpeedSince the address of the operand is directly available in the instruction, the speed of executing the operation is comparatively high.Since the address of the operand is not directly available in the instruction, the speed of executing the operation is comparatively low.
Address sizeSince only one address location is required to retrieve the data, the address space occupied by the operand is less.Since dual address locations are required to retrieve the data, the address space occupied by the operand is large.
Memory referencingOnly a single memory referencing is used to access the operand.Dual memory referencing is used to access the operand.
ClassificationDirect addressing mode cannot be further classified.Indirect addressing mode can be further subdivided into – register indirect and memory indirect.

Conclusion

In conclusion, addressing is a fundamental technique of accessing the data from the specified location in order to execute the operation present in the opcode part of the instruction. Addressing modes can be several types, the two most prominent ones have been discussed and distinguished in this article and are namely – the direct addressing mode and the indirect addressing mode.

The most significant difference between them is that the direct addressing mode is based on single memory referencing wherein the memory location of the data is directly available in the operand part of the instruction. Whereas, in the case of an indirect addressing mode, dual memory referencing is used wherein the memory location of the data is present within another address location present in the operand part of the instruction.

Leave a Comment