

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8086 program for selection sort
In this program we will see how to sort array elements in ascending order by using selection sort.
Problem Statement
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.
Discussion
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.
Input
Address | Data |
---|---|
… | … |
500 | 06 |
501 | 51 |
502 | 24 |
503 | 2C |
504 | CF |
505 | 3E |
506 | 45 |
… | … |
Flow Diagram
Program
Output
Address | Data |
---|---|
… | … |
500 | 06 |
501 | 24 |
502 | 2C |
503 | 3E |
504 | 45 |
505 | 51 |
506 | CF |
… | … |
- Related Questions & Answers
- C Program for Selection Sort?
- Python Program for Selection Sort
- C++ program for Sorting Dates using Selection Sort
- Selection Sort program in C#
- Selection Sort in Python Program
- Selection Sort
- Java program to implement selection sort
- C++ Program to Implement Selection Sort
- Selection sort in Java.
- 8085 Program to perform sorting using selection sort
- Java Program to set Selection Mode for JList only for single selection
- Difference Between Insertion Sort and Selection Sort
- Difference Between Bubble Sort and Selection Sort
- Python Program for Activity Selection Problem
- C Program for Activity Selection Problem
Advertisements