SlideShare a Scribd company logo
Page | 1
“MICROPROCESSOR LABORATORY MANUAL”
FOR Vth SEMESTER B.E. (ELECTRICAL ENGINEERING)
ACADEMIC YEAR: 2017 – 2018
(FOR PRIVATE CIRCULATION ONLY)
Designed & Prepared By,
Prof. Swapnil V. Kaware
Asst. Professor.
B.E., M.E. (Electronics)
svkaware@yahoo.co.in
www.linkedin.com/in/swapnil-kaware-481ab718/
Page | 2
ABOUT THE MANUAL & PREPARATION OF RECORD
❖ This Lab Manual contains the programs of 8085 and its interfacing mentioned in
the syllabus of microprocessor lab.
❖ Aim/Title of the experiment is also given at the beginning of each experiment.
❖ Once the student is able to write the program as per the algorithm. He/she is
supposed to go through the instruction sets carefully and do the experiment step by step
neatly under the guidance of staff member.
❖ It is also expected that the students prepare the theory relevant to the his/her
experiment referring to prescribed reference books, in advance, and carry out the
experiment after understanding thoroughly the concept and algorithm of the experiment.
❖ The observations should be verified and signed by the staff as soon as the
experiments are completed and prepare & submit the record of the experiment while they
come for the laboratory in the subsequent week.
❖ The record should contain experiment no, date, aim, instruments required, theory,
algorithm, program, flowchart, theory, observation, precaution and Result.
❖ The students are directed to discuss & clarify their doubts with the faculty
members as and when required. They are also directed to follow strictly the guidelines
specified.
Page | 3
Sr. No Name of Experiments Page No
1. To study about introduction of 8085 microprocessor. 4-5
2. Write an ALP to perform the addition of two 8 bit numbers. 6-7
3. Write an ALP to perform the subtraction of two 8 bit numbers. 8-9
4.
Write 8085 assembly language program for addition of two16-bit numbers and
sum is 16 bit. 10-12
5.
Write 8085 assembly language program for decimal addition of two 8-bit
numbers and sum is 8 bit.
13-14
6.
To write an assembly language for multiplying two 8 bit numbers by using 8085
micro processor kit. 15-16
7.
To write an assembly language program for dividing two 8 bit numbers using
microprocessor kit. 17-18
8.
To interface programmable peripheral interface 8255 with 8085 and study its
characteristics in mode0 19-22
To interface 8253 Interface board to 8085 processor and verify the operation of
8253 in two different modes. 23-24
9.
To search the largest data in an array using 8085 microprocessor.
10. 25-27
Page | 4
Experiment No. 1
AIM: To study about introduction of 8085 microprocessor.
Instruments Required: 8085 - Microprocessor software.
Theory:
Introduction:
INTEL 8085 is one of the most popular 8-bit microprocessor capable of addressing 64 KB of
memory and its architecture is simple. The device has 40 pins, requires +5 V power supply and
can operate with 3MHz single phase clock.
ALU (Arithmetic Logic Unit):
The 8085A has a simple 8-bit ALU and it works in coordination with the accumulator,
temporary registers, 5 flags and arithmetic and logic circuits. ALU has the capability of
Page | 5
performing several mathematical and logical operations. The temporary registers are used to
hold the data during an arithmetic and logic operation. The result is stored in the accumulator
and the flags are set or reset according to the result of the operation. The flags are affected by
the arithmetic and logic operation.
Timing and control unit: This unit synchronizes all the microprocessor operation with a clock
and generates the control signals necessary for communication between the microprocessor
and peripherals. The control signals RD (read) and WR (write) indicate the availability of data
on the data bus.
Instruction register and decoder: The instruction register and decoder are part of the ALU.
When an instruction is fetched from memory it is loaded in the instruction register. The
decoder decodes the instruction and establishes the sequence of events to follow.
Register array: The 8085 has six general purpose registers to store 8-bit data during program
execution. These registers are identified as B, C, D, E, H and L. they can be combined as BC, DE
and HL to perform 16-bit operation.
Accumulator: Accumulator is an 8-bit register that is part of the ALU. This register is used to
store 8-bit data and to perform arithmetic and logic operation. The result of an operation is
stored in the accumulator.
Program counter: The program counter is a 16-bit register used to point to the memory
address of the next instruction to be executed.
Stack pointer: It is a 16-bit register which points to the memory location in R/W memory,
called the Stack.
Result: Hence we have studied about 8085 microprocessor.
Page | 6
Experiment No. 2
AIM: Write 8085 assembly language program for addition of two 8-bit numbers and sum is 8
bit.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply.
Theory : Consider the first number 26H is stored in memory location 8000H and the
second number 62H is stored in memory location 8001H. The result after addition of two
numbers is to be stored in the memory location 8002 H. Assume program starts from
memory location 8500H.
Algorithm:
1. Initialize the memory location of first number in HL register pair.
2. Move first number/data into accumulator.
3. Increment the content of HL register pair to initialize the memory location of second
data.
4. Add the second data with accumulator.
5. Store the result in memory location 8003H.
Program:
Memory
Machine
Codes Labels
Mnemoni
c Operands Comments
address
8500 21, 00, 80 LXI H, 8000 H Address of first number in
H-L register pair.
8503 7E MOV A,M Transfer first number in
accumulator.
8504 23 INX H Increment content of H-L
register pair
8505 66 ADD M Add first number and
second number
8506 32, 03, 80 STA 8003H Store sum in 8003 H
8509 76 HLT Halt
Experimental Results:
Input DATA RESUT
Memory
location Data Memory location Data
8000 26H 8003 88H
8001 62H
Page | 7
Conclusion:
The addition of two 8-bit numbers is performed using 8085 microprocessor where sum is 8-bit.
Precautions:
1. Properly connect the 8085 microprocessor kit with power supply terminals.
2. Switch on the power supply after checking connections.
3. Handle the Trainer kit carefully.
Viva-Voice Questions:
1. What is the function of LXI H, 8000 H instruction?
2. How you can store a data in a memory location?
3. How you can read a data from a memory location?
4. What are flags available in 8085 ?
5. What is the function of RESET key of a 8085 microprocessor kit?.
Page | 8
Experiment No. 3
AIM: Write 8085 assembly language program for addition of two 8-bit numbers and sum is 16
bit.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply.
Theory : The first number F2H is stored in memory location 8501H and the second
number 2FH is stored in memory location 8502H. The result after addition will be stored
in the memory location 8503 H and 8504H. Consider program is written from memory
location 8000H.
Algorithm:
1. Initialize the memory location of 1st data in HL register pair.
2. Store first data in the memory location.
3. Increment the content of HL register pair for entering next data in the next memory
location.
4. Store second data in the memory location.
5. Move second number in accumulator.
6. Decrease the content of HL register pair.
7. Add the content of memory (first data) with accumulator.
8. Store the results in memory location 8503H and 8504H.
Program:
Memory
Machine
Codes Labels Mnemonic Operand Comments
address
8000 21, 01, 85 LXI H, 8501 H Address of 1st number in
H-L register pair.
8003 36, F2 MVI M, F2H Store 1st number in
memory location
represented by H-L
register pair.
8005 23 INX H Increment content of H-L
register pair
8006 36, 2F MVI M, 2FH Store 2nd number in
memory location
represented by H-L
register pair
8008 7E MOV A, M 2nd number in accumulator
8009 0E, 00 MVI C,00H Initialise C register with
00H to store MSBs of sum
800B 2B DCX H Address of 1st number
Page | 9
2501 in H-L pair
800C 66 ADD M Addition of 1st number
and 2nd number
800D D2, 11, 85 JNC LEVEL_1 If carry does not
generated , jump to
LEVEL_1 ?
8010 0C INR C When carry is generated,
increment C register.
8011 32, 03, 85 LEVEL_1 STA 8503H Store LSBs of sum in
memory location 8503H
8014 79 MOV A,C Move MSBs of sum in
accumulator
8015 32, 04, 85 STA 2504 H Store MSBs of sum in
memory location 8503H.
8018 76 HLT Halt
Experimental Results:
Input DATA RESULT
Memory
location Data Memory location Data
8501 F2H 8503 82H LSBs of sum
8502 2FH 8504 01H MSBs of sum
Conclusion:
The addition of two 8-bit numbers is performed using 8085 microprocessor where sum is 16-
bit.
Precautions:
1. Properly connect the 8085 microprocessor kit with power supply terminals.
2. Switch on the power supply after checking connections
3. Handle the Trainer kit carefully.
Viva-Voice Questions:
1. What is the function of JNC instruction?
2. What is the difference between conditional and unconditional jump instruction?
3. What is the function of STA 2500$ instruction?
4. What is multi byte?
Page | 10
Experiment No. 4
AIM: Write 8085 assembly language program for addition of two16-bit numbers and sum is 16
bit.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply.
Theory : The first 16-bit number is stored in 8501 and 8502 memory locations. The second
16-bit number is stored in 8503 and 8504 memory locations. After addition result will be
stored from 8505 and 8506 memory locations. Assume program starts from memory
location 8000H.
Algorithm:
1. Store first 16-bit number in H-L pair.
2. Exchange the contents of D-E pair and H-L pair to store first number in D-E registers
pair.
3. Store second 16-bit number in HL register pair.
4. Addition of 1st and 2nd number
5. Store result in 8505H and 8506H locations.
Program:
Memory Machine Codes Labels Mnemonic Operand Comments
address
8000 2A, 01, 85 LHLD 8501 H Load the content of 8501H
location in L register and H
register is loaded with the
content of 8502H location.
8000 EB XCHG` The contents of HL register
pair are exchanged with
D-E register pair. So that
first data is stored in DE
register pair.
8000 2A, 03, 85 LHLD 8503 H
Load second 16-bit
number
(data-2) in H-L pair.
8000 19 DAD D The contents of D-E pair
are added with the
contents
of H-L pair and result is
stored in H-L pair.
8000 22, 05, 85 SHLD 8505 H Store LSBs of sum in 8505
and MSBs of sum 8506 H.
8000 76 HLT Halt
Page | 11
Experimental Results:
Input DATA RESULT
Memory
location Data Memory Data
location
8501 05H LSBs of data-1 8505 07H LSBs of sum
8502 01H MSBs of data-1 8506 04H MSBs of sum
8503 02H LSBs of data-2
8504 03H MSBs of data-2
Conclusion:
The addition of two 16-bit numbers is performed using 8085 microprocessor where sum is 16-
bit.
Precautions:
1. Properly connect the 8085 microprocessor kit with power supply terminals.
2. Switch on the power supply after checking connections
3. Handle the Trainer kit carefully.
Viva-Voice Questions:
1. What is the function of XCHG instruction?
2. How you can load 16-bit data in 8500H and 8501H memory locations?
3. What is the difference between LSLD and SHLD instructions?
4. What is the function of DAD D instruction?
5. What is difference between byte and word?
Page | 12
Experiment No. 5
AIM: Write 8085 assembly language program for decimal addition of two 8-bit numbers and
sum is 8 bit.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply
Theory : Two decimal numbers are stored in 8000H and 8001H. The result is to be stored
in 8002H location. Consider program starts from memory location 8100H
Algorithm:
1. Initialize the memory location of first number in HL register pair.
2. Load the first number in accumulator.
3. Increment the content of HL register pair to initialize the memory location of second
data.
4. Addition of the content of second memory location with first data.
5. Decimal adjustment of result..
6. Store the result in memory location 8002H.
Program:
Memory
Machine
Codes Labels Mnemonic Operand Comments
address
8100 21, 50, 80 LXI H,8050 Load the address of first
number in H-L register
pair
8103 7E MOV A,M Store the first number in
accumulator
8104 23 INX H
Increment H-L register
pair to
locate second number
8105 86 ADD M Addition of 1st and 2nd
number
8106 27 DAA Decimal Adjust
8107 32, 02, 80 STA 8002
Store result in 8002H
location
810A 76 HLT Halt
Experimental Results:
Input DATA RESULT
Memory
location Data Memory location Data
8000 22H 8002 89H
8001 67H
Page | 13
Conclusion:
The decimal addition of two 8-bit numbers is performed using 8085 microprocessor where
sum is 8-bit.
Precautions:
1. Properly connect the 8085 microprocessor kit with power supply terminals.
2. Switch on the power supply after checking connections.
3. Handle the Trainer kit carefully.
Viva-Voice Questions:
1. What is the function of DAA instruction?
Page | 14
Experiment No. 6
AIM: To write an assembly language for multiplying two 8 bit numbers by using 8085 micro
processor kit.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply.
Algorithm:
Step1 : Start the microprocessor
Step2 : Get the 1st 8 bit numbers
Step3 : Move the 1st 8it number to register ‘B’
Step4 : Get the 2nd 8 bit number
Step5 : Move the 2nd 8 bit number to register ‘C’
Step6 : Initialize the accumulator as zero
Step7 : Initialize the carry as zero
Step8 : Add both register ‘B’ value as accumulator
Step9 : Jump on if no carry
Step10 : Increment carry by 1 if there is
Step11 : Decrement the 2nd value and repeat from step 8, till the 2nd
value becomes zero.
Step12 : Store the multiplied value in accumulator
Step13 : Move the carry value to accumulator
Step14 : Store the carry value in accumulator
Address Label Mnemonics Hex Code Comments
4100 LDA 4500 3A, 00, 45 Load the first 8 bit number
4103 MOV B,A 47 Move the 1st 8 bit data to
register ‘B’
4104 LDA 4501 3A, 01, 45 Load the 2nd 16 it number
4107 MOV C,A 4F Move the 2nd 8 bit data to
register ‘C’
4108 MVI A, 00 3E, 00 Intialise the accumulator as
zero
410A MVI D, 00 16, 00 Intialise the carry as zero
410C ADD B 80 Add the contents of ‘B’ and
accumulator
410D INC D2 11, 41 Jump if no carry
4110 INR D 14 Increment carry if there is
4111 DCR C OD Decrement the value ‘C’
4112 JNZ C2 0C, 41 Jump if number zero
4115 STA 4502 32 02, 45 Store the result in
accumulator
4118 MOV A,D 7A Move the carry into
accumulator
4119 STA 4503 32,03,45 Store the result in
accumulator
411C HLT 76 Stop the program execution
Program:
Page | 15
Input
Input Address Value
4500 04
4501 02
Output
Output Address Value
4502 08
4503 00
Result: The assembly language program for multiplication of two 8 bit numbers was
executed using 8085 micro processing kit.
Page | 16
Experiment No. 7
Aim: To write an assembly language program for dividing two 8 bit numbers using
microprocessor kit.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply.
Algorithm:
Step1 : Start the microprocessor
Step2 : Intialise the Quotient as zero
Step3 : Load the 1st 8 bit data
Step4 : Copy the contents of accumulator into register ‘B’
Step5 : Load the 2nd 8 bit data
Step6 : Compare both the values
Step7 : Jump if divisor is greater than dividend
Step8 : Subtract the dividend value by divisor value
Step9 : Increment Quotient
Step10 : Jump to step 7, till the dividend becomes zero
Step11 : Store the result (Quotient) value in accumulator
Step12 : Move the remainder value to accumulator
Step13 : Store the result in accumulator
Step14 : Stop the program execution
Address Label Mnemonics Hex Code Comments
4100 MVI C, 00 0E, 00 Intialise Quotient as zero
4102 LDA, 4500 3A 00, 45 Get the 1st data
4105 MOV B,A 47 Copy the 1st data into
register ‘B’
4106 LDA, 4501 3A 01, 45 Get the 2nd data
4109 CMP B B8 Compare the 2 values
410A JC (LDP) DA 12,41 Jump if dividend lesser than
divisor
410D Loop 2 SUB B 90 Subtract the 1st value by 2nd
value
410E INR C 0C Increment Quotient (410D)
410F JMP (LDP, 41) C3, 0D, 41 Jump to Loop 1 till the value
of dividend becomes zero
4112 Loop 1 STA 4502 32 02,45 Store the value in
accumulator
4115 MOV A,C 79 Move the value of remainder
to accumulator
4116 STA 4503 32 03,45 Store the remainder value in
accumulator
4119 HLT 76 Stop the program execution
Program:
Page | 17
Input
Input
Address Value
4500 09
4501 02
Output
Output
Address Value
4502
04
(quotient)
4503
01
(reminder)
Result: The assembly language program for division of two 8 bit numbers was executed using
8085 micro processing kit.
Page | 18
Experiment No. 8
AIM: To interface programmable peripheral interface 8255 with 8085 and study its characteristics in
mode0, mode1 and BSR mode.
Instruments Required: 8085 kit, 8255Interface board, DC regulated power supply.
Theory:
Control Word:
MODE 0 – SIMPLE I/O MODE:
This mode provides simple I/O operations for each of the three ports and is
suitable for synchronous data transfer. In this mode all the ports can be configured either as input
or output port.
Let us initialize port A as input port and port B as output port
Page | 19
PROGRAM:
ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS
4100 START: MVI A, 90 Initialize port A as
4101 Input and Port B as
output.
4102 OUT C6 Send Mode Control
4103 word
4104 IN C0 Read from Port A
4105
4106 OUT C2 Display the data in
4107 port B
4108 STA 4200 Store the data read
4109 from Port A in 4200
410A
410B HLT Stop the program.
MODE1 STROBED I/O MODE:
In this mode, port A and port B are used as data ports and port C is used as control signals
for strobed I/O data transfer. Let us initialize port A as input port in mode1.
MAIN PROGRAM:
ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS
4100 START: MVI A, B4 Initialize port A as
4101 Input port in mode 1.
4102 OUT C6 Send Mode Control
4103 word
4104 MVI A,09 Set the PC4 bit for
INTE A
4105
4106 OUT C6 Display the data in
port B
4107
EI
4108 MVI A,08 Enable RST5.5
4109
410A SIM
EI
410B HLT Stop the program.
Page | 20
ISR (Interrupt Service Routine):
ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS
4200 START: IN C0 Read from port A
4201
4202 STA 4500 Store in 4500.
4203
4204
4205 HLT Stop the program.
Sub program:
ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS
405E JMP 4200 Go to 4200
405F
4060
BSR MODE (Bit Set Reset mode)
Any lines of port c can be set or reset individually without affecting other lines using this
mode. Let us set PC0 and PC3 bits using this mode.
Page | 21
PROGRAM:
ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS
4100 START: MVI A, 01 Set PC0
4101
4102 OUT C6 Send Mode Control
4103 word
4104 MVI A,07 Set PC3
4105
4106 OUT C6 Send Mode Control
4107 word
4109 HLT Stop the program.
RESULT:
Thus 8255 is interfaced and its characteristics in mode0,mode1 and BSR mode is studied.
Page | 22
Experiment No. 9
AIM: To interface 8253 Interface board to 8085 processor and verify the operation of 8253 in two
different modes.
Instruments Required: 8085 processor kit, 8253 Interface board, DC regulated power supply.
Theory:
Mode 2 – Rate Generator:
It is a simple divide by N counter. The output will be low for one period of the input clock. The
period from one output pulse to the next equals the number of input counts in the count register. If
the count register is reloaded between output pulses the present period will not be affected but the
subsequent period will reflect the new value.
Example:
Using Mode 2, Let us divide the clock present at Channel 1 by 10. Connect the CLK1 to PCLK.
Address Opcodes Label Mnemonic Operand Comments
4100 3E 74 START: MVI A, 74 Channel 1 in mode 2
4102 D3 CE OUT CE Send Mode Control
word
4104 3E 0A MVI A, 0A LSB of count
4106 D3 CA OUT CA Write count to register
4108 3E 00 MVI A, 00 MSB of count
410A D3 CA OUT CA Write count to register
410C 76 HLT
In CRO observe simultaneously the input clock to channel 1 and the output at Out1.
Mode 3 Square wave generator:
It is similar to Mode 2 except that the output will remain high until one half of count and go low for
the other half for even number count. If the count is odd, the output will be high for (count + 1)/2
counts. This mode is used of generating Baud rate for 8251A (USART).
Page | 23
Example:
We utilize Mode 0 to generate a square wave of frequency 150 KHz at channel 0.
Address Opcodes Label Mnemonic Operand Comments
4100 3E 36 START: MVI A, 36 Channel 0 in mode 3
4102 D3 CE OUT CE Send Mode Control
word
4104 3E 0A MVI A, 0A LSB of count
4106 D3 C8 OUT C8 Write count to register
4108 3E 00 MVI A, 00 MSB of count
410A D3 C8 OUT C8 Write count to register
410C 76 HLT
Result: Hence operation of 8253 in two different modes has been studied.
Page | 24
Experiment No. 10
Aim: To search the largest data in an array using 8085 microprocessor.
Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply.
Algorithm:
Sr.No. Details of the step
1 Load the address first element of array in HL reg pair.
2 Move the count of B reg.
3 Increment the pointer.
4 Get the first data in A reg.
5 Decrement the count.
6 Increment the pointer.
7 Compare the counter of memory address by HL pair carry=0, goto step 10 else
to step 9 with that of A move the content of HL to A reg.
8 Decrement the count.
9 If ZF=0, goto step 6 or if ZF=1 goto next step.
10 Goto large data.
11 Terminate the program.
Program:
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
4100 21 00 42 LXIH 4200H Set Pointer for array
4103 46 MOV B,M Set count for no of element in array
4104 23 INX H
4105 7E MOV A,M Set first element of array as large data
4106 05 DCR B Decrement the count
4107 23 LOOP INX H
4108 BE CMP M Compare an element of array with current
largest data
4109 02 00 41 JNC AHEAD If CY=0, goto AHEAD
410C 7E MOV A,M If CY=1, then content of memory is larger
than accumulator. Hence If CY=1, make
Page | 25
Result: Thus the program to find the largest data in an array is constructed and verified successfully.
I
T
/
I
V
‐
S
E
M
M
P
&
M
C
L
A
B
‐
L
M
memory content as current largest by
moving it to A reg
410D 05 AHEAD DCR B
410E C2 07 41 JNZ LOOP Repeat comparison until count is zero
4111 32 00 42 STA 4300H Store the large data in memory
4114 76 HLT Terminate the program
Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 07
4201 62
4202 7D
4203 FC
4300 FC
4204 24
4205 C2
4206 0F
4207 92
Page | 26
QUESTIONS AND ANSWERS:
1. What is assembly language?
The language in which the mnemonics (short -hand form of instructions) are used to write a
program is called assembly language. The manufacturers of microprocessor give the nemonics.
2. What does the instruction LXIH,4200 mean?
The data present in the address location 4200 is loaded into the H register.
3. How many machine cycles constitute one instruction cycle in 8085?
Each instruction of the 8085 processor consists of one to five machine cycles.
4. What is the drawback in machine language and assembly language programs?
The machine language and assembly language programs are machine dependent. The programs
developed using these languages for a particular machine cannot be directly run on another
machine .
“Microprocessor laboratory Manual”
Designed & Prepared By,
Prof. Swapnil V. Kaware
Asst. Professor.
B.E., M.E. (Electronics)
svkaware@yahoo.co.in
www.linkedin.com/in/swapnil-kaware-481ab718/

More Related Content

PPTX
Synchronous Counter
PPT
Adc interfacing
PDF
Question paper with solution the 8051 microcontroller based embedded systems...
PDF
8051 microcontroller
PDF
Keypad Interfacing with 8051 Microcontroller
PPTX
8051 Microcontroller PPT's By Er. Swapnil Kaware
PPT
8251 universal synchronous asynchronous receiver transmitter
PPTX
8086 Microprocessor Pipeline Architecture.pptx
Synchronous Counter
Adc interfacing
Question paper with solution the 8051 microcontroller based embedded systems...
8051 microcontroller
Keypad Interfacing with 8051 Microcontroller
8051 Microcontroller PPT's By Er. Swapnil Kaware
8251 universal synchronous asynchronous receiver transmitter
8086 Microprocessor Pipeline Architecture.pptx

What's hot (20)

PPTX
Addressing modes 8085
PPTX
Microcontroller 8096
PPTX
Interfacing memory with 8086 microprocessor
PDF
Module 1 8086
PPT
8086 pin details
PPTX
Stacks & subroutines 1
PDF
8051 interfacing
PPTX
Pic16cxx instruction set
DOCX
Microprocessor Interfacing and 8155 Features
PDF
Microprocessor lab
PPTX
8051 Microcontroller ppt
PPT
Assembly Language Programming Of 8085
PPTX
Lcd interfaing using 8051 and assambly language programming
PDF
Microprocessor lab manual
PPTX
8251 USART
PPTX
Interfacing Stepper motor with 8051
PPT
Mechanical translational rotational systems and electrical analogous circuit...
PPTX
Interrupts in 8051
PPTX
Stack in microprocessor 8085(presantation)
Addressing modes 8085
Microcontroller 8096
Interfacing memory with 8086 microprocessor
Module 1 8086
8086 pin details
Stacks & subroutines 1
8051 interfacing
Pic16cxx instruction set
Microprocessor Interfacing and 8155 Features
Microprocessor lab
8051 Microcontroller ppt
Assembly Language Programming Of 8085
Lcd interfaing using 8051 and assambly language programming
Microprocessor lab manual
8251 USART
Interfacing Stepper motor with 8051
Mechanical translational rotational systems and electrical analogous circuit...
Interrupts in 8051
Stack in microprocessor 8085(presantation)
Ad

Similar to Microprocessor Lab Manual by Er. Swapnil V. Kaware (20)

PDF
microprocessor Laboratory experiments manual
PDF
EE2356 Microprocessor and Microcontroller Lab Manuel
DOCX
Introduction to 8085 & it's description(includes basic lab experiments)
DOC
Question bank malp 3340302
PDF
Assembly language i
PPT
Assemblylanguageprogrammingof8085 100523023329-phpapp02
DOCX
Mpi lab manual eee
PDF
mpmc cse ppt.pdf
PDF
Question Bank microcontroller 8051
PPT
Malp edusat
PDF
8085 alp programs
PDF
8085_LAB_PROGRAMS.pdf
DOCX
Ashish microcontroller 8051
PPTX
Basic programming of 8085
PPT
Programming with 8085
PDF
Unit 2 Instruction set.pdf
PDF
Digital Electronics & Fundamental of Microprocessor-II
microprocessor Laboratory experiments manual
EE2356 Microprocessor and Microcontroller Lab Manuel
Introduction to 8085 & it's description(includes basic lab experiments)
Question bank malp 3340302
Assembly language i
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Mpi lab manual eee
mpmc cse ppt.pdf
Question Bank microcontroller 8051
Malp edusat
8085 alp programs
8085_LAB_PROGRAMS.pdf
Ashish microcontroller 8051
Basic programming of 8085
Programming with 8085
Unit 2 Instruction set.pdf
Digital Electronics & Fundamental of Microprocessor-II
Ad

More from Prof. Swapnil V. Kaware (20)

PDF
Corona Virus Awareness by, Er. Swapnil V. Kaware
PDF
Basic Electronics By, Er. Swapnil V. Kawrare
PDF
Addressing modes of 8085 by Er. Swapnil V. Kaware
PDF
Best GD tips by, Er. Swapnil V. Kaware
PDF
Best Interview Tips By, Er. Swapnil V. Kaware
PDF
Chandrayaan 2 By, Er. Swapnil V. Kaware
PPT
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
PDF
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
PDF
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
PDF
Combinational Logic Circuits
PPT
LED basics by Er. Swapnil V. Kaware
PDF
Electronics Lab Manual by Er. Swapnil V. Kaware
PDF
Transistors & Oscillators by Er. Swapnil Kaware
PDF
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
PDF
Basic Electronics by Er. Swapnil Kaware
PDF
Digital Electronics Basics by Er. Swapnil Kaware
PDF
Digital computer Basics by, Er. Swapnil Kaware
PPTX
Cryptography & Network Security By, Er. Swapnil Kaware
PPT
Digital signal processing By Er. Swapnil Kaware
PPT
Advanced optical communication By Er. Swapnl Kaware
Corona Virus Awareness by, Er. Swapnil V. Kaware
Basic Electronics By, Er. Swapnil V. Kawrare
Addressing modes of 8085 by Er. Swapnil V. Kaware
Best GD tips by, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. Kaware
Chandrayaan 2 By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Combinational Logic Circuits
LED basics by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. Kaware
Transistors & Oscillators by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil Kaware
Digital signal processing By Er. Swapnil Kaware
Advanced optical communication By Er. Swapnl Kaware

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
web development for engineering and engineering
DOCX
573137875-Attendance-Management-System-original
PDF
composite construction of structures.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Mechanical Engineering MATERIALS Selection
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Sustainable Sites - Green Building Construction
UNIT-1 - COAL BASED THERMAL POWER PLANTS
web development for engineering and engineering
573137875-Attendance-Management-System-original
composite construction of structures.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Internet of Things (IOT) - A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
CH1 Production IntroductoryConcepts.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Mechanical Engineering MATERIALS Selection
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
bas. eng. economics group 4 presentation 1.pptx
Sustainable Sites - Green Building Construction

Microprocessor Lab Manual by Er. Swapnil V. Kaware

  • 1. Page | 1 “MICROPROCESSOR LABORATORY MANUAL” FOR Vth SEMESTER B.E. (ELECTRICAL ENGINEERING) ACADEMIC YEAR: 2017 – 2018 (FOR PRIVATE CIRCULATION ONLY) Designed & Prepared By, Prof. Swapnil V. Kaware Asst. Professor. B.E., M.E. (Electronics) svkaware@yahoo.co.in www.linkedin.com/in/swapnil-kaware-481ab718/
  • 2. Page | 2 ABOUT THE MANUAL & PREPARATION OF RECORD ❖ This Lab Manual contains the programs of 8085 and its interfacing mentioned in the syllabus of microprocessor lab. ❖ Aim/Title of the experiment is also given at the beginning of each experiment. ❖ Once the student is able to write the program as per the algorithm. He/she is supposed to go through the instruction sets carefully and do the experiment step by step neatly under the guidance of staff member. ❖ It is also expected that the students prepare the theory relevant to the his/her experiment referring to prescribed reference books, in advance, and carry out the experiment after understanding thoroughly the concept and algorithm of the experiment. ❖ The observations should be verified and signed by the staff as soon as the experiments are completed and prepare & submit the record of the experiment while they come for the laboratory in the subsequent week. ❖ The record should contain experiment no, date, aim, instruments required, theory, algorithm, program, flowchart, theory, observation, precaution and Result. ❖ The students are directed to discuss & clarify their doubts with the faculty members as and when required. They are also directed to follow strictly the guidelines specified.
  • 3. Page | 3 Sr. No Name of Experiments Page No 1. To study about introduction of 8085 microprocessor. 4-5 2. Write an ALP to perform the addition of two 8 bit numbers. 6-7 3. Write an ALP to perform the subtraction of two 8 bit numbers. 8-9 4. Write 8085 assembly language program for addition of two16-bit numbers and sum is 16 bit. 10-12 5. Write 8085 assembly language program for decimal addition of two 8-bit numbers and sum is 8 bit. 13-14 6. To write an assembly language for multiplying two 8 bit numbers by using 8085 micro processor kit. 15-16 7. To write an assembly language program for dividing two 8 bit numbers using microprocessor kit. 17-18 8. To interface programmable peripheral interface 8255 with 8085 and study its characteristics in mode0 19-22 To interface 8253 Interface board to 8085 processor and verify the operation of 8253 in two different modes. 23-24 9. To search the largest data in an array using 8085 microprocessor. 10. 25-27
  • 4. Page | 4 Experiment No. 1 AIM: To study about introduction of 8085 microprocessor. Instruments Required: 8085 - Microprocessor software. Theory: Introduction: INTEL 8085 is one of the most popular 8-bit microprocessor capable of addressing 64 KB of memory and its architecture is simple. The device has 40 pins, requires +5 V power supply and can operate with 3MHz single phase clock. ALU (Arithmetic Logic Unit): The 8085A has a simple 8-bit ALU and it works in coordination with the accumulator, temporary registers, 5 flags and arithmetic and logic circuits. ALU has the capability of
  • 5. Page | 5 performing several mathematical and logical operations. The temporary registers are used to hold the data during an arithmetic and logic operation. The result is stored in the accumulator and the flags are set or reset according to the result of the operation. The flags are affected by the arithmetic and logic operation. Timing and control unit: This unit synchronizes all the microprocessor operation with a clock and generates the control signals necessary for communication between the microprocessor and peripherals. The control signals RD (read) and WR (write) indicate the availability of data on the data bus. Instruction register and decoder: The instruction register and decoder are part of the ALU. When an instruction is fetched from memory it is loaded in the instruction register. The decoder decodes the instruction and establishes the sequence of events to follow. Register array: The 8085 has six general purpose registers to store 8-bit data during program execution. These registers are identified as B, C, D, E, H and L. they can be combined as BC, DE and HL to perform 16-bit operation. Accumulator: Accumulator is an 8-bit register that is part of the ALU. This register is used to store 8-bit data and to perform arithmetic and logic operation. The result of an operation is stored in the accumulator. Program counter: The program counter is a 16-bit register used to point to the memory address of the next instruction to be executed. Stack pointer: It is a 16-bit register which points to the memory location in R/W memory, called the Stack. Result: Hence we have studied about 8085 microprocessor.
  • 6. Page | 6 Experiment No. 2 AIM: Write 8085 assembly language program for addition of two 8-bit numbers and sum is 8 bit. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply. Theory : Consider the first number 26H is stored in memory location 8000H and the second number 62H is stored in memory location 8001H. The result after addition of two numbers is to be stored in the memory location 8002 H. Assume program starts from memory location 8500H. Algorithm: 1. Initialize the memory location of first number in HL register pair. 2. Move first number/data into accumulator. 3. Increment the content of HL register pair to initialize the memory location of second data. 4. Add the second data with accumulator. 5. Store the result in memory location 8003H. Program: Memory Machine Codes Labels Mnemoni c Operands Comments address 8500 21, 00, 80 LXI H, 8000 H Address of first number in H-L register pair. 8503 7E MOV A,M Transfer first number in accumulator. 8504 23 INX H Increment content of H-L register pair 8505 66 ADD M Add first number and second number 8506 32, 03, 80 STA 8003H Store sum in 8003 H 8509 76 HLT Halt Experimental Results: Input DATA RESUT Memory location Data Memory location Data 8000 26H 8003 88H 8001 62H
  • 7. Page | 7 Conclusion: The addition of two 8-bit numbers is performed using 8085 microprocessor where sum is 8-bit. Precautions: 1. Properly connect the 8085 microprocessor kit with power supply terminals. 2. Switch on the power supply after checking connections. 3. Handle the Trainer kit carefully. Viva-Voice Questions: 1. What is the function of LXI H, 8000 H instruction? 2. How you can store a data in a memory location? 3. How you can read a data from a memory location? 4. What are flags available in 8085 ? 5. What is the function of RESET key of a 8085 microprocessor kit?.
  • 8. Page | 8 Experiment No. 3 AIM: Write 8085 assembly language program for addition of two 8-bit numbers and sum is 16 bit. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply. Theory : The first number F2H is stored in memory location 8501H and the second number 2FH is stored in memory location 8502H. The result after addition will be stored in the memory location 8503 H and 8504H. Consider program is written from memory location 8000H. Algorithm: 1. Initialize the memory location of 1st data in HL register pair. 2. Store first data in the memory location. 3. Increment the content of HL register pair for entering next data in the next memory location. 4. Store second data in the memory location. 5. Move second number in accumulator. 6. Decrease the content of HL register pair. 7. Add the content of memory (first data) with accumulator. 8. Store the results in memory location 8503H and 8504H. Program: Memory Machine Codes Labels Mnemonic Operand Comments address 8000 21, 01, 85 LXI H, 8501 H Address of 1st number in H-L register pair. 8003 36, F2 MVI M, F2H Store 1st number in memory location represented by H-L register pair. 8005 23 INX H Increment content of H-L register pair 8006 36, 2F MVI M, 2FH Store 2nd number in memory location represented by H-L register pair 8008 7E MOV A, M 2nd number in accumulator 8009 0E, 00 MVI C,00H Initialise C register with 00H to store MSBs of sum 800B 2B DCX H Address of 1st number
  • 9. Page | 9 2501 in H-L pair 800C 66 ADD M Addition of 1st number and 2nd number 800D D2, 11, 85 JNC LEVEL_1 If carry does not generated , jump to LEVEL_1 ? 8010 0C INR C When carry is generated, increment C register. 8011 32, 03, 85 LEVEL_1 STA 8503H Store LSBs of sum in memory location 8503H 8014 79 MOV A,C Move MSBs of sum in accumulator 8015 32, 04, 85 STA 2504 H Store MSBs of sum in memory location 8503H. 8018 76 HLT Halt Experimental Results: Input DATA RESULT Memory location Data Memory location Data 8501 F2H 8503 82H LSBs of sum 8502 2FH 8504 01H MSBs of sum Conclusion: The addition of two 8-bit numbers is performed using 8085 microprocessor where sum is 16- bit. Precautions: 1. Properly connect the 8085 microprocessor kit with power supply terminals. 2. Switch on the power supply after checking connections 3. Handle the Trainer kit carefully. Viva-Voice Questions: 1. What is the function of JNC instruction? 2. What is the difference between conditional and unconditional jump instruction? 3. What is the function of STA 2500$ instruction? 4. What is multi byte?
  • 10. Page | 10 Experiment No. 4 AIM: Write 8085 assembly language program for addition of two16-bit numbers and sum is 16 bit. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply. Theory : The first 16-bit number is stored in 8501 and 8502 memory locations. The second 16-bit number is stored in 8503 and 8504 memory locations. After addition result will be stored from 8505 and 8506 memory locations. Assume program starts from memory location 8000H. Algorithm: 1. Store first 16-bit number in H-L pair. 2. Exchange the contents of D-E pair and H-L pair to store first number in D-E registers pair. 3. Store second 16-bit number in HL register pair. 4. Addition of 1st and 2nd number 5. Store result in 8505H and 8506H locations. Program: Memory Machine Codes Labels Mnemonic Operand Comments address 8000 2A, 01, 85 LHLD 8501 H Load the content of 8501H location in L register and H register is loaded with the content of 8502H location. 8000 EB XCHG` The contents of HL register pair are exchanged with D-E register pair. So that first data is stored in DE register pair. 8000 2A, 03, 85 LHLD 8503 H Load second 16-bit number (data-2) in H-L pair. 8000 19 DAD D The contents of D-E pair are added with the contents of H-L pair and result is stored in H-L pair. 8000 22, 05, 85 SHLD 8505 H Store LSBs of sum in 8505 and MSBs of sum 8506 H. 8000 76 HLT Halt
  • 11. Page | 11 Experimental Results: Input DATA RESULT Memory location Data Memory Data location 8501 05H LSBs of data-1 8505 07H LSBs of sum 8502 01H MSBs of data-1 8506 04H MSBs of sum 8503 02H LSBs of data-2 8504 03H MSBs of data-2 Conclusion: The addition of two 16-bit numbers is performed using 8085 microprocessor where sum is 16- bit. Precautions: 1. Properly connect the 8085 microprocessor kit with power supply terminals. 2. Switch on the power supply after checking connections 3. Handle the Trainer kit carefully. Viva-Voice Questions: 1. What is the function of XCHG instruction? 2. How you can load 16-bit data in 8500H and 8501H memory locations? 3. What is the difference between LSLD and SHLD instructions? 4. What is the function of DAD D instruction? 5. What is difference between byte and word?
  • 12. Page | 12 Experiment No. 5 AIM: Write 8085 assembly language program for decimal addition of two 8-bit numbers and sum is 8 bit. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply Theory : Two decimal numbers are stored in 8000H and 8001H. The result is to be stored in 8002H location. Consider program starts from memory location 8100H Algorithm: 1. Initialize the memory location of first number in HL register pair. 2. Load the first number in accumulator. 3. Increment the content of HL register pair to initialize the memory location of second data. 4. Addition of the content of second memory location with first data. 5. Decimal adjustment of result.. 6. Store the result in memory location 8002H. Program: Memory Machine Codes Labels Mnemonic Operand Comments address 8100 21, 50, 80 LXI H,8050 Load the address of first number in H-L register pair 8103 7E MOV A,M Store the first number in accumulator 8104 23 INX H Increment H-L register pair to locate second number 8105 86 ADD M Addition of 1st and 2nd number 8106 27 DAA Decimal Adjust 8107 32, 02, 80 STA 8002 Store result in 8002H location 810A 76 HLT Halt Experimental Results: Input DATA RESULT Memory location Data Memory location Data 8000 22H 8002 89H 8001 67H
  • 13. Page | 13 Conclusion: The decimal addition of two 8-bit numbers is performed using 8085 microprocessor where sum is 8-bit. Precautions: 1. Properly connect the 8085 microprocessor kit with power supply terminals. 2. Switch on the power supply after checking connections. 3. Handle the Trainer kit carefully. Viva-Voice Questions: 1. What is the function of DAA instruction?
  • 14. Page | 14 Experiment No. 6 AIM: To write an assembly language for multiplying two 8 bit numbers by using 8085 micro processor kit. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply. Algorithm: Step1 : Start the microprocessor Step2 : Get the 1st 8 bit numbers Step3 : Move the 1st 8it number to register ‘B’ Step4 : Get the 2nd 8 bit number Step5 : Move the 2nd 8 bit number to register ‘C’ Step6 : Initialize the accumulator as zero Step7 : Initialize the carry as zero Step8 : Add both register ‘B’ value as accumulator Step9 : Jump on if no carry Step10 : Increment carry by 1 if there is Step11 : Decrement the 2nd value and repeat from step 8, till the 2nd value becomes zero. Step12 : Store the multiplied value in accumulator Step13 : Move the carry value to accumulator Step14 : Store the carry value in accumulator Address Label Mnemonics Hex Code Comments 4100 LDA 4500 3A, 00, 45 Load the first 8 bit number 4103 MOV B,A 47 Move the 1st 8 bit data to register ‘B’ 4104 LDA 4501 3A, 01, 45 Load the 2nd 16 it number 4107 MOV C,A 4F Move the 2nd 8 bit data to register ‘C’ 4108 MVI A, 00 3E, 00 Intialise the accumulator as zero 410A MVI D, 00 16, 00 Intialise the carry as zero 410C ADD B 80 Add the contents of ‘B’ and accumulator 410D INC D2 11, 41 Jump if no carry 4110 INR D 14 Increment carry if there is 4111 DCR C OD Decrement the value ‘C’ 4112 JNZ C2 0C, 41 Jump if number zero 4115 STA 4502 32 02, 45 Store the result in accumulator 4118 MOV A,D 7A Move the carry into accumulator 4119 STA 4503 32,03,45 Store the result in accumulator 411C HLT 76 Stop the program execution Program:
  • 15. Page | 15 Input Input Address Value 4500 04 4501 02 Output Output Address Value 4502 08 4503 00 Result: The assembly language program for multiplication of two 8 bit numbers was executed using 8085 micro processing kit.
  • 16. Page | 16 Experiment No. 7 Aim: To write an assembly language program for dividing two 8 bit numbers using microprocessor kit. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply. Algorithm: Step1 : Start the microprocessor Step2 : Intialise the Quotient as zero Step3 : Load the 1st 8 bit data Step4 : Copy the contents of accumulator into register ‘B’ Step5 : Load the 2nd 8 bit data Step6 : Compare both the values Step7 : Jump if divisor is greater than dividend Step8 : Subtract the dividend value by divisor value Step9 : Increment Quotient Step10 : Jump to step 7, till the dividend becomes zero Step11 : Store the result (Quotient) value in accumulator Step12 : Move the remainder value to accumulator Step13 : Store the result in accumulator Step14 : Stop the program execution Address Label Mnemonics Hex Code Comments 4100 MVI C, 00 0E, 00 Intialise Quotient as zero 4102 LDA, 4500 3A 00, 45 Get the 1st data 4105 MOV B,A 47 Copy the 1st data into register ‘B’ 4106 LDA, 4501 3A 01, 45 Get the 2nd data 4109 CMP B B8 Compare the 2 values 410A JC (LDP) DA 12,41 Jump if dividend lesser than divisor 410D Loop 2 SUB B 90 Subtract the 1st value by 2nd value 410E INR C 0C Increment Quotient (410D) 410F JMP (LDP, 41) C3, 0D, 41 Jump to Loop 1 till the value of dividend becomes zero 4112 Loop 1 STA 4502 32 02,45 Store the value in accumulator 4115 MOV A,C 79 Move the value of remainder to accumulator 4116 STA 4503 32 03,45 Store the remainder value in accumulator 4119 HLT 76 Stop the program execution Program:
  • 17. Page | 17 Input Input Address Value 4500 09 4501 02 Output Output Address Value 4502 04 (quotient) 4503 01 (reminder) Result: The assembly language program for division of two 8 bit numbers was executed using 8085 micro processing kit.
  • 18. Page | 18 Experiment No. 8 AIM: To interface programmable peripheral interface 8255 with 8085 and study its characteristics in mode0, mode1 and BSR mode. Instruments Required: 8085 kit, 8255Interface board, DC regulated power supply. Theory: Control Word: MODE 0 – SIMPLE I/O MODE: This mode provides simple I/O operations for each of the three ports and is suitable for synchronous data transfer. In this mode all the ports can be configured either as input or output port. Let us initialize port A as input port and port B as output port
  • 19. Page | 19 PROGRAM: ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS 4100 START: MVI A, 90 Initialize port A as 4101 Input and Port B as output. 4102 OUT C6 Send Mode Control 4103 word 4104 IN C0 Read from Port A 4105 4106 OUT C2 Display the data in 4107 port B 4108 STA 4200 Store the data read 4109 from Port A in 4200 410A 410B HLT Stop the program. MODE1 STROBED I/O MODE: In this mode, port A and port B are used as data ports and port C is used as control signals for strobed I/O data transfer. Let us initialize port A as input port in mode1. MAIN PROGRAM: ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS 4100 START: MVI A, B4 Initialize port A as 4101 Input port in mode 1. 4102 OUT C6 Send Mode Control 4103 word 4104 MVI A,09 Set the PC4 bit for INTE A 4105 4106 OUT C6 Display the data in port B 4107 EI 4108 MVI A,08 Enable RST5.5 4109 410A SIM EI 410B HLT Stop the program.
  • 20. Page | 20 ISR (Interrupt Service Routine): ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS 4200 START: IN C0 Read from port A 4201 4202 STA 4500 Store in 4500. 4203 4204 4205 HLT Stop the program. Sub program: ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS 405E JMP 4200 Go to 4200 405F 4060 BSR MODE (Bit Set Reset mode) Any lines of port c can be set or reset individually without affecting other lines using this mode. Let us set PC0 and PC3 bits using this mode.
  • 21. Page | 21 PROGRAM: ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS 4100 START: MVI A, 01 Set PC0 4101 4102 OUT C6 Send Mode Control 4103 word 4104 MVI A,07 Set PC3 4105 4106 OUT C6 Send Mode Control 4107 word 4109 HLT Stop the program. RESULT: Thus 8255 is interfaced and its characteristics in mode0,mode1 and BSR mode is studied.
  • 22. Page | 22 Experiment No. 9 AIM: To interface 8253 Interface board to 8085 processor and verify the operation of 8253 in two different modes. Instruments Required: 8085 processor kit, 8253 Interface board, DC regulated power supply. Theory: Mode 2 – Rate Generator: It is a simple divide by N counter. The output will be low for one period of the input clock. The period from one output pulse to the next equals the number of input counts in the count register. If the count register is reloaded between output pulses the present period will not be affected but the subsequent period will reflect the new value. Example: Using Mode 2, Let us divide the clock present at Channel 1 by 10. Connect the CLK1 to PCLK. Address Opcodes Label Mnemonic Operand Comments 4100 3E 74 START: MVI A, 74 Channel 1 in mode 2 4102 D3 CE OUT CE Send Mode Control word 4104 3E 0A MVI A, 0A LSB of count 4106 D3 CA OUT CA Write count to register 4108 3E 00 MVI A, 00 MSB of count 410A D3 CA OUT CA Write count to register 410C 76 HLT In CRO observe simultaneously the input clock to channel 1 and the output at Out1. Mode 3 Square wave generator: It is similar to Mode 2 except that the output will remain high until one half of count and go low for the other half for even number count. If the count is odd, the output will be high for (count + 1)/2 counts. This mode is used of generating Baud rate for 8251A (USART).
  • 23. Page | 23 Example: We utilize Mode 0 to generate a square wave of frequency 150 KHz at channel 0. Address Opcodes Label Mnemonic Operand Comments 4100 3E 36 START: MVI A, 36 Channel 0 in mode 3 4102 D3 CE OUT CE Send Mode Control word 4104 3E 0A MVI A, 0A LSB of count 4106 D3 C8 OUT C8 Write count to register 4108 3E 00 MVI A, 00 MSB of count 410A D3 C8 OUT C8 Write count to register 410C 76 HLT Result: Hence operation of 8253 in two different modes has been studied.
  • 24. Page | 24 Experiment No. 10 Aim: To search the largest data in an array using 8085 microprocessor. Instruments Required: 1. 8085 Microprocessor Kit, 2. +5V Power supply. Algorithm: Sr.No. Details of the step 1 Load the address first element of array in HL reg pair. 2 Move the count of B reg. 3 Increment the pointer. 4 Get the first data in A reg. 5 Decrement the count. 6 Increment the pointer. 7 Compare the counter of memory address by HL pair carry=0, goto step 10 else to step 9 with that of A move the content of HL to A reg. 8 Decrement the count. 9 If ZF=0, goto step 6 or if ZF=1 goto next step. 10 Goto large data. 11 Terminate the program. Program: ADDRESS OPCODE LABEL MNEMONICS COMMENTS 4100 21 00 42 LXIH 4200H Set Pointer for array 4103 46 MOV B,M Set count for no of element in array 4104 23 INX H 4105 7E MOV A,M Set first element of array as large data 4106 05 DCR B Decrement the count 4107 23 LOOP INX H 4108 BE CMP M Compare an element of array with current largest data 4109 02 00 41 JNC AHEAD If CY=0, goto AHEAD 410C 7E MOV A,M If CY=1, then content of memory is larger than accumulator. Hence If CY=1, make
  • 25. Page | 25 Result: Thus the program to find the largest data in an array is constructed and verified successfully. I T / I V ‐ S E M M P & M C L A B ‐ L M memory content as current largest by moving it to A reg 410D 05 AHEAD DCR B 410E C2 07 41 JNZ LOOP Repeat comparison until count is zero 4111 32 00 42 STA 4300H Store the large data in memory 4114 76 HLT Terminate the program Output: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 07 4201 62 4202 7D 4203 FC 4300 FC 4204 24 4205 C2 4206 0F 4207 92
  • 26. Page | 26 QUESTIONS AND ANSWERS: 1. What is assembly language? The language in which the mnemonics (short -hand form of instructions) are used to write a program is called assembly language. The manufacturers of microprocessor give the nemonics. 2. What does the instruction LXIH,4200 mean? The data present in the address location 4200 is loaded into the H register. 3. How many machine cycles constitute one instruction cycle in 8085? Each instruction of the 8085 processor consists of one to five machine cycles. 4. What is the drawback in machine language and assembly language programs? The machine language and assembly language programs are machine dependent. The programs developed using these languages for a particular machine cannot be directly run on another machine . “Microprocessor laboratory Manual” Designed & Prepared By, Prof. Swapnil V. Kaware Asst. Professor. B.E., M.E. (Electronics) svkaware@yahoo.co.in www.linkedin.com/in/swapnil-kaware-481ab718/