0% found this document useful (0 votes)
4 views44 pages

Microprocessor Lab Manual

The Microprocessors Lab Manual for B.Tech V Semester at J.C. Bose University outlines the vision, mission, program outcomes, and specific objectives of the Electrical Engineering Department. It includes a detailed syllabus for the Microprocessors Lab (ELPC 553), listing various experiments focused on 8085 and 8086 microprocessors, along with general instructions for lab conduct. The manual emphasizes the development of practical skills in microprocessor architecture, programming, and interfacing, aiming to prepare students for professional careers in electrical engineering.

Uploaded by

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

Microprocessor Lab Manual

The Microprocessors Lab Manual for B.Tech V Semester at J.C. Bose University outlines the vision, mission, program outcomes, and specific objectives of the Electrical Engineering Department. It includes a detailed syllabus for the Microprocessors Lab (ELPC 553), listing various experiments focused on 8085 and 8086 microprocessors, along with general instructions for lab conduct. The manual emphasizes the development of practical skills in microprocessor architecture, programming, and interfacing, aiming to prepare students for professional careers in electrical engineering.

Uploaded by

dcsamaldacollege
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MICROPROCESSORS LAB MANUAL

Subject: Microprocessors Lab


Subject Code: ELPC 553
[Link] V Semester

Department of Electrical Engineering


J. C. Bose University of Science and Technology
YMCA, Faridabad-121 006
DEPARTMENT OF ELECTRICAL ENGINEERING

0
VISION OF THE DEPARTMENT
Electrical Engineering Department congregates the challenges of new technological
advancements to provide comprehensively trained, career-focused, morally strong accomplished
graduates, cutting-edge researchers by experimental learning which contribute to ever-changing
global society and serve as competent engineers.

MISSION OF THE DEPARTMENT

 To commit excellence in imparting knowledge through incubation and execution of high-


quality innovative educational programs.
 To develop the Research-oriented culture to build national capabilities for excellent power
management.
 To inculcate and harvest the moral values and ethical behavior in the students through
exposure of self -discipline and personal integrity.
 To develop a Centre of Research and Education generating knowledge and technologies
which lay ground work in shaping the future in the field of electrical engineering.

1
PROGRAM OUTCOMES (POs)

Graduates of the Electrical Engineering program at JCBUST, YMCA will be able to:
PO1. Apply knowledge of mathematics, science, engineering fundamentals, and electrical
engineering specialization to the solution of engineering problems.
PO2. Identify, formulate, review literature, and analyze electrical engineering problems to design,
conduct experiments, analyze data, and interpret data.
PO3. Design solutions for electrical engineering problems and design system components of
processes that meet the desired needs with appropriate consideration for public health and
safety and cultural, societal, and environmental considerations.
PO4. Use research-based knowledge and research methods including design of experiments,
analysis and interpretation of data, and synthesis of the information to provide valid
conclusions in electrical engineering.
PO5. Create, select, and apply appropriate techniques, resources, and modern engineering and IT
tools including prediction and modeling to electrical engineering activities with an
understanding of the limitations.
PO6. Apply reasoning informed by contextual knowledge to assess societal, health, safety, legal,
and cultural issues and the consequent responsibilities relevant to professional engineering
practice.
PO7. Understand the impact of electrical engineering solutions in societal and environmental
contexts, and demonstrate the knowledge and need for sustainable development.
PO8. Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
PO9. Function effectively as an individual, and as a member or leader in diverse teams, and in
multidisciplinary settings.
PO10. Communicate effectively on complex engineering activities with the engineering committee
and with society at large, such as being able to comprehend and write effective reports and
design documentation, and make effective presentations in electrical engineering.
PO11. Demonstrate knowledge and understanding of the engineering principles and management
principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12. Recognize the need for, and the preparation and ability to engage in independent research and
lifelong learning in the broadest context of technological changes in electrical engineering.
2
PROGRAM SPECIFIC OUTCOMES (PSOs)

PSO1. To apply state-of-the-art knowledge in analysis design and complex problem solving with
effective implementation in the multidisciplinary area of Electrical Engineering with due
regard to environmental and social concerns.
PSO2. To prepare graduates for continuous self-learning to apply technical knowledge and
pursue research in advanced areas in the field of Electrical Engineering for a successful
professional career to serve society ethically.

PROGRAM EDUCATIONAL OBJECTIVES (PEOs)

PEO1. To produce competent electrical engineering graduates with a strong foundation design,
analytics and problem-solving skills for successful professional careers in industry,
research and public service.
PEO2. To provide a stimulating research environment so as to motivate the students for higher
studies and innovation in the specific and allied domains of electrical engineering.
PEO3. To encourage the graduates to practice the profession following ethical codes, social
responsibility and accountability.
PEO4. To train students to communicate effectively in multidisciplinary environment.
PEO5. To imbibe an attitude in the graduates for life-long learning process.

3
Syllabus
Microprocessors Lab (ELPC553)
L-T-P Internal Marks – 15
0-0-2 External Marks-15
Total-50

List of Experiments
1. To study the architecture of microprocessor 8085 & 8086 and familiarization with their
hardware, commands & operation of microprocessor kit.
2. Write a program using 8085 & verify for addition of two 8-bit numbers (with and
without carry)
3. Write a program using 8085 & verify for:
i) subtraction of two 8-bit numbers.
ii) subtraction of two 16-bit numbers.
4. Write a program using using 8085 for multiplication of two 8-bit numbers by
bit- rotation method.
5. Write a program using using 8085 for division of two 8-bit numbers by repeated
subtraction method
6. Write a program using 8085 for finding square- root of a number & verify.
7. Write a program using 8085 to find out largest number in an array.
8. Write a program using 8085 to find out smallest number in an array
9. Write a program using 8085 to arrange the given numbers in ascending order.
10. Write a program using 8085 to find the sum of 8-bit numbers in series and display the result.
11. Write a program to interface ADC & DAC with 8085 & demonstrate generation of square
wave.
12. Write a program using 8086 for arranging an array of numbers indescending order & verify.
13. Write a program using 8086 for copying 12 bytes of data fromsource to destination & verify.
14. Write a program using 8086 for division of a defineddouble word by another word & verify.
15. Write a program to generate a square wave of 1 khz frequency on out 1 pin of 8253/54.
assume clock frequency is 1Mhz and address for control register = 0BH, counter1 = 09H and
counter 2 = 0AH.

4
VISION OF THE DEPARTMENT

Electrical Engineering Department congregates the challenges of new technological advancements to


provide comprehensively trained, career focused, morally strong accomplished graduates, cutting
edge researchers by experimental learning which contribute to ever changing global society and
serve as competent engineers.

MISSION OF THE DEPARTMENT

To commit excellence in imparting knowledge through incubation and execution of high quality
innovative educational programs.

To develop the Research oriented culture to build national capabilities for excellent power
management.

To inculcate and harvest the moral values and ethical behaviour in the students through exposure of
self -discipline and personal integrity.

To develop a Centre of Research and Education generating knowledge and technologies which lay
ground work in shaping the future in the field of electrical engineering.

5
COURSE OBJECTIVES & OUTCOMES
Course objectives:
1. Enhance analytical skills to assess and study the basic architecture of 8085 and 8086
microprocessor.
2. Gain practical expertise in hardware, commands & operation of microprocessor kit.
3. Develop an in-depth understanding of assembly language programs in 8085 and 8086
to perform a given task.
4. Obtain hands-on experience in interfacing memory and I/O devices to 8085 using
peripheral devices.

Course Outcomes:
CO1. Students will be able to explain the basic architecture of 8085 and 8086
microprocessor.
CO2. Students will be able to demonstrate knowledge in hardware, commands & operation
of microprocessor kit.
CO3. Students will be able to write assembly language programs in 8085 and 8086 to
perform
a given task
CO4. Students will be able to perform interfacing of memory and I/O devices to 8085 using
peripheral devices

Mapping of Course Outcomes (Cos) with POs and PSOs


COs PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2

CO1 3 2 3 3 3 2 3 3 2 2 2 2 3 2
CO2 3 3 2 3 3 3 2 3 2 2 2 2 3 2

CO3 3 3 2 3 2 3 2 3 2 2 2 2 3 2

CO4 3 3 2 2 3 3 3 3 2 2 2 2 3 2

6
General Instructions
1. Be punctual and maintain discipline and silence in the lab.
2. Enter Laboratory with shoes
3. Handle instruments with utmost care and follow the procedure that has been instructed.
4. Strictly follow the written and verbal instructions given by the teacher / Lab Instructor. If
you do not understand the instructions, the handouts and the procedures, ask the
instructor or teacher.
5. Mobile phones should be switched off in the lab. Keep bags in the bag rack.
6. Keep the labs clean at all times, no food and drinks allowed inside the lab.
7. Do not insert connectors forcefully into the sockets.
8. Immediately report dangerous or exceptional conditions to the Lab instructor / teacher:
Equipment that is not working as expected, wires or connectors are broken, the
equipment that smells or “smokes”. If you are not sure what the problem is or what's
going on, switch off the Emergency shutdown.
9. Never use damaged instruments, wires or connectors. Hand over these parts to the Lab
instructor/Teacher.
10. Be sure of location of fire extinguishers and first aid kits in the laboratory.
11. After verification of program output, turn off power supply to the trainer kit. Do not take
any item from the lab without permission.
12. Observation book and lab record should be carried to each lab. Programs of current lab
session are to be written in Observation book and of previous lab session should be
written in Lab record book. Both the books should be corrected by the faculty in each lab.
13. Handle the electronic devices as indicated by the handout, the specifications in the data
sheet or other documentation.
14. Shut down the power supply after the experiment.

7
Microprocessors Lab
ELPC-553

Index
Exp. No Experiment/Program Page
No.
1. To study the architecture of microprocessor 8085 & 8086 and familiarization 9-11
with their hardware, commands & operation of microprocessor kit.
2. Write a program using 8085 & verify for addition of two 8-bit numbers (with 12-14
and without carry)
3. Write a program using 8085 & verify for: 15-17
a) subtraction of two 8-bit numbers
b) subtraction of two 16-bit numbers
4. Write a program using using 8085 for multiplication of two 8-bit numbers by18-19
bit-rotation method.
5. Write a program using using 8085 for division of two 8-bit numbers by 20-21
repeated subtraction method
6. Write a program using 8085 for finding square- root of a number & verify. 22-23
7. Write a program using 8085 to find out largest number in an array. 24-25
8. Write a program using 8085 to find out smallest number in an array 26-27
9. Write a program using 8085 to arrange the given numbers in ascending order. 28-29
10. Write a program using 8085 to find the sum of 8-bit numbers in series and 30-31
display the result.
11. Write a program to interface ADC & DAC with 8085 & demonstrate 32-33
generation of square wave.
12. Write a program using 8086 for arranging an array of numbers indescending 34-36
order & verify.
13. Write a program using 8086 for copying 12 bytes of data from source to 37-38
destination & verify.
14. Write a program using 8086 for division of a defineddouble word by 39-40
another word & verify.
15. Write a program to generate a square wave of 1 khz frequency on out 1 pin 41
of 8253/54. assume clock frequency is 1Mhz and address for control
register = 0BH, counter1 = 09H and counter 2 = 0AH.

8
EXPERIMENT NO.1
Aim: Study the architecture of microprocessor 8085 & 8086 and familiarization with their
hardware, commands & operation of microprocessor kit.

Apparatus used: 8085 microprocessor kit.


Theory:
Intel 8085 is an 8-bit microprocessor. It is 40-pin IC package fabricated on a single LSI chip.
It uses asingle +5 V supply. Its clock speed is about 3 Mhz. It consists of three main
sections:

1. ALU (Arithmetic and logic unit):


The ALU performs the arithmetic and logical operation, addition, subtraction, logical AND,
OR, EX-OR, Complement, Increment, Decrement, shift, clear.
2. Timing and Control Unit:-
It generates timing and control signals, which are necessary for the execution of instruction.

3. Registers: -
These are used for temporary storage of data and instruction. INTEL 8085 has following registers:
a) One 8 bit accumulator
b) Six 8 bit registers (B, C, D, E, H, L)
c) One 16 bit stack pointer, SP
d) One 16 bit program counter, PC
e) Instruction register
f) Status register
a. Temporary registers

PC contains the address of next [Link] holds the instruction until it is decoded. SP holds the
address of the stack top.
Accumulator is used during execution of program for temporary storage of data.

4. Status flags are as follows: -


a) Carry (CS)
b) Zero (Z)
c) Sign (S)
d) Parity (P)
e) Auxiliary Carry (AC)

5. Program Status Word (PSW)


This 8-bit program status word includes status flags and three undefined bits.

6. Data and Address bus


Data bus is 8- bit wide and 8 bits of data can be transmitted in parallel. It has 16-bit address bus
as the memory addresses are of 16 bits.
9
The pin description of Intel 8085 is shown below:

10
Fig 1. Pin Diagram of Intel 8085

ET-8085 has 28 keys and six-seven segment displays to communicate with the outside world. As
ET-8085 is switched on, a message – EL 85 is displayed on the display and all keys are in
command mode. The key board is as shown below:

Fig 2. Keyboard

11
The keyboard description is given below.

RESET Reset the system


VCT Hardware interrupt via keyboard, RST 7.5.
INT
SHIFT Provides a second level command to all keys.
GO To execute the program.
SI To execute the program in single step mode.
REG Examine Register; allows you to examine and modify the contents of different
registers.
EMEM Examine memory; allows user to examine any memory Location and modify any
RAM location.
PRE Previous is used as an intermediate terminator in case of Examine Memory. It
decrements the PC contents and writes the contents of data field to the address
displayed in the address location.
NEXT Increments is used as a intermediate terminator in case of Examine Memory,
Examine Register etc. It increments the PC Contents and writes the data field at the
location
displayed in address field.
“.” Terminator is used to terminate the command and write the data in data field at the
location displayed in address field.
DEL Delete the part of program or data, with relocation, by one or more bytes.
INS Inserts the part of the program or data with relocation, by One or more bytes.
BLOCK Allows user to move a block of memory to any RAM area.
MOVE
FILL Allows user to fill RAM area with a constant.
REL Relocate a program written for some memory area and to Be transferred to other
memory area.
INSD Insert one or more data bytes in the user’s program/data area.
DELD Deletes one or more data bytes from the user’s program / data area.
STRG Finds out the string of data lying at a particular address /addresses.
MEMC Memory compare: Compares two blocks of memory for equality.
0-F Hexadecimal Keys.

All commands are followed by a set of numeric parameters separated by PREV, NEXT & ‘ . ‘
(Execute) to work as delimiters.

A ‘-‘on the MSD of address display indicates the system is waiting for a command. If, instead of
a valid command, the user gives a data, the system display ’-Err’. A dot on the LSD of address
field indicates that the system expects an address. Whenever the data of any memory location is
changed, a dot is displayed on the LSD of DATA Field.

The ET-8085 accepts all data and address in hexadecimal form.

12
EXPERIMENT NO. 2(A)
Aim: Write a program using 8085 & verify for addition of two 8-bit numbers (without carry)

Apparatus : 8085 microprocessor kit, 5V power supply.

Theory (Program)
Memory Machine code Mnemonics Operands Commands
address
2000 21,01,25 LXI H,2501 Get address of 1st
no. in HL pair
2003 7E MOV A,M Move Ist no. in
accumulator
2004 23 INX H HL points the
address 2502H
2005 86 ADD M Add the 2nd no.
2006 23 INX H HL points 2503H
2007 77 MOV M,A Store result in
2503H.
2008 CF RST 1 Terminate the
program

Flow Chart:

Fig 3. Flowchart for addition of two 8-bit numbers(without carry)

Input Data Output


2501 13H 2503 25H
2502 12H

Precautions:
Make sure that all the machine codes should be as per specified in the program.

13
EXPERIMENT NO. 2(B)
Aim: Write a program using 8085 & verify for addition of two 8-bit numbers (with carry)

Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory (Program)

Memory Label Machine Mnemonics Operands Commands


address code
2000 2A,01,26 LHLD 2601H Get 1st no. in HL pair from
memory (2601)
2003 EB XCHG Exchange cont. of DE and HL
2004 2A,03,26 LHLD 2603H Get 2st no. in HL pair from
location 2603
2007 0E,00 MVI C,00H Clear reg. C.
2009 19 DAD D Get HL+DE & store result in
HL
200A D2,12,20 JNC 2012(loop) If no carry move to loop/if carry
then move to next step.
200D 0C INR C Increment reg C
200E 79 MOV A,C Move carry from reg. C to reg.
A
2011 32,02,25 STA 2502 Store carry at 2502H
2012 Loop 22,00,25 SHLD 2500 Store result in 2500H.
2015 CF RST1 Terminate the program

14
Flow Chart:

Fig 4. Flowchart for addition of two 8-bit numbers(with carry)

Input Data
2601:13H
2602:31H
2603:12H
2604:10H

Output Data
2500: 25H
2501: 41H
2502: 00H
Precautions:-
Make sure that all the machine codes should be as per specified in the program.
15
EXPERIMENT NO. 3(A)
Aim: Write a program using 8085 & verify for subtraction of two 8-bit numbers. (display of
borrow).
Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory(program) :
Memory Opcode Mnemonics Operands Comments
address
2000 21,01,25 LXI H, 2501 Get address of 1st no. in HL pair
2003 7E MOV A, M Move 1st no. in accumulator
2004 23 INX H HL points 2502H.
2005 96 SUB M Subtract 2nd no. from 1st no.
2006 23 INX H HL points 2503 H.
2007 77 MOV M, A Move contents of acc. to memory
2008 76 HLT Terminate the program

Flowchart:-

Fig 5. Flowchart for subtraction of two 8-bit numbers

Input data
2501: 20H
2502: 10H
Output data
:
2503: 10H
Precautions :
Make sure that all the machine codes should be as per specified in the program.
16
EXPERIMENT NO. 3(B)
Aim: Write a program using 8085 & verify for subtraction of two 16-bit numbers (display
of borrow)
Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory (Program) :

Memory Machine Mnemonics Operands Comments


Address Code
2000 2A, 01,25 LHLD 2501 H Get 1st 16 bit no. in HL pair
2003 EB XCHG Exchange HL pair with DE.
2004 2A, 03,25 LHLD 2503 H Get 2nd 16 bit no. in HL pair
2007 7B MOV A, E Get lower byte of 1st no.
2008 95 SUB L Subtract lower byte of 2nd no.
2009 6F MOV L, A Store the result in reg. L
200A 7A MOV A, D Get higher byte of 1st no.

200B 96 SBB H Subtract higher byte of 2nd no.


with borrow
200C 67 MOV H,A Move from acc. To H
200D 22,05,25 SHLD 2505H Store 16-bit result at 2505 & 2506
2010 76 HLT Terminate the program
Flowchart:

Fig 6. Flowchart for subtraction of two 16-bit numbers

17
Input data
2501: 30H
2502: 40H
2503: 10H
2504: 20H

Output Data

2505: 20H
2506: 20H

Precautions:-
Make sure that all the machine codes should be as per specified in the program.

18
EXPERIMENT NO. 4
Aim: Write a program using 8085 for multiplication of two 8-bit numbersby bit rotation
method & verify.

Apparatus : 8085 microprocessor kit,5 v power supply, keyboard.

Theory(program)

Memory Label Machine Mnemonics Operands Comments


Address Code
2000 2A,01,25 LHLD 2501 H Get Multiplicand
in H-L pair.
2003 EB XCHG Exchange HL pair
with DE pair
2004 3A,03,25 LDA 2503 H Get 2nd no. in acc.
2007 21,00,00 LXI H,0000 Initial product
in HL=00
200A 0E,08 MVI C,08H Count=08 in reg .C
200C Loop 29 DAD H Shift partial product
left by 1 bit
200D 17 RAL Rotate multiplication
by 1 bit. Is multiplier =
1?
200E D2,12,20 JNC Ahead(2012) No, go to ahead
2011 19 DAD D Product=Product +
Multiplicand
2012 Ahead 0D DCR C Decrement Count
2013 C2,0C,20 JNZ Loop(200C)
2016 22,04,25 SHLD 2504 Store result
2019 CF RST 1 Terminate

19
Flowchart :-

Fig 7. Flowchart for multiplication of two 8-bit numbers

Input Data

2501 : 43

2502 : 07

Output Data

2503 : 05

2504 : 01

20
EXPERIMENT NO. 5
Aim: Write a program using 8085 for division of two 8-bit numbers byrepeated subtraction
method & test for typical data.

Apparatus : 8085 microprocessor kit, 5V power supply, Key board.

Theory (Program) :

Memory Label Machine Mnemonics Operands Comments


Address Code
2000 3A,01,25 LDA Divisor(2501)
2003 47 MOV B,A Take divisor in reg,B
2004 3A,02,25 LDA Dividend (2502) Take dividend in reg,A
2007 0E,00 MVI C,00 Quotient=00
2009 B8 CMP B
200A DA,13,20 JC Loop(2013)
200D loop1 90 SUB B Dividend-divisor=>A
200E 0C INR C C=C+1
200F B8 CMP B Is dividend < divisor
2010 D2,0D,20 JNC Loop1(200D) If not, go back
2013 loop 32,03,25 STA Remainder(2503) Store Remainder
2016 79 MOV A,C
2017 32,04,25 STA Quotient(2504) Store Quotient
201A CF RST 1 Terminate.

Flow Chart:

Fig 8. Flowchart for division of two 8-bit numbers

21
Input Data
2501- Divisor
2502- Dividend

Output Data
2503- Remainder
2504- Quotient

Precautions:
Make sure that all the machine codes should be as per specified in the program.

22
EXPERIMENT No.6
Aim: Write a program using 8085 for finding square-root of a number & verify.
Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory(program):

Memory Label Machine Mnemonics Operands Comments


Address Code
2000 0E,01 MVI C,01H Place 01 in Reg.C
2002 06,01 MVI B,01H Place odd number 1 in Reg.B
2004 3E,36 MVI A,36 Load accumulator with the given
number
2006 Loop 90 SUB B Subtract odd number from the
accumulator
2007 CA,10,20 JZ Ahead(2010) If accumulator contents are zero,
go to Ahead
200A 0C INR C Increment reg. C
200B 04 INR B Increment odd number
200C 04 INR B Increment odd number
200D C3,06,20 JMP Loop(2006) Repeat subtraction
2010 Ahead 79 MOV A,C Move the contents of C to A
2011 32,50,20 STA 2050H Store the result in the memory
location 2050H.
2014 76 HLT Terminate the program

Flow Chart:

23
Fig 8. Flowchart for finding square-root of a number

Input Data :
2500-10H
2501- 00H

Output Data :
2550- 04H

Precautions:
Make sure that all the machine codes should be as per specified in the program.

24
EXPERIMENT NO. 7

Aim : Write a program using 8085 to find out largest number in an array.

Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory(program)

Memory Label Instruction Comments


Address

2000H LXI H,2500H Load starting address of list

2003H MOV C,M Store maximum

2004H INX H Store minimum

2005H MOV A,M Counter for 10 elements

2007H DCR C Retrieve list element in Accumulator

2008H ZERO INX H Compare element with maximum number

2009H MOV A,M Jump to MIN if not maximum

200CH DCR C Transfer contents of A to B as A > B

200DH INX H Compare element with minimum number

200EH CMP M Jump to SKIP if not minimum

2011H JNC CARRY Transfer contents of A to C if A < minimum

2012H MOV A,M Increment memory

2013H CARRY DCR C Decrement counter

2014H JNZ ZERO Jump to LOOP if D > 0

2017H STA 2504 Load address to store maximum

201AH HLT Move maximum to 2060H

25
Fig 9. Flow Chart for finding largest number in an array.

Result: The result is stored at 2504 H.

26
EXPERIMENT NO. 8

Aim : Write a program using 8085 to find out the smallest number in an array.

Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory(program)

Memory Label Instruction Comments


Address

2000H LXI H, 2500 Load starting address of list

2003H MOV C, M Store maximum

2004H INX H Store minimum

2005H MOV A, M Counter for 10 elements

2007H DCR C Retrieve list element in Accumulator

2008H ZERO INX H Compare element with maximum number

2009H CMP M Jump to MIN if not maximum

200CH JC CARRY Transfer contents of A to B as A > B

200DH MOV A, M Compare element with minimum number

200EH CARRY DCR C Jump to SKIP if not minimum

2011H JNZ ZERO Transfer contents of A to C if A < minimum

2012H STA 2504 Increment memory

2013H HLT Decrement counter

27
Fig 10. Flow Chart for finding smallest number in an array.

Result: The result is stored at 2504 H.

28
EXPERIMENT NO. 9

Aim : Write a program using 8085 to arrange the given numbers in ascending order.

Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory(program)

Address Label Instruction Comment

2000 LXI H,2050H Set pointer for array

2003 MOV C, M Load the count value

2004 DCR C Decrement counter

2005 REPEAT MOV D, C

2006 LXI H, 2051H Set the memory pointer for data

2009 LOOP MOV A, M Move the number into accumulator

200A INX H Increment memory pointer

200B CMP M Compare memory and accumulator

200C JC SKIP jump to skip if carry generated

200F MOV B, M copy content of memory location to B – Register

2010 MOV M, A copy content of Accumulator to memory location

2011 DCX H Decrement content of HL pair of registers

2012 MOV M, B copy content of B – Register to memory location

2013 INX H Increment content of HL pair of registers

2014 SKIP DCR D Decrement content of Register – D

2015 JNZ LOOP jump to loop if not equal to zero

2018 DCR C decrement counter

2019 JNZ REPEAT jump to repeat if not equal to zero

201C HLT Terminate the program

29
Flow Chart :

Fig 11. Flow Chart for arranging a series of numbers in ascending order.

30
EXPERIMENT NO. 10

Aim : Write a program using 8085 to find the sum of given 8-bit nos. in a series and display
the result.

Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Theory(program)

Address Label Instruction Comment

2000 LXI H,2500 H Load H-L pair with address 2500H

2003 MOV C, M Move the content of memory in register C

2004 MVI A, 00H Initialize accumulator with value 00H

2006 MOV B, A Move the content of accumulator in register B

2007 ZERO INX H Increment H-L pair

2008 ADD M Add the content of memory with accumulator

2009 JNC CARRY Jump if no carry is generated

200C INR B Increment the content of register B

200D CARRY DCR C Decrement the counter

200E JNZ ZERO Jump if no zero is generated

2011 STA 2450H Store the result in memory

2014 MOV A, B Move the content of register B in accumulator

2015 STA 2451H Store the carry in accumulator

2018 HLT Terminate the program

31
Flow Chart :

Fig 12. Flowchart to find sum of a series of numbers

32
EXPERIMENT NO. 11

Aim : Write a program to interface ADC & DAC with 8085 & demonstrategeneration of
square wave.

Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.

Description: A D/A converter chip DAC 0800 has been provided on the board of M85-07 to
enable the user to have analog output. This can be used for generating various waveforms or
for any closed loop applications. The chip has been used in I/O mapped mode and has an
address of (A0-A7), i.e. any of A0 to A7 can be used as an address. This chip has been
designed to give an output of 0 to 8 Volts. The output of DAC 0800 is coming at Pin No.13
of connector CN11.

Theory(Program)

Memory Label Machine Code Mnemonics Operands Comments


Address
2000 CD 4D OF CALL LECHO CLEAR LCD DISPLAY
2003 06 0E MVI B,0EH
2005 21 1F 20 LXI H,WAVE
2008 CD 47 17 CALL PRINTF DISPLAY MESGAE
200B DAC 3E 00 MVI A,00H
200D D3 38 OUT 38H
200F CD 31 0F CALL DELAY1
2012 06 14 MVI B,14H
2014 CD 47 17 CALL PRINTF DISPLAY MESSAGE
2017 3E FF MVI A,FFH
2019 D3 A0 OUT 0A0H
201B CD 31 0F CALL DELAY1
201E C3 0B 20 JMP DAC LOOP
2021 52 41 4D 50 20 WAVE OUTPUT AT
2026 50 49 4E 20 4E PIN NO. 2 CONN. C9

33
Fig 13. Flowchart for interfacing ADC & DAC with 8085

RESULT: Waveform observed on the CRO from Pin No. 2 of connector 9.

PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.

34
EXPERIMENT NO.12

Aim : Write a program using 8086 for arranging an array of numbers indescending order
& verify.

Apparatus : 8086 microprocessor kit, 5V power supply, Keyboard.

Theory(Program)

Memory Label Machine Mnemonics Operands Comments


Address Code
0200 BE,00,03 MOV SI,0300 Initialize SI Reg. with Memory
Location. 0300.
0203 8B,1C MOV BX,[SI] BX has no. of bytes
0205 4B DEC BX Decrement the no. of bytes by one
0206 (3) 8B 0C MOV CX ,[SI] Move no. of bytes in CX
0208 49 DEC CX Decrement the no. of bytes by one
0209 BE,02,03 MOV SI,0303 Initialize SI reg. with the starting
address of string
020C (2) 8A,04 MOV AL,[SI] Move first data byte of string into
AL
020E 46 INC SI Point at the next bytes of the string
020F 3A,04 CMP AL,[SI] Com. the two bytes of string.
0211 73,06 JAE (1) If two bytes are equal or 1stbyte is
above that the second byte branch
to (1)
0213 86,04 XCHG AL,[SI] Else
0215 4E DEC SI Second byte is less than first byte
and swap the two bytes.
0216 88,04 MOV [SI],AL
0218 46 INC SI Point at next location of string
0219 (1) E2,F1 LOOP (2) Loop if CX is not zero
021B 4B DEC BX
021C BE,00,03 MOV SI,0300
021F 75,E5 JNZ (3)
0221 F4 HLT Halt.

35
Fig 14. Flow chart for arranging an array of numbers in descending order
35
INPUT DATA
0300 : 05
0301 : 00
0302 : 20
0303 : 25
0304 : 28
0305 : 15
0306 : 07
OUTPUT DATA
0302 : 28
0303 : 25
0304 : 20
0305 : 15
0306 : 07

PRECAUTIONS:-

Make sure that all the machine codes should be as per specified in the program.

36
EXPERIMENT NO. 13

Aim : Write a program using 8086 for copying 12 bytes of data from source to destination &
verify.

Apparatus : 8086 microprocessor kit, 5V power supply, Keyboard.

Theory(Program)

Memory Label Machine Mnemonics Operands Comments


Address Code
0101 FC CLD Clear direction flag DF
0102 BE,00,03 MOV SI,0300 Source address in SI
0105 BF,02,02 MOV DI,0202 Destination address in DI
0108 8B,0C MOV CX,[SI] Count in CX
010A 46 INC SI Increment SI
010B 46 INC SI Increment SI
010C BACK A4 MOV SB Move byte
010D E2,FD LOOP BACK Jump to BACK until CX
becomes zero
010F CC INT Interrupt program

Flow Chart:-

Fig 15. Flow Chart for copying data bytes from source to destination.

37
INPUT DATA OUTPUT DATA

0300 : 0B
0301 : 00
0302 : 03 0202 : 03
0303 : 04 0203 : 04
0304 : 05 0204 : 05
0305 : 06 0205 : 06
0306 : 15 0206 : 15
0307 : 07 0207 : 07

0308 : 12 0208 : 12

0309 : 08 0209 : 08

030A : 09 020A :09

030B : 0A 020B : 0A

030C : 0B 020C : 0B

030D : 0E 020D : 0E

Precautions:-
Make sure that all the machine codes should be as per specified in the program.

38
EXPERIMENT NO.14

Aim : Write a program using 8086 for division of a defined double wordby another word
& verify.

Apparatus : 8086 microprocessor kit, 5V power supply, Keyboard.

Theory(Program)

Memory Machine Mnemonics Operands Comments


Address Code
100 B8,78,56 MOV AX,5678H Move 5678 to AX
103 BA,34,12 MOV DX,1234H Move 1234 to DX
106 B9,25,25 MOV CX,2525 Move 2525 to CX
109 F7,F1 DIV CX Divide AX&DX by CX
10b CD,A5 INT A5

Flowchart:-

Fig 16. Flowchart for division of a defined double wordby another word

Input data
AX : 5678H
DX : 1234H
CX : 2525H

39
Output data
AX : 7D77(Quotient)
DX :
Precautions:- 0145(Remainder)

Make sure that all the machine codes should be as per specified in the program.

40
EXPERIMENT NO. 15

Aim: Write a program to generate a square wave of 1KHz frequency on OUT 1 pin of 8253/54.
Assume CLK1frequency is 1MHz and address for control register =0BH, counter 1 = 09H and
counter 2 = 0AH.

Control Word:

D7 D6 D5 D4 D3 D2 D1 D0
SC1 SC2 RW1 RW0 M2 M1 M0 BCD
0 1 1 1 0 1 1 1

Instructions Comment
MOV AL,77H Comment
OUT 0BH,AL Loads control word (77H) in; the control register.
MOV AL,00H ; loads lower byte (00) of the count
OUT 09H,AL
MOV AL,10 ; Loads higher byte (10) of the count
OUT 09H,AL
HLT

Result: The result is checked at pin 1.

Precautions:-
Make sure that all the machine codes should be as per specified in the program.

41

You might also like