0% found this document useful (0 votes)
41 views20 pages

Microprocessor Lab (Ece & Eie) 4th Sem

The document is a laboratory manual for B.Tech 4th semester students focusing on microprocessors and interfacing, specifically the 8085 microprocessor. It outlines various experiments including addition, subtraction, multiplication, and division of 8-bit and 16-bit numbers using assembly language programming. Each experiment includes aims, required apparatus, assembly code, input/output addresses, and expected results.

Uploaded by

u36726936
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)
41 views20 pages

Microprocessor Lab (Ece & Eie) 4th Sem

The document is a laboratory manual for B.Tech 4th semester students focusing on microprocessors and interfacing, specifically the 8085 microprocessor. It outlines various experiments including addition, subtraction, multiplication, and division of 8-bit and 16-bit numbers using assembly language programming. Each experiment includes aims, required apparatus, assembly code, input/output addresses, and expected results.

Uploaded by

u36726936
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/ 20

LABORATORY MANNUAL

Microprocessors and Interfacing


B.Tech 4th Semester
(E.C.E and E.I.E)
Content
Sr. No. Experiment Page No. Remarks

1 Introduction to 8085 Microprocessor

2 Addition of 2 - 8 bit numbers

3 Subtraction of 2 - 8 bit numbers

4 Addition of 2 - 16 bit numbers

5 Subtraction of 2 – 16 bit numbers

6 Multiplication of 2 - 8 numbers

7 Division of 2 - 8 bit numbers

8 Multiplication of 2 - 16 bit numbers

9 Division of 2 - 16 bit numbers


Experiment-1
Aim: Introduction to 8085 Microprocessor.

Architecture of 8085 Microprocessor

Write features and details of internal architecture


Draw pin diagram:

Provide Pin Description:


Experiment-2
Aim: To write an assembly language for adding two 8 bit numbers.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based) or Kit.

Address Label Mnemonics Hex Code Comments

2100 MVI C,00 OE, 00 Initialize the carry as zero

2102 LDA 2300 3A, (00, 23) Load the first 8 bit data

2105 MOV, B,A 47 Copy the value of 8 bit data into


register B

2106 LDA 2301 3A, (01, 23) Load the second 8 bit data into
the accumulator

2109 ADD B 80 Add the two

210A JNC D2, 0E, 21 Jump on if no carry

210D INR C OC If carry is there increment it by


one

210E Loop STA 2302 32 (02, 23) Store the added value in the
accumulator at 2302

2111 MOV A,C 79 Move the value of carry to the


accumulator from

register C

2112 STA 2303 32 (03, 23) Store the value of carry in the
accumulator at 2303

2115 HLT 76 Stop the program execution


Input Without carry

Input Address Value

2300 04

2301 02

Output

Output Address Value

2302 06

2303 00 (carry)

With carry

Input Address Value

2300 FF

2301 FF

Output Address Value

2302 FE

2303 01 (carry)

Result:
Experiment-3
Aim: To write an assembly language program for subtracting 2, 8-bit numbers.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based) or Kit.

Address Label Mnemonics Hex Code Comments


2100 MVI C,00 OE, 00 Initialize the carry as zero
2102 LDA 2300 3A, (00, 23) Load the first 8 bit data into the
accumulator
2105 MOV, B,A 47 Copy the value into register B‟
2106 LDA 2301 3A, (01, 23) Load the 2nd 8 bit data into the
accumulator
2109 SUB B 90 Subtract both the values
210A JNC D2, 0E, 21 Jump on if no borrow
210D INR C OC If borrow is there, increment it by
one
210E Loop CMA 2F Compliment of 2nd data
210F ADI, 01 06, 01 Add one to 1‟scompliment of
2nd data
2111 STA 2302 32,02,23 Store the result in accumulator at
2302
2114 MOV A,C 79 Move the value of borrow into the
accumulator
2115 STA 2303 32,03,23 Store the result in accumulator at
2303
2118 HLT 76 Stop Program execution

Input Without borrow

Input Address Value

2300 05

2301 07

Output

Output Address Value

2302 02

2303 00 (borrow)
With carry borrow

Input Address Value

2300 07

2301 05

Output Address Value

2302 02

2303 01 (borrow)

Result:
Experiment-4
Aim: To write an assembly language for adding two 16 bit numbers.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based) or Kit.

Address Label Mnemonics Hex Code Comments


2500 MVI C,00 0E C = 00H
2501 00
2502 LHLD 2800 2A HL – 1st No.
2503 00
2504 28
2505 XCHG EB HL – DE
2506 LHLD 2802 2A HL – 2nd No.
2507 02
2508 28
2509 DAD D 19 Double addition DE +
HL
250A JNC Ahead D2 If Cy = 0, G0 to 250E
250E
250B 0E
250C 25
250D INR C 0C C = C + 01
250E AHEAD SHLD 2804 22 HL – 2804 (sum)
250F 04
2510 28
2511 MOV C,A 79 Cy – A
2512 STA 2806 32 Cy – 4806
2513 06
2514 28
2515 HLT 76 Stop execution

Input Without carry

Input Address Value

2800 01 (addend)

2801 04

2802 02 (augends)

2803 03 (augends)
Output

Output Address Value

2804 03 (sum)

2805 07 (sum)

2806 00 (carry)

With carry

Input Address Value

2800 FF (addend)

2801 DE (addend)

2802 96 (augends)

2803 DF (augends)

Output Address Value

2804 95 (sum)

2805 BE (sum)

2806 01 (carry)

Result:
Experiment-5
Aim: To write an assembly language program for subtracting two 16 bit numbers.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based) or Kit.

Address Label Mnemonics Hex Code Comments


2500 MVI C,00 0E C = 00
2501 00
2502 LHLD 2800 2A L – 1st No.
2503 00
2504 28
2505 XCHG EB HL – DE
2506 LHLD 2802 2A HL – 2nd No.
2507 02
2508 28
2509 MOV A,E 7B LSB of „1‟ to „A‟
250A SUB L 95 A–A–L
250B STA 2804 32 A – memory
250C 04
250D 28
250E MOV A,D 7A MSB of 1 to A
250F SBB H 9C A- A – H
2510 STA 2805 32 A – memory
2511 05
2512 28
2513 HLT 76 Stop execution

Input Without borrow

Input Address Value

2800 07

2801 08

2802 05

2803 06
Output

Output Address Value

2804 02

2805 02

2807 00

With borrow
Input Address Value
2800 05
2801 06
2802 07
2803 08

Output Address Value


2804 02
2805 02
2806 01

Result:
Experiment-6
Aim: To write an assembly language for multiplying two 8 bit numbers.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based) or Kit.

Address Label Mnemonics Hex Code Comments

2100 LDA 2500 3A, 00, 25 Load the first 8 bit number

2103 MOV B,A 47 Move the 1st 8 bit data to register


„B‟

2104 LDA 2501 3A, 01, 25 Load the 2nd 16 it number

2107 MOV C,A 4F Move the 2nd 8 bit data to register


„C‟

2108 MVI A, 00 3E, 00 Initialize the accumulator as zero

210A MVI D, 00 16, 00 Initialize the carry as zero

210C ADD B 80 Add the contents of „B‟ and


accumulator

210D JNC D2 11, 21 Jump if no carry

2110 INR D 14 Increment carry if there is

2111 DCR C OD Decrement the value „C‟

2112 JNZ C2 0C, 21 Jump if number zero

2115 STA 2502 32 02, 25 Store the result in


accumulator at 2502 location

2118 MOV A,D 7A Move the carry into


accumulator

2119 STA 2503 32,03,25 Store the result in


accumulator at 2503 location

211C HLT 76 Stop the program execution


Input

Input Address Value

2500 04

2501 02

Output

Output Address Value

2502 08

2503 00

Result:
Experiment-7
Aim: To write an assembly language program for dividing two 8 bit numbers.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based)

Address Label Mnemonics Hex Code Comments


2100 MVI C, 00 0E, 00 Initialize Quotient as zero
2102 LDA, 2500 3A 00, 25 Get the 1st data
2105 MOV B,A 47 Copy the 1st data into
register B
2106 LDA, 2501 3A 01, 25 Get the 2nd data
2109 CMP B B8 Compare the 2 values
210A JC (LDP) DA 12,21 Jump if dividend lesser than
divisor
210D Loop 2 SUB B 90 Subtract the 1st value by 2nd
value
210E INR C 0C Increment Quotient (410D)
210F JMP (LDP, 21) C3, 0D, 21 Jump to Loop 1 till the value of
dividend becomes zero
2112 Loop 1 STA 2502 32 02,25 Store the value in
accumulator
2115 MOV A,C 79 Move the value of remainder to
accumulator
2116 STA 2503 32 03,25 Store the remainder value in
accumulator
2119 HLT 76 Stop the program execution

Input
Input Address Value
2500 09
2501 02
Output

Output Address Value


2502 04 (quotient)
2503 01 (reminder)

Result:
Experiment-8
Aim: To write an assembly language program for 16 bit multiplication.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based)

Memory Hex Code Label Mnemonics Comments


Location Op code Operand

2100 2A,00,22 LHLD 2200 Get the 1st data in HL


2103 F9 SP HL Save it in stack
pointer 4106
2106 2A,02,22 LHLD 2202 Get the 2nd data in HL
2107 EB XCHG Exchange HL and
DC
2108 21,00,00 LXI H 0000 Make HL – 0000
210B 01,00,00 LXI B 0000 Make BC – 0000
210E 39 Next DAD SP Add SP and HL
210F D2, 13, 21 JNC Loop Jump to loop if no carry

2112 03 INX B Increment BCby one


2113 1B Loop DCX D Decrement DE by
one
2114 7B MOV A,E Make E – A
2115 B2 ORA D OR gate between A & D

2116 C2,0E,21 JNZ Next Jump on if number


zero
2119 22,04,22 SHLD 2204 Store the LSB in
memory
211C 69 MOV L,C Make C to L
211D 60 MOV H,B Make B to H
211E 22,06,22 SHLD 2206 Store the MSB in
memory
2121 76 HLT Stop the program

Input
Input Address Value
2200 04
2201 07
2202 02
2203 01
Output
Output Address Value
4204 08
2205 12
2206 01
2207 00
Result:
Experiment-9
Aim: To write an assembly language program for 16 bit division.

Apparatus required:

Any open source 8085 simulator (Windows, Linux or android OS based)

Address Label Mnemonics Hex Code Comments


2500 LXI B,0000 0,00,00 Initialize Quotient as 0000
2503 LHLD 2802 2A,02,28 Load the divisor in HL
2506 XCHG EB Exchange HL and DE
2507 LHLD 2800 2A,00,28 Load the dividend
250A Loop 2 MOV A,L 7D Move the Lvalue to A
250B SUB E 93 (A-E) – A
250C MOV L,A 6F A- L (A value is move t L)
250D MOV A,H 7C H – A (a is stored with H)
250E SBB D 9A Subtract D from A
250F MOV H,A 67 Then A is moved to H
2510 JC loop 1 DA,17,25 If cy is present go to loop 1
2513 INX B 03 Increment BC pair by 1
2514 JMP loop 2 C3, 0A, 25 Jump to loop 2
2517 Loop 1 DAD “D” 19 DE and HL pair all added
2518 SHLD 2806 22,06,28 HL is stored in memory
251B MOV L,C 69 Move Cregister data to L
251C MOV H,B 60 Move Bregister data to H

251D SHLD 2804 22,04,28 Store the result in HLpair


2520 HLT 76 Stop the program

Input
Input Address Value
2800 04
2801 00
2802 02
2803 00
Output

Output Address Value


2804 02
2805 00
2806 FE
2807 FF
Result:

You might also like