In this program we will see how to sort array elements in ascending order by using selection sort.
Write 8086 Assembly language program to sort the elements in a given array using selection sort technique. The array is started from memory offset 501. The size of the series is stored at memory offset 500.
In the selection sort technique, in each phase we are taking the smallest number from the array, swap the smallest element with the first element inside the array. Then move to second position, and check for second highest number form the second position to the end of the array, thus all of the elements are placed in the correct position to make them sorted.
The following image is showing how the sorting technique is working.