In computer architecture and assembly language programming, indirect and implied addressing modes are two common techniques used to specify the memory address of an operand for an instruction.
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.
Implied addressing, 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.
Both indirect and implied addressing modes are used extensively in assembly language programming, and understanding their differences and appropriate use cases is important for efficient and effective programming.
1. Indirect Addressing Mode: This is the mode of addressing where the instruction contains the address of the location where the target address is stored. So in this way, it is Indirectly storing the address of the target location in another memory location. So it is called Indirect Addressing mode.
Prerequisite - Addressing Modes
There are 2 types(or versions) of Indirect Addressing Mode: Memory Indirect, and Register Indirect.
1. Memory Indirect: In this type, we directly mention the address of the memory location in the instruction either enclosed by parenthesis or preceded by the ‘@’ character.
LOAD R1, (1005)
LOAD R1, @1005
2. Register Indirect: 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.
MOV R@, 1005
LOAD R1, (R2)
2. Implied Addressing Mode : This is the mode of addressing where the operand is specified implicitly in the definition 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.
MOV CL, 05
L1: INC AL
Here AL will be incremented by 1 every time the loop executes. Hence 1 is implied inside the instruction INC AL.
Difference between Indirect and Implied Addressing Modes :
||Indirect Addressing Mode
||Implied Addressing Mode
||Multiple memory spaces are used.
||No memory Intervention.
||Operands are explicit.
||Operands are implicit.
|Type of instruction format
||Mostly used in 2 address instructions and more.
||Mostly used in zero address and single address instructions.
||3 memory references are required.
||No memory references are required.
||The address space is large.
||The address space is small.
||Additional calculations are the only way to perform the operation.
||No additional calculations are required.
||Execution speed is less.
||Execution speed is more.
||Additional overhead incurred in searching for data.
||No additional overhead incurred in searching for data.
||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
||More flexible: allows for more dynamic memory addressing
||Less flexible: only works with predefined memory locations or registers
||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
||Slower: additional memory accesses are required to obtain the operand address
||Faster: operand location is determined directly from the instruction opcode
||More complex: requires additional instructions and memory accesses, and can be more difficult to debug
||Less complex: requires fewer instructions and is generally easier to debug
Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI
as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.