MPI Lab Manual Teacher
MPI Lab Manual Teacher
(3160712)
6th Semester
LABORATORY MANUAL
SARDAR PATEL COLLEGE OF ENGINEERING
BAKROL, ANAND
CERTIFICATE
of_______________________Enrollment No.____________________
has satisfactorily completed his/her term work in the subject
______________________________________ for the term ending in
_____________________ 20 /20 .
Date: ________
PRACTICAL NO: 1
Aim: Write an 8085 Assembly Language Program (ALP) for exchanging two 8 bit numbers
stored on Memory Locations 2050 H and 2051 H
Code:
LDA 2050h // Load Data (03) from Memory Location 2050 into A.
LDA 2051h // Load Data (02) from Memory Location 2051 into A.
Input:
1
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Output:
Questions:
Teacher Signature
2
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 2
Aim: Write an 8085 Assembly Language Program (ALP) to add two 8 bit numbers stored on
Memory Locations 2050 H and 2051 H and store result on Memory Location 2052 H.
Code:
LDA 2050h // Load Data (03) from Memory Location 2050 into A.
LDA 2051h // Load Data (02) from Memory Location 2051 into A.
Input:
3
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Output:
Memory Location Value
2052 05h
Questions:
Teacher Signature
4
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 3
Aim: Write an 8085 Assembly Language Program (ALP) to add two 16 bit numbers stored on
memory
Code:
LHLD 2050h // Load Data (03) from Memory Location 2051 into Register H & Data (02) from Memory
XCHG // Move Content of Register H (03) into register D & Content of Register L (02) into
Register E
LHLD 2052h // Load Data (05) from Memory location 2053 into Register H & Data (04) from
DAD D // Adds Content of Register H (05) with Content of Register D (03) as well as
5
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
content of Register L (04) with Content of Register E (02) (including carry if it’s
generated) and result (08) into Register H and result (06) into Register L.
SHLD 2054h // Store Content of Register H (08) at Memory Location 2054 and Register L (06) at
Input:
Output:
Questions:
Q.1 Give one example each of the five types of addressing modes.
6
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Q.3 Write down the instructions that load H-L register pair by the contents of memory
location 3500H. Then move the contents to register C.
Teacher Signature
7
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 4
Aim: Write an 8085 assembly language program to find the minimum from two 8-bit numbers.
Code:
LDA 2051h // Load Data (05) from Memory Location 2050 into A.
LDA 2052h // Load Data (03) from Memory Location 2052 into A.
CMP B // Compare Content of Accumulator (03) with Content of Register B (05) if Content of
MOV A, B // If Carry Flag is NOT SET to 1 then, Move Content of Register B (05) into Accumulator
MIN:
8
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Input:
Memory Value
Location
2051 05h
2052 03h
Output:
Memory Value
Location
3050 03h
Questions:
Q.1 Explain the two instructions (a) LDAX and (b) STAX
9
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Q.4 Explain the two instructions (a) RAR and (b) RRC
Teacher Signature
10
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 5
Aim: Write an 8085 assembly language program to get the minimum from block of N 8-bit
numbers.
Code:
LXI H, 2052h // Store Content (52) into L (Reg- L) and 20 into H (Register H)
LDA 2051h // Load Data (01) from Memory Location 2050 into A.
CMP B //Compare Content of Accumulator (01) with Content of Register B (06) If Content of
JC MIN // Whenever CY (Carry Flag) SET TO 1 Then Jump on Label Named MIN
MOV B.A // If CY not SET TO 1 Then Move Content of A (01) into Reg-B
DCR C // Decrement the Content of Register C (04) by 1, whenever Register C Has 00h Value
JNZ LOOP // It Jump on Label LOOP until Z (Zero Flag) is Not SET TO 1.
STA 3050h // Store Content of AC (01) which minimum from 5 8 bit number Stored at Memory
Location 3050.
Input:
Memory Value
Location
2051 01h
2052 06h
2054 03h
2055 02h
2056 04h
12
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Output:
Memory Value
Location
3050 01h
Questions:
Q.3 Explain the function of the two DMA signals HOLD and HLDA.
13
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Teacher Signature
14
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 6
Aim: Write an 8085 assembly language program to add block of 8-bit numbers.
Code:
LXI H,2050h // Move Data (20) into H (Register H) and Data (50) into L- Reg.
LOOP:
ADD M // Adds Content of M (Indicates Content of Memory Location Stored on HL Register Pair
JNZ LOOP // Jump on Label named LOOP until Zero Flag (Z) will not reset.
Input:
Output:
Questions:
16
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Q.3 Mention the different types of operations possible with arithmetic, logical, branch
instruction?
Teacher Signature
17
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 7
Aim: Write an 8085 ALP to find even and odd number from array and store them.
Code:
18
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
HLT // Stop
Input:
Memory
Location Value
2000 01h
2001 02h
2002 03h
2003 04h
Output:
Memory Memory
Location Value Location Value
2200 02h 2100 01h
2201 04h 2101 03h
19
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Questions:
Teacher Signature
20
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 8
Aim: Write an 8085 assembly language program to add two decimal numbers using DAA
instruction
Code:
DAA // Convert Content (0A- Hexadecimal) into 10 (Decimal), Store result (10) in Accumulator
DAA // Convert Content of Accumulator (0B- Hexadecimal) into 11 (Decimal), Store result (11)
in Accumulator
ADD B // Add Content of Register B (10) with Content of Accumulator (10), Result (21) Store in
Accmulator
Input:
Registers Value
A (Accumulator) 0Ah
B (Register B) 0Bh
21
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Output:
Registers Value
A (Accumulator) 21h
Questions:
22
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Q.4 Byte wise what are the lengths of CALL and RET instructions
Teacher Signature
23
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 9
Aim: Write an 8085 ALP to find even and odd number from array and store them.
Code:
HLT // Stop
Input:
Memory
Location Value
2000 01h
2001 02h
2002 03h
2003 04h
Output:
Memory Memory
Location Value Location Value
2200 02h 2100 01h
2201 04h 2101 03h
25
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Questions:
Q.1 Exchange the contents of DE register pair with that of HL register pair, usingPUSH, POP
instructions.
Q.2 Bring out the distinguishing features between memory mapped I/O scheme and I/O
mapped I/O scheme..
Teacher Signature
26
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 10
Aim: Write an 8085 Assembly Language Program (ALP) to find 1’s binary representation of a
given 8 bit number.
Code:
LDA 2050h // Load 0Ah data from Memory Location 2050 into A.
Input:
Memory Value
Location
2050h 0Ah
Output:
Memory Value
Location
3050h 08h
Questions:
Q.1 A semiconductor memory is specified as 4 K × 8. Indicate the number of words, word size
and total capacity of this memory.?
28
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Teacher Signature
29
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 11
Aim: Write an 8085 Assembly Language Program (ALP) to arrange an array of six data bytes in
an ascending order. An array of six data bytes is stored on Memory Location 5000 H onwards.
Code:
LXI H,5001
INX H
CMP M
Input:
Output:
31
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Questions:
Q.1 How the physical address is generated for the different memory addressing modes?
Q.4 How many instructions are there in the instruction set of 8086?
Teacher Signature
32
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 12
Aim: Write an 8085 Assembly Language Program (ALP) to find 2’s complement of a given 8 bit
number stored on Memory Location 8051 H and store the result (complimented number) on
Memory Location 8050 H.
Code:
INR A // Increase A by 1
Input:
Output:
33
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Questions:
Teacher Signature
34
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 13
Code:
LXI H,2050h // Move 20h 8 – bit data into Register H & 50h 8- bit data into Register L means initialize HL
LXI D,3054h // Move 30h 8 – bit data into Register D & 54h 8- bit data into Register E means initialize DE
JNZ LOOP // Jump on label named LOOP until Zero Flag will not SET TO 1.
MOV B, M // Move Content of memory location (2050) which stored inside HL register pair to Register
B.
MOV M, A // Move Content of Accumulator to memory location (2050) which stored inside HL register
pair.
STAX D // Store content of accumulator to memory location (3054) which stored inside DE register
pair.
36
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Input:
Memory
Values
Locations
2050 01h
2051 02h
2052 03h
2053 04h
2054 05h
Output:
Memory
Location Value
2050 05h
2051 04h
2052 03h
2053 02h
2054 01h
Questions:
37
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Teacher Signature
38
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 14
Aim: Write an 8085 Assembly Language Program (ALP) to multiply two numbers stored on
Memory Locations 8000 H and 8001 H and store the result on Memory Location 8050 H.
Code:
Input:
Output:
Questions:
Q.1 What pins are associated with Read/Write control logic block?
Q.2 Explain how the different ports and control words are selected for 8255.
40
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
Q.4 In how many interrupt modes can 8259 operate and which command word is
Utilized for this?.
Teacher Signature
41
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
PRACTICAL NO: 15
Code:
MOV B, A // Copy A to B
MOV C, A // Copy A to C
MOV A, B // Copy B to A
RRC
42
SPCE - BAKROL
MICROPROCESSOR AND INTERFACING
(3160712)
RRC
RRC
JNZ SUM
POP B // Restoring B
Input:
Output:
Teacher Signature
43
SPCE - BAKROL