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

CO

Computer organisation.

Uploaded by

minato123456y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

CO

Computer organisation.

Uploaded by

minato123456y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

NITTE MEENAKSHI INSTITUTE OF TECHNOLOGY

AN AUTONOMOUS INSTITUTION, AFFILIATED TO VISVESVARAYA TECHNOLOGICAL UNIVERSITY,


BELGAUM, APPROVED BY AICTE & GOVT.OF KARNATAKA

REPORT
on

SMALLEST AND LARGEST NUMBER USING 8085


SIMULATOR
Submitted in partial fulfilment of the requirement for the award of Degree of

Bachelor of Engineering
in

Information Science and Engineering


Submitted by:
CHARAN.F.ANGADI 1NT23IS058
BHARATH KUMAR SL 1NT24IS404-T

Programme Organized and Conducted by,


Department of Information Science and Engineering, NMIT
CERTIFICATE

This is to certify that the Report on “SMALLEST AND LARGEST NUMBER USING 8085
SIMULATOR ” is an authentic work carried out by CHARAN(1NT23IS058),
BHARATH(1NT24IS404-T). both bonafide students of Nitte Meenakshi Institute of
Technology, Bangalore, fulfilled the requirements to be awarded a Bachelor of Engineering
degree in Information Science and Engineering from Visvesvaraya Technological University,
Belagavi. It is confirmed that the report has been updated to reflect the adjustments and
suggestions made during the assessment.

Signature of Internal Reviewer Signature of HoD

Name: Dr. Mohan S G


Designation: Professor and HoD, ISE

Signature of External Reviewer

Name:
INTRODUCTION

A software program that simulates the work of the Intel


8085 microprocessor is known as an 8085 simulator.
Throughout the late 1970s and early 1980s, the Intel
8085, an 8-bit microprocessor, was widely utilized in a
different computer systems and embedded devices.
Without the need for actual hardware, users may create
and execute 8085 software on a computer by using a
simulator. Users may create, debug, and test assembly
language programs for the 8085 architectures in this
virtual environment. In an interactive and regulated
setting, hobbyists and students may learn about
microprocessor design and programming with the help
of simulators. We'll make use of a pre-established array
of integers that are kept in memory, and the software
will loop over the array.
PROGRAM:
For checking
smallest number:
LXI H,8000
MVI
C,04
MOV
A,M

LOOP: INX H
CMP M
JC
SMALLES
T MOV
A,M

SMALLEST: DCR C
JNZ
LOOP
STA
8010
HLT
For checking
largest
number: LXI
H,8000
MVI
C,04
MOV
A,M

LOOP: INX H
CMP M
JC
LARGEST
MOV A,M

LARGEST: DCR C
JNZ
LOOP
STA
8010
HLT
PROGRAM EXPLANATION:

LXI H, 8000: Uses memory address 8000H to initialize


the HL register pair.
MVI C, 04: Transfers the current value 04H to register
C immediately. This number serves as a counter for the
loop.
MOV A, M: Fills register A with the contents of the
memory location that the HL register pair designates.
LOOP: The label during beginning of the loop.
INX H: Increases the pair of HL registers to
indicate the subsequent memory address. CMP M:
Compares the contents of register A with memory
location HL.
JC LARGEST: If the carry flag is set (A is lesser than
the memory contents), it jumps to the LARGEST label.
Transfers the contents of memory location HL
to register A (MOV A, M). MOV A, M:
Moves the content of the memory location HL
into register A.
LARGEST: Label for the situation in which A exceeds or
equals the amount stored in memory. DCR C: Reduces
register C's loop counter
JNZ LOOP: If the loop counter (C) is not zero, the
loop returns to the LOOP label. STA 8010: Stores
register A's contents in memory address 8010H.
HLT: The program is halted.
Beginning at address 8000H, this code appears to be
determining which value in memory is the biggest and
storing it in memory location 8010H. MVI C, 04
specifies that the loop executes four times and to
compare and update the greatest value.

LXI H, 8000: Uses memory address 8000H to initialize


the HL register pair.
MVI C, 04: Transfers the current value 04H to register
C immediately. This number serves as a counter for the
loop.
MOV A, M: Fills register A with the contents of the
memory location that the HL register pair designates.
LOOP: The label during beginning of the loop.
INX H: Increases the pair of HL registers to
indicate the subsequent memory address. CMP M:
Compares the contents of register A with memory
location HL.
JC SMALLEST: If the carry flag (A is smaller than the
memory content) is set, the algorithm jumps to the
SMALLEST label.
Transfers the contents of memory location HL
to register A (MOV A, M). JMP LOOP:
Returns the loop to the LOOP label by
jumping back there.
SMALLEST: Label the situation in which A is
lesser than the quantity of memory. DCR C:
Reduces register C's loop counter.
JNZ LOOP: If the loop counter (C) is not zero, the
loop returns to the LOOP label. STA 8010: Stores
register A's contents in memory address 8010H.
HLT: The program is halted.
This code searches memory beginning at address
8000H for the lowest integer, which it then puts in
memory location 8010H. As mandated by MVI C, 04,
the loop executes four times to compare and update the
value that is the least.
PROGRAM OUTPUT:

 At the beginning the accumulator holds 00. In the


memory address 8000 , 7 is found and next memory
address is fetched which is 8001, the value is 6 is
found and compares with 6 and 7. As 7 is large, it is
stored in register. The largest number found after
simulation and running line by line is at memory
address 8010 and return the value as 09.
 At the beginning the accumulator holds 00. In the
memory address 8000 , 7 is found and next memory
address is fetched which is 8001, the value is 6 is
found and compares with 6 and 7. As 7 is small, it
is stored in register. The largest number found after
simulation and running line by line is at memory
address 8010 and return value as 03.
Problem Statement: Smallest and Largest Number :
 Problem Overview:
The task is to find the smallest and largest number in
a given set of numbers using the 8085
microprocessor. These numbers can be stored in
memory locations, and the program will use
comparisons to determine which number is the
smallest and which is the largest.
 Input/Output Description:
o Input: A list of numbers in memory (e.g., 8-bit

values).
o Output: The smallest and largest numbers from

the list.
Algorithm to Find Smallest and Largest Number :
 Step-by-Step Algorithm:
1. Load the first number into the accumulator (A
register).
2. Compare the next number with the value in A.
3. If the next number is smaller than A, load it into
A (for smallest number).
4. If the next number is larger than A, save it as the
largest.
5. Continue this process for all numbers in the list.
6. After finishing the comparison, output the
smallest and largest numbers.

. Running the Program on 8085 Simulator :

 Step-by-Step Execution:
o Open the 8085 Simulator.

o Enter the assembly code for smallest or largest

number.
o Load the memory with the input numbers.

o Run the simulation step by step to observe how

the program executes.


 Simulation Output:
Once the program is run, the output will show the
smallest or largest number stored at the designated
memory location.
9. Conclusion :
 Summary of Key Findings:
The 8085 microprocessor can efficiently find the
smallest and largest numbers through simple
comparison operations. The assembly language code
for such tasks is compact and can be implemented
with minimal resources.
 Applications:
These techniques are useful in various applications
where numerical analysis or comparisons need to be
performed, such as sensor data processing, sorting
algorithms, or real-time control systems.
 Future Work:
o Expanding this concept to larger datasets.

o Implementing more advanced sorting or

searching algorithms on the 8085.


o Integrating external memory or I/O operations

for real-time systems.


10. References :
 [8085 Microprocessor Manual]
 [8085 Simulator Documentation]
 [8085 Assembly Language Programming Textbook]
 [Online 8085 Tutorial Resources]

By structuring your report in this manner, you can provide


a thorough explanation of how to find the smallest and
largest numbers using the 8085 microprocessor, and the
necessary details regarding assembly language,
programming, and simulation tools. Each section will
provide both conceptual insights and practical code
examples for better understanding.

You might also like