Addressing modes are one of the most important concepts in Computer Organization and Architecture (COA). Every instruction executed by the CPU requires data or operands. The processor must know where these operands are located. Addressing modes define the method used by the CPU to identify the location of operands.
In simple words, an addressing mode specifies how the operand of an instruction is accessed. The operand may be stored inside a register, memory location, stack, or directly within the instruction itself. Different addressing modes provide flexibility, reduce instruction size, improve execution speed, and support efficient memory utilization.
Without addressing modes, processors would have difficulty locating data efficiently. Modern computer systems use multiple addressing modes to handle various programming requirements and optimize system performance.
The above diagram shows the major addressing modes used in Computer Organization and Architecture. Each addressing mode provides a different way for the CPU to locate and access operands during instruction execution.
Some addressing modes access data directly from the instruction itself, while others retrieve data from memory locations or CPU registers. The choice of addressing mode affects execution speed, memory usage, and instruction size.
Immediate and Register Addressing Modes are generally the fastest because they avoid additional memory access. Direct and Indirect Addressing Modes are used when data is stored in memory. Indexed, Relative, and Base Register Addressing Modes are especially useful for arrays, loops, branching, and program relocation.
Understanding the relationship between these addressing modes helps students understand how processors execute instructions efficiently and manage memory resources.
A processor may support several addressing modes. Each addressing mode calculates the effective address differently. The most common addressing modes are:
The Effective Address (EA) is the actual address of the operand after applying the addressing mode. The CPU calculates the effective address before fetching data from memory.
Formula:
Effective Address (EA) = Actual Location of Operand
Different addressing modes use different methods to calculate EA.
In implied addressing mode, the operand is not explicitly mentioned in the instruction. The processor automatically knows which operand is required.
The operand is usually stored in a predefined register such as the accumulator.
CMA
The instruction complements the accumulator content without specifying any operand.
Stack addressing mode uses a stack structure for operand storage. Operations are performed using the top elements of the stack.
The Stack Pointer (SP) automatically points to the current top of the stack.
PUSH A POP B
The diagram illustrates Immediate Addressing Mode. In this addressing mode, the operand value is directly written inside the instruction itself. The CPU does not need to search memory for the operand because the required data is already available in the instruction.
For example, in the instruction MOV R1, #25, the value 25 is directly supplied to the processor. The symbol '#' indicates that 25 is a constant value rather than a memory address.
Since no extra memory lookup is required, immediate addressing mode provides very fast execution. However, the size of the operand is limited by the instruction format.
In immediate addressing mode, the operand value is directly included in the instruction itself.
MOV R1, #25
Here, 25 is the actual data and not an address.
The above diagram demonstrates Direct Addressing Mode. Here, the address field present in the instruction directly specifies the memory location where the operand is stored.
When the CPU executes the instruction, it reads the memory address provided in the instruction and fetches the operand from that location.
For example, if the instruction contains address 500, the processor accesses memory location 500 to retrieve the required data. Since only one memory lookup is needed, this mode is simple and easy to implement.
Direct Addressing Mode is commonly used when the exact location of data is known in advance.
EA = Address Field
LOAD 500
The operand is stored at memory location 500.
The diagram shows Indirect Addressing Mode. In this method, the address field does not contain the actual location of the operand. Instead, it points to another memory location that stores the real operand address.
The CPU first accesses the specified memory location and then obtains the actual address of the operand. After that, it accesses the operand itself.
Because two memory accesses are generally required, indirect addressing is slower than direct addressing. However, it provides greater flexibility and supports access to larger memory spaces.
In indirect addressing mode, the address field points to another memory location that contains the actual address of the operand.
EA = (Address Field)
The above figure illustrates Register Addressing Mode. In this mode, the operand is stored directly inside a CPU register rather than in main memory.
The instruction specifies the register containing the operand. Since registers are located inside the processor, accessing data from them is significantly faster than accessing data from memory.
For example, in the instruction ADD R1, the operand is taken directly from register R1. This mode improves execution speed and reduces memory traffic.
Register Addressing Mode is widely used in modern processors for high-performance operations.
In register addressing mode, the operand is stored inside a CPU register.
EA = Register
ADD R1
The diagram explains Register Indirect Addressing Mode. Here, the register does not store the operand itself. Instead, it stores the memory address where the operand is located.
During execution, the CPU reads the address from the register and then accesses the corresponding memory location to obtain the operand.
This mode combines the speed of register access with the flexibility of memory addressing and is frequently used for pointer operations and dynamic data structures.
The register contains the address of the operand rather than the operand itself.
EA = (R)
The above diagram shows Indexed Addressing Mode. In this addressing technique, the effective address is obtained by adding an index register value to an address field.
The index register usually contains an offset value, while the address field represents the starting address of an array or table.
By changing the index register value, the processor can easily access different elements of an array without modifying the instruction itself.
This addressing mode is highly efficient for loops, arrays, matrices, and table processing operations.
Indexed addressing mode is commonly used for arrays and tables.
EA = Index Register + Address Field
The index register stores an offset value which is added to the address field.
The diagram represents Relative Addressing Mode. In this mode, the effective address is calculated by adding a displacement value to the current Program Counter (PC).
The Program Counter always contains the address of the next instruction to be executed. By combining the PC value with an offset, the processor can locate nearby instructions efficiently.
Relative Addressing Mode is commonly used in branch and jump instructions because it allows programs to be relocated without changing all instruction addresses.
Relative addressing mode calculates the effective address relative to the Program Counter (PC).
EA = PC + Address Field
This mode is frequently used in branch and jump instructions.
The above figure illustrates Base Register Addressing Mode. In this method, a base register stores the starting address of a memory block, while the instruction provides a displacement value.
The processor adds the displacement to the base register value to calculate the effective address.
This approach simplifies memory management and supports program relocation, making it useful in operating systems and multiprogramming environments.
A base register stores a base address. The displacement value from the instruction is added to obtain the effective address.
EA = Base Register + Displacement
The diagram shows Auto Increment Addressing Mode. In this mode, the operand is first accessed using the address stored in a register.
After the operand is fetched, the register value automatically increases by one unit or by the size of the data item.
This feature eliminates the need for separate increment instructions and makes sequential data processing more efficient.
Auto Increment Addressing Mode is commonly used while traversing arrays and buffers.
The operand is accessed first, and then the register value is automatically incremented.
EA = (R) R = R + 1
The above diagram demonstrates Auto Decrement Addressing Mode. In this technique, the register value is decreased before accessing the operand.
After decrementing the register, the processor uses the updated address to retrieve the operand from memory.
This addressing mode is particularly useful in stack implementations where data is accessed in reverse order.
Auto Decrement Addressing Mode reduces the number of instructions required for stack operations and improves execution efficiency.
The register value is decremented first and then used to access the operand.
R = R - 1 EA = (R)
| Mode | Operand Location | Speed | Memory Access |
|---|---|---|---|
| Immediate | Instruction | Very Fast | No |
| Register | Register | Very Fast | No |
| Direct | Memory | Medium | Yes |
| Indirect | Memory via Address | Slow | Multiple |
| Indexed | Memory + Index | Medium | Yes |
| Relative | PC Relative | Fast | Yes |
Addressing modes provide flexibility in instruction execution and improve processor efficiency. They allow programmers and compilers to access operands using different methods according to the application requirements. Without addressing modes, instruction formats would become larger and memory access would be less efficient.
Modern processors rely heavily on advanced addressing techniques to achieve high performance, efficient memory utilization, and faster program execution.
Addressing Modes are fundamental to Computer Organization and Architecture because they define how the CPU locates operands during instruction execution. Various addressing modes such as Immediate, Direct, Indirect, Register, Indexed, Relative, Base Register, Auto Increment, and Auto Decrement provide different methods of accessing data efficiently.
Understanding these modes helps students learn instruction execution, memory access mechanisms, processor design, and optimization techniques. Addressing modes form the foundation for advanced concepts in computer architecture and are frequently asked in university examinations, competitive exams, and technical interviews.