0% found this document useful (0 votes)
650 views

Sorting A Series of 10 Numbers: Flowchart

This document describes an experiment to write an assembly language program to sort a series of 10 numbers stored from address 20,000H in ascending order using the 8086 microprocessor. The algorithm initializes variables to iterate through two nested loops to compare and swap adjacent number pairs if out of order. The program code implements this algorithm, sorting the sample input data and storing the sorted output. The aim of sorting the numbers was achieved using 8086 assembly language.

Uploaded by

nothing no
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
650 views

Sorting A Series of 10 Numbers: Flowchart

This document describes an experiment to write an assembly language program to sort a series of 10 numbers stored from address 20,000H in ascending order using the 8086 microprocessor. The algorithm initializes variables to iterate through two nested loops to compare and swap adjacent number pairs if out of order. The program code implements this algorithm, sorting the sample input data and storing the sorted output. The aim of sorting the numbers was achieved using 8086 assembly language.

Uploaded by

nothing no
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Exp.

No : 11 Date:
Venue: MPMC lab (A3 –TF10 Time:
backside) Branch/year:E2-ECE
ID.No: Section: SG-02
Name:
Sorting a series of 10 numbers

AIM:
TO Write an assembly language programme to SORT a series of a
10 numbers from 20,000H in ascending order using 8086.

APPARATUS
Sl.no Name of the Specification Quantity
equipment
1 Micro processor kit 8086 1
2 Power supply 5V, DC 1
3 Key board - 1

ALGORITHM:
1. Initia1lise segment address DS=2000H.

2. Initialise outer loop count of 9 in CH.

3. Initialise offset address SI=0000H.

4. Initialise inner loop count of 9 in CL.

5. Compare two adjacent numbers pointed by SI and SI+1.

6. If they are in correct order then leave them else interchange


them.

7. Repeat the inner loop CL times

8. Repeat the outer loop CH times.

9. Voila! The series is sorted.

FLOWCHART:
-
PROGRAM:
CODE SEGMENT
ASSUME CS:CODE
MOV AX,2000H
MOV DS,AX
MOV CH,09H
BCK2: MOV SI,0000H
MOV CL,09H
BCK1: MOV AX,[SI]
CMP AH,AL
JNC SKIP
XCHG AL,AH
MOV [SI],AX
SKIP: INC SI
DEC CH
JNZ BCK2
INT 03H
CODE ENDS
END

OUTPUT FOR SORTING:

INPUT
ADRESS DATA
20000 01
20001 05
20002 09
20003 07
20004 03
20005 06
20006 02
20007 04
20008 10
20009 08

OUPUT
ADRESS DATA
20000 01
20001 02
20002 03
20003 04
20004 05
20005 06
20006 07
20007 08
20008 09
20009 10

Result: Thus the assembly language program to perform sorting of series of


10 numbers using 8086 Performed and the result is stored.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy