Question: Write an 8 0 8 5 Assembly Language Program to arrange an array in ascending order. ALGORITHM: 1 . Initialize HL pair as memory pointer

Write an 8085 Assembly Language Program to arrange an array in ascending order. ALGORITHM: 1. Initialize HL pair as memory pointer 2. Get the count at 4200H into C register 3. Copy it in D register (for bubble sort (N-1) times required)4. Get the first value in A register 5. Compare it with the value at next location. 6. If they are out of order, exchange the contents of A register and Memory 7. Decrement D register content by 18. Repeat steps 5 and 7 till the value in D- register become zero 9. Decrement C register content by 110. Repeat steps 3 to 9 till the value in C register becomes zero OBSERVATION: Input: 420005(Array Size)420105420204420303420402420501 Output: 420005(Array Size)4201014202024203034204044205055. Write an 8085 Assembly Language Program to arrange an array in ascending order.
ALGORITHM:
1. Initialize HL pair as memory pointer
2. Get the count at 4200 H into C - register
3. Copy it in D -register (for bubble sort (\(\mathrm{N}-1)\) times required)
4. Get the first value in \( A \)- register
5. Compare it with the value at next location.
6. If they are out of order, exchange the contents of A-register and Memory
7. Decrement D-register content by 1
8. Repeat steps 5 and 7 till the value in D- register become zero
9. Decrement C -register content by 1
10. Repeat steps 3 to 9 till the value in C - register becomes zero
OBSERVATION:
Write an 8 0 8 5 Assembly Language Program to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!