0
bZk's Avatar, Join Date: Jul 2009
bZk
Newbie Member
Quote:
Originally Posted by khurramee1 View Post
sir i need a programme in Assembly Language to find the maximum number and the minimum number from an array of ten numbers.
Find Smallest byte from array of ten bytes. Assuming that the bytes are stored in memory from address location 5000H ;

Code:
 LDA 5000H ;[Loads accumulator with data from memory location 5000H i.e. our first number]
 LXI H,5001H ;[Moves 5001H into register pair H-L]
 MVI C,09H ;[Initialize counter at 9 as we need to compare nine times]
L2: CMP M ;[Compare the number in memory with that in accumulator]
JC L1 ;[Jump if CF = 1]
MOV A,M ;[Move data from memory to accumulator]
L1: INX H ;[Increment H-L pair data]
DCR C ;[Decrement Register C Data]
JNZ L2 ;[Jump if ZF = 0]
MOV M,A ;[Move data from accumulator to memory]
HLT ;[Halt]
On the similar lines, we will write the program to find the greatest bit as follows


Code:
 LDA 5000H ;[Loads accumulator with data from memory location 5000H i.e. our first number]
 LXI H,5001H ;[Moves 5001H into register pair H-L]
 MVI C,09H ;[Initialize counter at 9 as we need to compare nine times]
L2: CMP M ;[Compare the number in memory with that in accumulator]
JNC L1 ;[Jump if CF = 0]
MOV A,M ;[Move data from memory to accumulator]
L1: INX H ;[Increment H-L pair data]
DCR C ;[Decrement Register C Data]
JNZ L2 ;[Jump if ZF = 0]
MOV M,A ;[Move data from accumulator to memory]
HLT ;[Halt]
0
aryanilu143's Avatar, Join Date: Dec 2010
Newbie Member
thanh u dear ,plz sort out my problem .and tell me,.
write a program in assemly lang. of 8085 to sort a given set of 8 bit items stored at consecutive memory location? plz ans it and tell me now bcoz tomr. is my exam ,or send me at aryanilu143@gmail.com.i will be thankful.