Source code of determining the large number among some numbers in 8085

Friday, January 23, 2009

  • Problem:
We have to determine the large number from a given set of number which are stored in memory.
  • Solution:
To solve this problem we have to store some value in memory. Then we have to retrive this values from memory and have to determine the largest value.
  • Program Code:
  • MVI C 05
  • MVI A 00
  • MVI B 00
  • LXI H FO1D
  • MOV A, M
  • INX H
  • MOV B,M
  • CMP B
  • JM F014
  • MOV D,A
  • JMP F015
  • MOV D,B
  • MOV A, D
  • DCR C
  • JNZ F00A
  • MOV M,A
  • HLT
  • About Source Code:
In this program I have stored 5 numbers in memory, starting at F01D. C indicates the number of values. The large number is stored in memory location Fo22.
  • Source Code and Output of the program:

0 comments:

Visitors

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

  © Blogger template Leaving by Ourblogtemplates.com 2008

Back to TOP