Open In App
Related Articles

Difference between Direct and Indirect Addressing Modes

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
Prerequisite: Addressing Modes 

1. Direct Addressing Mode: In direct addressing mode, the address field in the instruction contains the effective address of the operand and no intermediate memory access is required. Nowadays it is rarely used.

Example: Add the content of R1 and 1001 and store back to R1:

Add R1, (1001) 

Here 1001 is the address where the operand is stored. 

2. Indirect Addressing Mode: In Indirect addressing mode, the address field in the instruction contains the memory location or register where the effective address of the operand is present. It requires two memory access. It is further classified into two categories: Register Indirect, and Memory Indirect. 

Example:

LOAD R1, @500

The above instruction is used to load the content of the memory location stored at memory location 500 to register R1. In other words, we can say, effective address is stored at memory location 500. 

Difference between Direct and Indirect Addressing Modes:

ParametersDirect Addressing ModeIndirect Addressing Mode
Address FieldAddress field contains the effective address of operand.Address field contains reference of effective address.
Memory ReferencesRequires only one memory referenceRequires two memory references
Processing SpeedThis addressing mode has fast addressing compared to indirect addressing modeIt is slower than direct addressing mode.
ClassificationNo further classificationFurther classified into two categories- Memory Indirect and Register Indirect Addressing Mode.
CalculationNo further calculation is required to perform the operation.Requires further calculation to find the effective address.
Address SpaceIt occupies a smaller amount of space than the indirect mode.It occupies a large amount of space than the direct mode.
OverheadNo additional overhead is involved while searching for operand.Additional overhead is involved while searching for operand.
AdvantageEasy as no intermediary is involved.Availability of large address space.
DisadvantageAddress space is restricted.Requires more number of memory references.
ApplicationIt aids in accessing static data and using variables.It assists in passing arrays as parameters and implementing pointers.
Feature Direct Addressing Indirect Addressing
 
Addressing method Explicit: address of the operand is directly specified in the instruction Explicit: address of the operand is stored in a memory location specified by the instruction
 
FlexibilityLess flexible: only allows for fixed memory addressing More flexible: allows for more dynamic memory addressing
 
Code size Requires less code: operand address is directly specified in the instruction Requires more code: additional instructions are needed to load the operand address from memory
 
Execution speed Faster: operand address is immediately available Slower: additional memory accesses are required to obtain the operand address
 
ComplexityLess complex: requires fewer instructions and is generally easier to debug More complex: requires additional instructions and memory accesses, and can be more difficult to debug
 

Last Updated : 05 May, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads