25 March 2009

direct addressing & indirect addressing

  • Direct addressing

another simple method for specifying an operand is to give the address of the memory word where the operand is contained. in other words a method for specifying an operand in memory is just to give its full address.this form is called direct addressing.

in this type of addressing the memory word can be longer than that of the operand part which is not in case of immidiate addressing.

like immidiate addressing,direct addressing is restricted in use: the instruction will always access exactly the same memory location. so while the value can change,the location cannot.
thus direct addressing can only be used to access global variables wose address is known at compile time.


  • Indirect addressing
direct addressing is a scheme in which the data address specifies which memory word or register contains the operand. indirect addressing is a scheme in which the address specifies which memory word/register contains not the operand but the address of the operands.

some machine allow multilevel indirect addressing.in this addressing mode, a pointer is used to locate memory word that itself points to another memory word.and so on.immidiate ,direct ,indicate and multilevel indirect addressing exhibit a certain progression.

immediate addressing requires 2 memory references, 1 for the pointer and 1 for the operand. multi-level indirect addressing requires at least 3 memory refrences, two or more pointers and one for the operand. memory refrences in this context include register refrences.