Micro-Project: Title: Sort The Array in Descending Order Description

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Micro-Project

Report
Title: Sort the array in descending order
 Brief Description:

A microprocessor is a computer processor where the data processing logic and


control is included on a single integrated circuit (IC), or a small number of ICs.
The microprocessor contains the arithmetic, logic, and control circuitry required
to perform the functions of a computer's central processing unit (CPU). The IC
is capable of interpreting and executing program instructions and performing
arithmetic operations. The microprocessor is a multipurpose, clock-driven,
register-based, digital integrated circuit that accepts binary data as input,
processes it according to instructions stored in its memory, and provides results
(also in binary form) as output. Microprocessors contain both combinational
logic and sequential digital logic, and operate on numbers and symbols
represented in the binary number system.

 Introduction:

In this micro-project, we written a program to sort the array in the descending


order. This ALP is constructed with the help of all team members and under
guidance of our project guide.
Here, we used two segments which are commonly required for an ALP and i.e.
Data Segment and Code Segment.
In data segment, we have done declaration of variable and initialization of a
variable that contains a Hexadecimal Number.
In code segment, we started actual work of our Program like stored the
Hexadecimal number in a BL resistor then storing same number in AL resistor
also and done remaining procedures.
In this project report, we also used algorithm to present step by step execution
of program and representing it with the help of flowchart.

1
 Aim of Project:

The aim of the project is to understand how the array can be sorted into
descending order.

 Course Outcomes Achieved:

o Write Assembly Language Program for given problem.


o Use instructions for different addressing mode.
o Develop an assembly language program using assembler

 Literature Review:

The objective of the Microprocessors and Microcontrollers course is the


students to meet the general idea and concepts of a low-level assembly language
and controlling the hardware devices with embedded microcontrollers. Since
this is the hardware based course, which requires a lot of efforts by both the
teachers and students, the students avoid to learn its material for gaining
knowledge, but just to pass the course and continue with their studies. Apart of
the courses bad reputation, it is usually among the courses with the lowest
throughput. Starting from 2010, the courses syllabus was changed each year
towards making the course more practical exercises and exams where the
students could use their software skills. In this paper we elaborate all changes
that improved not only the course throughput, but also the courses reputation,
average grade, curiosity to learn hardware, etc. which are presented through
years.

 Actual Methodology Followed:

1. Formation of groups.

2. Selected topic for project.

3. Prepared proposal.

4. Collection of information.

5. After collecting information prepared Project report.

6. Submitted Project report.

2
 Actual Resource Used:

SR. Name of Specification Quantity Remarks


NO resource
. /Material Used
1) Desktop Windows 11, 1 Yes
Computer Ryzen 5, 11th Gen
8GB RAM,
512GB ROM
2) Browser Google chrome 1 Yes

3) Book Microprocessors Textbook 1 Yes


By Techmax
3) Software Tasm 1.4 1 Yes

4) Websites https://www.researchgate.net - Yes

3
 ALP
Data Segment
Arr DB 04H,02H,09H,08H
Data Ends
Code Segment
Assume CS:Code, DS:Data
Start: Mov AX,Data
Mov DS,AX
Mov CH,03H
UP1: LEA SI,Arr
Mov CL,03
UP: Mov AL,[SI]
Inc SI
Cmp Al,[SI]
JC DN
Mov AH,[SI]
Mov [SI],AH
Dec SI
Mov [SI],AH
Inc SI
DN: Dec CL
JNZ UP
DEC CH
JNZ UP1
Code Ends
End Start

4
 Algorithm:

Step 1: Start
Step 2: Initialize the CH resistor with 03H
Step 3: Load effective address of Arr into SI
Step 4: Initialize the CL resistor with 03H
Step 5: Store the content of SI into AL
Step 6: SI = SI+1
Step 7: Compare AL with value of SI
Step 8: if carry = 1
Goto step no. 12
Else
Exchange the value of AH and content of SI
Step 9: SI = SI-1
Step 10: Store the content of SI into AH
Step 11: SI = SI+1
Step 12: CL = CL-1
Step 13: If CL != 0
Goto step no 5
Else
CH = CH-1
Step 14: If CH != 0
Goto step no 3
Step 15: End

 Instructions used:

1] MOV: Copies the data from to destination.


2] LEA: Used for loading effective address.
3] INC: Increments an operand by 1.
4] CMP: Compares destination word with source word, only flags are affected.
result is not stored anywhere.
5] JC: Transfer the execution control to address label if CF = 1
6] DEC: Decrements an operand by 1.
7] JNZ: Transfers the flow of execution to address label if ZF = 0.

5
 Flowchart:
Start

Initialize the CH resistor with 03H

Load effective address of Arr into SI

Initialize the CL resistor with 03H

Store the content of SI into AL

SI = SI + 1

Compare AL with value of SI

True
Carry = 1

False
Exchange the value of AH and content of SI

SI = SI - 1

Store the content of SI into AH

SI = SI + 1

CL = CL-1

True
CL != 0

False
CH = CH - 1

True
CH != 0

False
Stop
6
Output:

 Developed / Learning out of this Project:

o We got to know about various ALP instructions.


o We leant different segments of 8086.
o We learnt how to draw flowchart and write Algorithm.
o We learnt how to develop an ALP.

Name & Sign of Project Guide


Mrs. A.B. Jugale.

You might also like