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

MP Practice File Nishant

This document describes experiments completed for a Microprocessor and Interfacing Lab course. It includes a student's name and program topics covered, along with dates and signatures. The topics covered assembly language programs to find ones complement, twos complement, addition, subtraction, and multiplication of binary numbers using an 8085 microprocessor kit. Interfacing programs with LEDs and a logic controller are also listed.

Uploaded by

NK
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)
75 views

MP Practice File Nishant

This document describes experiments completed for a Microprocessor and Interfacing Lab course. It includes a student's name and program topics covered, along with dates and signatures. The topics covered assembly language programs to find ones complement, twos complement, addition, subtraction, and multiplication of binary numbers using an 8085 microprocessor kit. Interfacing programs with LEDs and a logic controller are also listed.

Uploaded by

NK
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
You are on page 1/ 29

MICROPROCESSOR AND INTERFACING LAB

SUBMITTED TO:-
Mr. Gourav
Guest Faculty of ECE

SUBMITTED BY:-

Nishant Kumar 4th Sem(CSE).

182009

Teacher’s Signature...................
SR.NO. PROGRAMS/TOPICS DATE SIGNATURE

1. To study about 8085 Microprocessor


kit.

2(a). Write 8085 assembly language


program to find one’s complement of
an 8-bit number.

2(b). Write 8085 assembly language


program to find Two’s complement of
an 8-bit number.

3(a). Write a well-documented program


using 8085 for addition of two 8-bit
numbers.

3(b). An ALP to move a byte/word using


different addressing modes.

3(c). An ALP to move data from source to


destination using indirect addressing
mode without overlap.

4(a). To Write An Alp to add two 16bit


data.

4(b). To Write An Alp to subtract two 16bit


number.

Write a well-documented program


using 8085 for subtraction of two 8-bit
4(c). numbers.

5. Write an ALP to find the product of


two unsigned binary number stored at
location ‘X’ and ‘X+1’ by shift left
and add method and display the
product in address field.
6. Write an assembly language program
to reverse the given digit.

7(a). Write an assembly language program


to find the square and cube of a
number using subroutine.

7(b). Write an assembly language program


to find the Factorial of a number using
subroutine.

8(a). Interface 8 LED’s with 8085 CPU and


write an ALP to make two LED’s on
at a time in sequence repeat the
process 100 times.

8(b). Program to interface logic controller


as BCD up-down counter function.

Experiment No:1
AIM:- To Study about 8085 Microprocessor kit.

Apparatus:- 8085 Microprocessor Kit.

THEORY:-

SYSTEM INTRODUCTIONS :-
GENERAL DESCRIPTION 8085 Micro Processor is a single board Microprocessor training/
Development Kit configured around the most widely used Microprocessor of todays world.
Based on 8085 Microprocessor, it can be used to train engineers to control any industrial
process and to develop software for 8080 and 8085 based systems. The 8085 communicates
with the outside world through a key board having 28 keys and seven segement hexadecimal
display. The kit also has the capability of interacting with CRT Terminal and IBM PC
compatible computer system through the serial interface provided on the board. The 8085
model has an extra on board facility of audio cassette interface. 8085 provides 8K/32K bytes
of RAM and 8K bytes of EPROM. The total on board memory can be very easily expanded
to 64K bytes in an appropriate combination of RAM and ROM. The monitor is incorporated
from 0000 - 1FFF and the necessary 8K bytes of RAM has an address of 2000 - 3FFF. The
Input / Output structure of 8085 provides 24 programmable I/O lines using 8255. It has got
16 bit programmable Timer/Counter for generating any type of counting etc. The on board
residents system monitor software is very powerful and provides various software utilities.
The kit provides various powerful software commands like, INSERT, DELETE, BLOCK
MOVE, RELOCATE, STRING FILL & MEMORY COMPARE etc. which are very helpful
in debugging/developing the software. 8085 is configured around the internationally adopted
STD Bus, which is the most popular bus for process control and real time applications. All
the address, data and control lines are available at the edge connector. The kit is fully
expandable for any kind of application.

SYSTEM SPECIFICATION:
CPU - 8 bit Microprocessor, the 8085 .

MEMORY - Total on board capacity of 64K bytes.

RAM - 8K/32K bytes and space for further expansion.

ROM - 8K bytes of EPROM loaded with powerful program.

I/O - 24 I/O lines using 8255.

KEYBOARD - 10 keys for command 16 keys for hexadecimal data entry 1 key for vector
interrupt & 1 key for reset.

LED DISPLAY - 6 seven segment deisplay 4 for address field & 2 for data field.

BUS - All data, address and control signals (TTL compatible available at FRC connector).
INTERFACE - RS - 232 - C through SID/SOD lines with auto baud rate.

POWER SUPPLY - +5v, 1.5Amp for the kit.

REQUIREMENT - +12V + 5%, 250mA for CRT/PC interface.

OPERATING TEMPERATURE- 0 to 50o C

SYSTEM CAPABILITIES(KEYBOARD MODE):

HARDWARE DISCRIPTION :

GENERAL:
The system has got 8085 as the Central Processing Unit. The clock frequency for the system
is 3.07 MHz and is generated from a crystal of 6.14 MHz. 8085 has got 8 data lines and 16
address lines. The lower 8 address lines and 8 bit data lines are multiplexed. Since the lower
8 address bits appear on the bus during the first clock cycle of a machine cycle and the 8 bit
data appears on the bus during the 2nd and 3rd clock cycle, it becomes necessary to latch the
lower 8 address bits during the first clock cycle so that the 16 bit address remains available in
subsequent cycles. This is achieved using a latch 74 -LS 373.

MEMORY: 8085 provides 8/32K bytes of RAM using 6264/62256 chip and 8K bytes of
EPROM for monitor. There is one memory space provided on 8085. This one space can be
defined any address slots from 8000 - DFFF depending upon the size of the memory chip to
be used. Total on board memory can be extended to 64k bytes.

I/O DEVICES:
The various I/O chips used in 8085 are 8279, 8255 & 8253. The functional role of all these
chips is given below:

8279 (KEYBOARD & DISPLAY CONTROLLER):


8279 is a general purpose programmable keyboard and display I/O interface device designed
for use with the 8085 microprocessor. It provides a scanned interface to 28.

contact key matrix provided in 8085 and scanned interface for the six seven segment
displays. 8279 has got 16 x 8 display RAM which can be loaded or interrogated by the CPU.
When a key is pressed, its corresponding code is entered in the FIFO Queue of 8279 and can
now be read by the microprocessor. 8279 also refreshes the display RAM automatically.

8255 (PROGRAMMABLE PERIPHERAL INTERFACE):


8255 is a Programmable Peripheral Interface (PPI) designed to use with 8085
Microprocessor. This basically acts as a general purpose I/O device to interface peripheral
equipments to the system bus. It is not necessary to have an external logic to interface with
peripheral devices since the functional configuration of 8255 is programmed by the system
software. It has got three Input/Output ports of 8 lines each (PORT - A, PORT - B & PORT -
C). Port C can be divided into two ports of 4 lines each named as Port C upper and Port C
lower. Any Input/Output combination of Port A, Port B and Port C upper and lower can be
defined using the appropriate software commands. The port addresses for these port are given
in Chapter - 6. 8085 provides 24 Input/Output ports using 8255 chips.

INSTALLATION OF 8085 KIT:


1. Connect +5V and GND to the 8085 Kit.

2. Switch on the power supply.

3. ‘UP 85’ message will come on the display.

RESULT:
The Experiment is successfully done.

Experiment No:2(a):-
Aim: Write 8085 assembly language program to find one’s complement of an 8-bit
number.

Instruments Required:
1. 8085 Microprocessor Kit.

2. +5V Power supply.


Theory:
The number is stored in memory location 8050H and one’s complement of number will be
stored in location 8051H. Assume the program memory starts from 8000H.

Algorithm:
1. Load memory location of data 8000H in H-L registers pair.

2. Move data into accumulator.

3. Complement accumulator.

4. Store the result in memory location 8050H Program

Program:

Memory Hex Code Mnemonics Comments


Address
8500 21 LXI H 8000H Load address of number in HL
register pair.

8501 00

8502 80

8503 7E MOV A,M Move no. into accumulator.

8504 3F CMA Complement Accumulator.

8505 32 STA 8050H Store the result in 8050H.

8506 50

8507 80

8508 76 HLT Stop Execution.

Experimental Results:

Input Data Result


Input Address Value Output Address Value
8000 F0H 8050 0FH
Conclusion:-
The one’s complement of an 8-bit numbers is performed using 8085 microprocessor.

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.

Experiment No:2(b):-
Aim: Write 8085 assembly language program to find Two’s complement of an 8-bit
number.

Instruments Required:
1. 8085 Microprocessor Kit.

2. +5V Power supply.

Theory:
The number is stored in memory location 8000H. The Two’s complement of number will be
stored in location 8050H. Assume the program memory starts from 8500H.

Algorithm:
1. Transfer the content of memory location 8500H to accumulator.

2. Complement the content of accumulator.

3. Add 01H with accumulator to get two’s complement of number.

4. Store the result in memory location 8501H.

Program:

Memory Hex Code Mnemonics Comments


Address
8500 21 LXI H, 8000H Load address of number in HL
register pair.

8501 00

8502 80

8503 7E MOV A,M Move no. into accumulator.

8504 3F CMA Complement Accumulator.

8505 C6 ADI 01 Add 01H with accumulator to find


two’s complement of number.

8506 01 01

8507 32 STA 8050H Store the result in 8050H.

8508 50

8509 80

850A 76 HLT Stop Execution

Experimental Results:

Input Data Result


Input Address Value Output Address Value
8000 F0H 8050 10H

Conclusion:-
The Two’s complement of an 8-bit numbers is performed using 8085 microprocessor.

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.

Experiment No:3(a):-
Assignments to write assembly language program using data transfer instructions.

OBJECTIVE:-
Write a well-documented program using 8085 for addition of two 8-bit numbers.

Apparatus:- 8085 microprocessor kit

Theory:-
2501H is the address of memory location for the 1st number. 2nd number is stored at next
memory location. By the virtue of the program given below we first move the 1st number
into accumulator register then add the 2nd number to this and use the next memory location
i.e. 2503h to store the result. The program given below is self explanatory.

Program:-

Memory Hex Mnemonics Operands Comments


Address Code
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 the address 2502H.

2005 86 ADD M Add the second no.

2006 23 INX H HL points 2503H.

2007 77 MOV M,A Store result in 2503H.

2008 CF RST 1 Terminate.

Algorithm:
1. Initialize HL Reg. pair with address where the first number is lying.

2. Move 1st no. in accumulator

3. HL points the address 2502H

4. Add the 2nd no

5. HL points 2503H

6. Store result in 2503H.

7. Terminate.

Input Data:-
2501- 67H

2502- 22H

Output Data:-
2503- 89H

Precautions:-
(1) Make sure proper handling of equipments/ kits.

(2) Make sure that all the machine codes/ mnemonics are as per the program.

Result:-
Addition of 67H and 22H is 89H. Hence experiment for the addition of two 8-bit numbers
has been successfully performed.

Experiment No:3(b):-
Assignments to write assembly language program using data transfer instructions.

OBJECTIVE:-
An ALP to move a byte/word using different addressing modes.

Apparatus:- 8085 microprocessor kit

PROGRAM:-
MOV AX,@DATA

MOV DS, AX ; INITIALIZE THE DATA SEGMENT

MOV AX, 1234H ; IMMEDIATE ADDRESSING

MOV BX, AX ; REGISTER ADDRESSING

MOV AX, NUM ; DIRECT ADDRESSING

MOV SI, 1000H

MOV AL, [SI] ; INDIRECT ADDRESSING


MOV BL, [SI+100H] ; RELATIVE ADDRESSING

MOV BX, 1000H

MOV AX, [SI+BX] ; BASE INDEX ADDRESSING

MOV CX, [SI+BX+100H] ; RELATIVE BASE INDEX ADDRESSING

END ; TERMINATE THE PROGRAM

Experiment No:3(c):-
Assignments to write assembly language program using data transfer instructions

OBJECTIVE:-
An ALP to move data from source to destination using indirect addressing mode
without overlap.

Apparatus:- 8085 microprocessor kit

PROGRAM:-
MOV AX,@DATA ; INITIALIZE THE DATA SEGMENT

MOV DS, AX

LEA SI, D1 ; LOAD OFFSET ADDRESS OF D1 IN SI

LEA DI, D2 ; LOAD OFFSET ADDRESS OF D2 IN DI

MOV CX, 05 ; LOAD CX WITH COUNT

MOV AL, [SI] ; MOVE THE 1ST ELEMENT OF D1 TO AL


MOV [DI], AL ; MOVE TO D2

INC SI ; INCREMENT SI

INC DI ; INCREMENT DI

DEC CX ; DECREMENT THE COUNTER

JNZ UP ; REPEAT TILL CX BECOMES ZERO

END

Experiment No:4(a):-
Assignments to write assembly language program using arithmetic instructions

OBJECTIVE:-
To Write An Alp to add two 16bit data.

Apparatus:- 8086 microprocessor kit

Algorithm:-
1. Load the first data in AX register.

2. Load the second data in BX register.

3. Clear CL register.

4. Add the two data and get the sum in AX register.

5. Store the sum in memory.

6. Check for carry, if carry flag is set then go to next step, otherwise go to step-8.

7. Increment CL register.
8. Store the carry in memory.

9. Stop.

PROGRAM:-
MOV SI, 1100H

MOV AX, [SI]

MOV BX, [SI+2]

MOV CL, 00H

ADD AX, BX

MOV [SI+4], AX

JNC 0113

INC CL

MOV [SI+6], CL INT A5

Experiment No:4(b):-
Assignments to write assembly language program using arithmetic instructions.

OBJECTIVE:-
To Write An Alp to subtract two 16bit number.

Apparatus:- 8086 microprocessor kit

Algorithm:-
1. Load the first data in AX register.

2. Load the second data in BX register.

3. Clear CL register.

4. Subtract the two data and get result in AX register.

5. Store the data of AX in memory.

6. Check for carry, if carry flag is set then go to next step, otherwise go to step-8.

7. Increment CL register.

8. Store the carry in memory.


9. Stop.

PROGRAM:-
MOV SI, 1100H

MOV AX, [SI]

MOV BX, [SI+2]

MOV CL, 00H

SUB AX, BX

MOV [SI+4], AX

JNC 0113

INC CL

MOV [SI+6], CL

INT A5

Experiment No:4(c):-
Assignments to write assembly language program using arithmetic instructions

OBJECTIVE:-
Write a well-documented program using 8085 for subtraction of two 8-bit numbers.

Apparatus:- 8085 microprocessor kit, 5V Power Supply.

Program:-

Memory Hex Mnemonics Operands Comments


Address Code
7000 21,01,75 LXI H,7501 Get address of 1st no. in HL pair.

7003 7E MOV A,M Move 1st no. in accumulator.

7004 23 INX H HL points the address 7502H.

7005 96 SUB M Sub the second no. from 1st no.

7006 23 INX H HL points7503H.


7007 77 MOV M,A Move contents of acc to memory.

7008 CF RST 1 Stop.

Input Data:-
7501

7502

Output Data:-
7503
Experiment No:5:-
Assignments to write assembly language program using shift and rotate instructions.

OBJECTIVE:-
Write an ALP to find the product of two unsigned binary number stored at location ‘X’
and ‘X+1’ by shift left and add method and display the product in address field.

Apparatus:- 8085 microprocessor kit.

Program:-
LXI H, F100H

MOV E,M

MVI D,00H

INX H

MOV A,M

LXI H,0000H

MVI B,08H

DAD H

RAL

JNC SKIP

DAD D

DCR B

JNZ MULT

SHLD FE73

CALL UPDAD

HLT
ALGORITHM:-
STEP 1. Load the data’s from location ‘X’ and ‘X+1’.

STEP 2. Find the product using shift left method.

STEP 3. Display the result in ADDRESS field

STEP 4. Halt the processor

Note:-

⮚ Store the program starting from F100H


⮚ Store the data at location F100H and F101H
⮚ Execute the program.
⮚ Result will be displayed in address field.
⮚ Address for UPDAD is 06BFH

Result :-

Before Execution
Address for 1st Multiplier Data Address for 2nd Multiplier Data

F100H 06 F101H 05

Before:-

Address Field:-

0 0 1 E
Experiment No:6:-
Assignments to write assembly language program using Stacks for 8086
Microprocessor.

OBJECTIVE:-
Write an assembly language program to reverse the given digit.

Apparatus:- 8086 microprocessor kit.

Program:-
MOV DS, AX

MOV AX, VARIABLE

MOV CX, 0000H

MOV BX, 0010H

Back:-
MOV DX, 0000H

DIV BX

PUSH AX

MOV AX, CX

MUL BX

POP DX

ADD AX, DX

MOV CX, AX

POP AX

OR AX, AX

JNZ BACK

HLT
Experiment No:7(a):-
Assignments to write assembly language program using Subroutines for 8086
Microprocessor.

OBJECTIVE:-
Write an assembly language program to find the square and cube of a number using
subroutine.

Apparatus:- 8086 microprocessor kit.

Program:-

DATA SEGMENT
NO DB 2

DATA ENDS

CODE SEGMENTS
SQUARE PROC NEAR

ASSUME CS: CODE

MOV AX, 0000

MOV AL, BL

MUL BL

MOV CX, AX

MUL BL

MOV BX, AX

RET

SQUARE ENDP

ASSUME DS: DATA, CS: CODE


START
MOV AX, DATA

MOV DS, AX

MOV BL, NO

CALL SQUARE

MOV BL, 00H

MOV AH, 4CH

INT 21H

HLT
Experiment No:7(b):-
Assignments to write assembly language program using Subroutines for 8086
Microprocessor.

OBJECTIVE:-
Write an assembly language program to find the Factorial of a number using
subroutine.

Apparatus:- 8086 microprocessor kit.

Program:-

DATA SEGMENT
NO DW 5

DATA ENDS

CODE SEGMENTS
FACTO PROC NEAR

ASSUME CS: CODE

MOV AX, 0000

POP BX

POP AX

PUSH BX

MOL BL, AL

DEC BL

L1: MUL BL

DEC BL

CMP BL, 00

JNE L1

L2: RET

FACTO ENDP
ASSUME DS: DATA, CS: CODE

START:

MOV AX, DATA

MOV DS, AX

PUSH NO

CALL FACTO

MOV BH, 00

MOV AH, 4CH

INT 21H

HLT
Experiment No:8(a):-
Assignment on Interfacing of 8255 with 8085.

OBJECTIVE:-
Interface 8 LED’s with 8085 CPU and write an ALP to make two LED’s on at a time in
sequence repeat the process 100 times.

Program:- Comments:-
LXI SP, C000H Count for 100 cycles four group of 2 LED’s each.

MVI C, 64H

MVI A, 80H

L1: OUT 03H CWR for port A, Mode D;

MVI A, C0H

L2: OUT 00H To make first two LED’s ON for 100 msec

CALL DELAY

RRC

RRC To make next two LED’s ON.

DCR B

JNZ L2

DCR C

JNZ L2

XRA A

OUT 00H

HLT
Experiment No:8(b):-
Assignment on Interfacing of 8255 with 8085.

OBJECTIVE:-
Program to interface logic controller as BCD up-down counter function.

START:
MOV AX,@DATA
MOV DS,AX
MOV AL,82H
MOV DX,CTRL
OUT DX,AL
MOV CL,00H
UP: CALL DELAY
MOV AH,06H
MOV DL,0FFH
INT 21H
CMP AL,'Q'
JE EXIT
MOV DX,PB
IN AL,DX
CMP AL,00
JE DOWNC
MOV AL,CL
MOV DX,PA
OUT DX,AL
ADD AL,01H
DAA
MOV CL,AL
CMP CL,99H
JBE UP
MOV CL,00
JMP UP
;DOWN COUNTER
DOWNC:
MOV AL,CL
MOV DX,PA
OUT DX,AL
CMP CL,00H
JE DOWN
MOV AL,CL
SUB AL,01
DAS
MOV CL,AL
JMP DOWN1
DOWN: MOV CL,99H
DOWN1: JMP UP
EXIT: INT 3
DELAY PROC
MOV AX, 0FFFFH
UP2: MOV BX, 4FFFH
UP1: DEC BX
JNZ UP1
DEC AX
JNZ UP2
RET
DELAY ENDP
END START

You might also like

pFad - Phonifier reborn

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

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


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy