![]() |
VOOZH | about |
Addressing modes are the techniques used by the CPU to identify where the data needed for an operation is stored. They provide rules for interpreting or modifying the address field in an instruction before accessing the operand.
Indirect and implied addressing modes are two common techniques used to specify the memory address of an operand for an instruction in computer architecture. Indirect addressing mode the address of effective address is specified by the instruction whereas in implied addressing mode , address is not specified explicitly.
Indirect addressing involves specifying a memory address that contains the actual address of the operand. This can be useful when the actual address of the operand is not known at the time the instruction is executed.
In indirect addressing, the address of the operand is obtained by accessing the memory location specified by the indirect address. For example, in the instruction "MOV AX, [BX]", the memory location specified by the contents of the BX register is accessed to obtain the actual address of the operand.
There are 2 types of Indirect Addressing Mode
In this type, we directly mention the address of the memory location in the instruction either enclosed by parenthesis or preceded by the '@' character.
Example:
LOAD R, (1005)
or
LOAD R, @1005
In this type, the address of the target memory location will be stored in the register and the register will be mentioned in the instruction.
Example:
MOV R1, @R2
LOAD R1, (R2)
Implied addressing mode , on the other hand involves not explicitly specifying an address for the operand, but instead relying on the instruction's operation code (opcode) to implicitly determine the location of the operand.
This is typically used when the operand is a register or a fixed memory location that is known in advance. For example, in the instruction "INC AX", the operand is the AX register, which is implicitly specified by the opcode of the instruction.
This mode of addressing is normally used in zero address (e.g., Stack operations) and one address (e.g., MUL AL) instructions. Hence the operand is implied inside the instruction, it is called Implied Addressing Mode.
Example:
Example: CLC
(used to reset Carry flag to 0)
The table below represents the difference between indirect and implied addressing modes.
| Feature | Indirect Addressing | Implied Addressing |
|---|---|---|
| Addressing Method | Explicit: Address of the operand is stored in a memory location specified by the instruction. | Implicit: The operand's location is determined by the instruction opcode. |
| Flexibility | More flexible: Allows dynamic memory addressing. | Less flexible: Only works with predefined memory locations or registers. |
| Code Size | Requires more code: Additional instructions are needed to load the operand address from memory. | Requires less code: Operand location is determined by the instruction opcode, which is shorter. |
| Execution Speed | Slower: Additional memory accesses are required to obtain the operand address. | Faster: Operand location is determined directly from the instruction opcode. |
| Complexity | More complex: Requires additional instructions and memory accesses, making debugging harder. | Less complex: Requires fewer instructions, easier to debug. |
| Memory Usage | Multiple memory spaces are used. | No memory intervention needed. |
| Operands | Operands are explicit (need to be specified). | Operands are implicit (predefined or assumed). |
| Instruction Format | Mostly used in two-address instructions or more. | Mostly used in zero-address or single-address instructions. |
| Memory References | Requires three memory references. | Requires no memory references. |
| Address Space | Large address space available. | Small address space. |
| Calculations | Additional calculations required for operation. | No additional calculations required. |
| Overhead | Additional overhead incurred in searching for data. | No additional overhead incurred. |