Lesson on Addressing Modes Continued....


Auto increment mode

The effective address of the operand is the contents of a register specified in the instruction.

  • After accessing the operand, the contents of this register are automatically incremented to point to the next item in a list.
  • Assembler syntax: (Ri) +
  • Addressing Function: EA = [Ri]; Increment +Ri

The amount of incrementation depends on the size of the operands. If the operand is of 1 Byte it increments by 1, if the operands are of 4 bytes it increments by 4.

Program

Auto decrement mode

The contents of a register specified in the instruction are first automatically decremented and are then used as the effective address of the operand. 

Assembler syntax : -(Ri) Addressing function : Decrement Ri;
EA =[Ri]
In this mode, the operands are accessed in the descending order

Programs

  1. Program to exchange the contents of two memory location
  2. Program to add first 5 natural numbers
  3. Program to add the contents of 5 memory location
  4. Program to generate the Fibonacci series of 7 terms (0,1,1,2,3,5,8) store the terms in memory

Lesson on Addressing Modes << Previous
Next >> Stacks


Support us generously: contact@lessons2all.com

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus






Footer1