Saturday, May 30, 2009

Addressing Schemes

Addressing schemes is the mechanism employed for specified operands. The arrangements of opcodes and operands and their number within the instruction determine the form or format of instruction. a hypothetical machine which does not have any registers but very large cache and main memory can have the following addressing modes.
1. Immediate Addressing
2. Direct Addressing
3. Indirect Addressing
4. Stack Addressing
(1) Immediate Addressing
Under this scheme actual operand D is A the content of the operand field
D=A
This addressing is used to initialized value of variable requiring no memory access for execution.
(2) Direct addressing
in this the content A of operand field specify effective address of the operand and the next statement below implies the data is stored in the memory location specified by effective address
EA = A, D=(EA)
In this scheme only memory references are required. If the addressing scheme has n bits then address space addressable is 2n memory address.
(3) Indirect addressing:
In this addressing effective address EA and the contents of operand field are related by
EA=(A) , D=(EA)
The disadvanteg of this addressing scheme is that it requires 2 memory references to fetch the effective address from the memory and second for fetching the operand using EA. In this addressing the addressed space is determined by word length.
(4) Stack Addressing:
In this the address of operand is not specified explicitly . it is found on the top of the stack, in the absence of registers we can preserve the top of stack pointer in the memory.
Comment
All the four addressing schemes are using memory locations and not registers their disadvantage is that the addressable memory location is dependent on the instruction code length i.e., if the code is of n bits the addressable memory is 2n
Locations. The other disadvantage is the multiple accesses of locations for fetching a single data.

No comments:

Post a Comment