Displaying series 1 3 5 7 9 . . . . . . in 8085

Monday, January 19, 2009

  • Problem:
We have to display the series 1 3 5 7 9 . . . . . up to nth term.
  • Solution:
The following 8085 program will display the series 1 3 5 7 9 11 . . . . . up to n th term.
  • Program Instruction:
  • MVI A 01
  • MVI B 09
  • LXI H F012
  • MOV M,A
  • DCR B
  • INR A
  • INR A
  • INX H
  • MOV M,A
  • DCR B
  • JNZ F009
  • HLT
  • About the instruction:
Here A is the first element of the series. B is the number of series element. The output of the Program is shown from memory location F012.
  • Output of the program with source code:
The output of the program and source code is given bellow.

0 comments:

Visitors

PlugIn.ws - Free Hit Counter, Web Site Statistics, Traffic Analysis

  © Blogger template Leaving by Ourblogtemplates.com 2008

Back to TOP