![]() |
VOOZH | about |
Whenever an instruction is executed, it requires the operands or data to operate on their own. There are different ways of accessing operands or data. Such methods are known as addressing modes. There are many addressing modes but in this article, we will learn about direct and immediate addressing modes. In direct addressing mode, the address field contains the address of the operand. While in immediate addressing mode, the operand is a part of the instruction.
In this addressing mode, instructions will be contains operation code also known as opcode and address to the memory location where the operand is store. It means the operand's address is explicitly provided in the instructions.
Effective Address (EA) = Address field of operand
Example: Add the contents of register 1303 to the accumulator.
Add (1303)
Only a single memory reference is required to access data. So no additional calculations are required to work out the effective address.
In this type of addressing mode, the instruction itself contain the operand and there is no need for search for it. In other words, operand is a part of instruction.
Operand = Address Field
Example: Add 3 to the accumulator.
ADD 3
No memory reference is required to fetch data. So, no additional calculations are required to work out the effective address. It is a fast method but it has a limited range.
| Parameters | Direct Addressing Mode | Immediate Addressing Mode |
|---|---|---|
| Address Field | Address fields contain the effective address of the operand. | There is no address field as an operand is a part of the instruction. In place of address field, immediate addressing mode has operand field. |
| Memory Referencing | It requires one reference to memory. | It does not require any reference to memory. |
| Process Speed | It is slower as compared to the immediate mode. | It is faster as compared to the direct addressing mode. |
| Range | It has more range than immediate mode. | It has a limited range. |
| Example | Add (1303) | ADD 3 |
| Advantage | Easy as direct reference to memory | There is no memory reference for fetching data. |
| Disadvantage | Restricted address space | Constrained operand magnitude |
| Application | It assists in accessing static data and implementing variables. | Set the register to a constant value. |