maximum, minimum, ascending and descending
maximum, minimum, ascending and descending
: Name:
Date: Roll no.:
Batch:
Maximum number, Minimum number, Ascending & Descending number order using
8085
AIM
To find the maximum number and minimum number (using 8085 microprocessor) among 10 numbers and
ascending and descending order of an array
APPARATUS REQUIRED
8085 microprocessor
Power supply
ALGORITHM
1) To find maximum and minimum number
Initialize the HL pointer to the memory The contents of the memory are
location pointer compared with the accumulator
Load the data in the counter variable Specify the opcode to find maximum
Decrement counter variable at C number
Now the counter of the memory are Specify opcode to find minimum
moved to accumulator for completing number
functions After completing functions store data
The register is incremented to next and then processing of instruction is
number stopped
2) Ascending order
Initialize HL pair at memory pointer Decrement D by 1
Get the counter at 5000H in C register Repeat steps 4,5 and 6 till D becomes
Copy it in D register for bubble sort zero
Get the first value in A register Decrement C by 1
If they are out as order, exchange Repeat steps 3 and 9 till C value
contents of memory and accumulator becomes zero
3) Descending order
Initialize HL pair as memory pointer Decrement D by 1
Get the count of 6000H into C register Repeat steps 5 and 6 till D register
Copy it in D-register for bubble sort becomes zero
Get the first value in a register Decrement C by 1
Compare it with value in A register Repeat step 3-9 until C value becomes
If they are out of order, exchange zero
contents as memory and accumulator
MAXIMUM NUMBER
Input Output
6000:00 6006:06 6000:00 6005:06
6001:01 6007:07 6001:0C 6006:05
6002:02 6008:0A 6002:0B 6007:04
6003:03 6009:0B 6003:0A 6008:03
6004:04 600A:0C 6004:07 6009:02
6005:05
RESULT:
Thus, maximum and minimum number from a set of 10 numbers is determined and the numbers are
arranged om ascending order descending order