Lesson on Addressing Modes Continued....


Index mode

In this the effective address of the operand is generated by adding a constant value to the contents of a register.

Assembler syntax: X(Ri)
Addressing Function: EA=[Ri] +X
Where X denotes a constant

The register used may be either a special register provided like SI or DI of Intel 8086 processor or general purpose registers.

Contents of Index registers are not changed in the process of generating the effective address

The value of the constant may be given either as an explicit number or as a symbolic name representing a numerical value

In the figure shown R1 is the Index register which contains address of memory location and the value of X is 20 which is displacement or offset from this location where the actual operand is found The alternative way in which X corresponds to the memory location and contents of R1 corresponds to the offset or displacement
In either the case the EA is sum of the two values one given as explicit number and another one in the register.

Program: To show usefulness of Index addressing mode

Relative mode

  • The effective address is determined by the Index mode using the program counter in place of the general-purpose register Ri.
  • Assembler syntax: X(PC)
  • Addressing Function : EA=[PC] +X

Consider the previous examples where, the if condition is satisfied the control jumps to the location labeled as LOOP. The location can be computed by specifying it as an offset from the current value of the program counter. Since the branch target may be either before or after the branch instruction, the offset will be a signed number.
Consider Previous example and how the offset value for the branch instruction is calculated. Each instruction takes 4 location. The body of the loop contains 4 instructions.


Lesson on Addressing Modes << Previous
Next >> Lesson on Addressing Modes


Support us generously: contact@lessons2all.com

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus








Footer1