Program For Arranging Data Array in Ascending Order
Program For Arranging Data Array in Ascending Order
Program For Arranging Data Array in Ascending Order
Aim
1. Program for arranging data array in ascending order
2. Program for arranging data array in descending order
Apparatus
Microprocessor Kit 8085 , Key Board, Op-Code Sheet.
Theory
Program for arranging data array in ascending order:
In the programmer three counts have been used. Count 1 is stored in register B to check whether all the numbers of the
series have been arranged in ascending order. Count 2 is stored in register C tocheck whether all the numbers of the series
have been compared while selecting the smallest number of the series. After the selection of the smallest number it is to be
ascertained which number was the smallest. At this stage register C is free . The register C is again used in SUBROUTINE-
2 to store count 3 to check which number has been selected as the smallest number. The smallest number is replaced by FF
in the series. Again the program to find smallest number is taken up to select the smallest number in the modified series.
Precautions
1. All steps should be followed carefully.
Procedure
Program for arranging data array in ascending order:
1. Key in the Opcodes from the address specified.
3. Execute the program and check for the result from 4601.
4. Change data from 4500 and execute each time and check for result.
3. Execute the program and check for the result from 4601.
4. Change data from 4500 and execute each time and check for result.
4505-15
4506-30
4501-60 4602-25
4502-40 4603-40
4503-50 4604-50
4504-15 4605-60
4505-25
Sources of Error