MP Practice File Nishant
MP Practice File Nishant
SUBMITTED TO:-
Mr. Gourav
Guest Faculty of ECE
SUBMITTED BY:-
182009
Teacher’s Signature...................
SR.NO. PROGRAMS/TOPICS DATE SIGNATURE
Experiment No:1
AIM:- To Study about 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 .
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.
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:
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.
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.
Algorithm:
1. Load memory location of data 8000H in H-L registers pair.
3. Complement accumulator.
Program:
8501 00
8502 80
8506 50
8507 80
Experimental Results:
Precautions:-
1. Properly connect the 8085 microprocessor kit with power supply terminals.
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.
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.
Program:
8501 00
8502 80
8506 01 01
8508 50
8509 80
Experimental Results:
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.
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.
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:-
Algorithm:
1. Initialize HL Reg. pair with address where the first number is lying.
5. HL points 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.
PROGRAM:-
MOV AX,@DATA
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.
PROGRAM:-
MOV AX,@DATA ; INITIALIZE THE DATA SEGMENT
MOV DS, AX
INC SI ; INCREMENT SI
INC DI ; INCREMENT DI
END
Experiment No:4(a):-
Assignments to write assembly language program using arithmetic instructions
OBJECTIVE:-
To Write An Alp to add two 16bit data.
Algorithm:-
1. Load the first data in AX register.
3. Clear CL register.
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
ADD AX, BX
MOV [SI+4], AX
JNC 0113
INC CL
Experiment No:4(b):-
Assignments to write assembly language program using arithmetic instructions.
OBJECTIVE:-
To Write An Alp to subtract two 16bit number.
Algorithm:-
1. Load the first data in AX register.
3. Clear CL register.
6. Check for carry, if carry flag is set then go to next step, otherwise go to step-8.
7. Increment CL register.
PROGRAM:-
MOV SI, 1100H
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.
Program:-
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.
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’.
Note:-
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.
Program:-
MOV DS, AX
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.
Program:-
DATA SEGMENT
NO DB 2
DATA ENDS
CODE SEGMENTS
SQUARE PROC NEAR
MOV AL, BL
MUL BL
MOV CX, AX
MUL BL
MOV BX, AX
RET
SQUARE ENDP
MOV DS, AX
MOV BL, NO
CALL SQUARE
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.
Program:-
DATA SEGMENT
NO DW 5
DATA ENDS
CODE SEGMENTS
FACTO PROC NEAR
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 DS, AX
PUSH NO
CALL FACTO
MOV BH, 00
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
MVI A, C0H
L2: OUT 00H To make first two LED’s ON for 100 msec
CALL DELAY
RRC
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