Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

FORM NO.

GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 1 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

LIST OF EXPERIMENTS

1. STUDY ARCHITECTURE OF 8085 & FAMILIARIZATION WITH ITS HARDWARE,


COMMANDS & OPERATION OF MICROPROCESSOR KIT.
2. WRITE A WELL DOCUMENTED PROGRAM FOR :
(A) ADDITION OF TWO 8-BIT NO. (PROVISION FOR CARRY)
(B) ADDITION OF TWO 16-BIT NO.
3. WRITE A WELL DOCUMENTED PROGRAM FOR:
(A) SUBTRACTION OF TWO 8-BIT NO.
(B) SUBTRACTION OF TWO 16-BIT NO. (DISPLAY OF BARROW)
4. WRITE A WELL DOCUMENTED PROGRAM FOR : MULTIPLICATION OF TWO 8-BIT
NUMBERS BY REPEATED ADDITION METHOD.
5. WRITE A WELL DOCUMENTED PROGRAM FOR: MULTIPLICATION OF
TWO 8-BIT NUMBERS BY BIT ROTATION METHOD.
6. WRITE A WELL DOCUMENTED PROGRAM FOR: DIVISION OF TWO 16 -BIT NUMBERS
BY BIT ROTATION METHOD.
7. WRITE A WELL DOCUMENTED PROGRAM FOR: DIVISION OF TWO NUMBERS BY
REPEATED SUBTRACTION METHOD.
8. WRITE A WELL DOCUMENTED PROGRAM FOR FINDING A LARGEST NUMBER FROM
AN ARRAY.
9. WRITE A WELL DOCUMENTED PROGRAM FOR: 16 BIT ADDITION USING 8086 KIT.
10. WRITE A WELL DOCUMENTED PROGRAM FOR: FINDING SQUARE OF A NUMBER
USING LOOK-UP TABLE

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 2 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Aim
Study of 8085-microprocessor kit.
Apparatus
8085 microprocessor kit, Keyboard
Theory

Intel 8085 is an 8-bit microprocessor. It is 40-pin IC package fabricated on a single LSI chip. It
uses a single +5 V supply. Its clock speed is about 3 MHz. It consists of three main sections: -

1.ALU (Arithmetic and logic unit):-

The ALU performs the arithmetic and logical operation, addition, subtraction, logical AND, OR,
EX-OR, Complement, Increment, Decrement, shift, clear.
2.Timing and Control Unit:-

It generates timing and control signals, which are necessary for the execution of instruction.
3.Registers: -
These are used for temporary storage of data and instruction. INTEL 8085 has following
registers: -
i) One 8 bit accumulator
ii) Six 8 bit registers (B, C, D, E, H, L)
iii) One 16 bit stack pointer, SP
iv) One 16 bit program counter, PC
v) Instruction register
vi) Status register
vii) Temporary registers

PC contains the address of next instruction.


IR holds the instruction until it is decoded.
SP holds the address of the stack top.
Accumulator is used during execution of program for temporary storage of data.

Status flags are as follows: -


i) Carry (CS)
ii) Zero (Z)
iii) Sign (S)
iv) Parity (P)
v) Auxiliary Carry (AC)

PSW
This 8-bit program status word includes status flags and three undefined bits.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 3 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Data and Address bus


Data bus is 8- bit wide and 8 bits of data can be transmitted in parallel. It has 16-bit wide
address bus as the memory addresses are of 16 bits.
Circuit Diagram(Pin Diagram):-

36 12
RST-IN AD0 13
1 AD1 14
X1 AD2 15
AD3 16
2 AD4 17
X2 AD5 18
5 AD6 19
6 SID AD7 21
TRAP A8 22
9 A9 23
8 RST 5.5 A10 24
7 RST 6.5 A11 25
RST 7.5 A12 26
10 A13 27
INTR A14 28
11 A15
INTA 30
29 ALE 31
S0 WR 32
33 RD 34
S1 IO/M 3
39 RST-OT 37
HOLD CLKO 4
35 SOD 38
READY HLDA

Pin Configuration

A8-A15 (Output):-
These are address bus and used for the most significant bits of memory address.
AD0-AD7 (Input/Output):-
These are time multiplexed address data bus. These are used for the least significant 8 bits
of the memory address during first clock cycle and then for data during second and third
clock cycle
ALE (Address Latch Enable)
It goes high during the 1st clock cycle of a machine. It enables the lower 8 bits of address
to be latched either in the memory or external latch.
IO/M: It is status signal, when it goes high; the address on address bus is for I/O device, otherwise for
memory.
So, S1
These are status signals to distinguish various types of operation

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 4 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

S1 So Operation
0 0 Halt
0 1 Write
1 0 Read
1 1 Fetch
RD (output): It is used to control read operation.
WR (output): It is used to control write operation.
HOLD (input): It is used to indicate that another device is requesting the use of address & data bus.
HLDA (output): It is acknowledgement signal used to indicate HOLD request has been
received.
INTR (input): When it goes high, microprocessor suspends its normal sequence of operations.
INTA (output): It is interrupt acknowledgement signal sent by microprocessor after INTR is
received.
RST 5.5,6.5,7.5 and TRAP: These are various interrupt signals. Among them TRAP is having highest
priority
RESET IN (input)
It resets the PC to zero.
RESET OUT(output)
It indicates that CPU is being reset.
X1, X2 (input)
This circuitry is required to produce a suitable clock for the operation of
microprocessor. .

Clk (output)
It is clock output for user. Its frequency is same at which processor operates.
SID (input)
It is used for data line for serial input.
SOD (output)
It is used for data line for serial output.
Vcc
+5 volts supply
Vss
Ground reference

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 5 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 2(a)

Aim
Write a well-documented program using 8085 for addition of two 8-bit numbers.
Apparatus
8085 microprocessor kit, Keayboard
Theory (Program)
First, save the two numbers on 2201H & 2202H memory location then execute the following program.

MEMORY MACHINE MNEMONICS OPERANDS COMMANDS


ADDRESS CODE
2000 21,01,22 LXI H,2201 Get address of 1st
no. in HL pair
2003 7E MOV A,M Move Ist no. in
accumulator
2004 23 INX H HL points the
address 2202H
2005 86 ADD M Add the 2nd no.
2006 23 INX H HL points 2203H
2007 77 MOV M,A Store result in
2203H.
2008 76 HLT Terminate

Flow Chart:-

START

Get the first No.

Get the second No.

Add. Two numbers

Store the result

END

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 6 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Input Data 2201- BD


2202- 3E
Output Data
2203- ??
Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 7 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 2 (B)


AIM
Write a well document program using 8085 for addition of two 16-bit numbers.
APPARATUS
8085 microprocessor kit, Keyboard.
Theory (Program)

Memory Machine Mnemonics Operands Comments


Address Code
2000 2A, 01,22 LHLD 2201 H Enter the 16 bit address in HL
pair
2003 EB XCHG Exchange contents of HL pair
with DE pair
2004 2A, 03,22 LHLD 2203 H Enter the 16 bit address in HL
pair
2007 19 DAD D ADD the contents of DE pair
directly with HL pair
2008 22,05,22 SHLD 2205 H Store the result at 2205,2206 H.
2011 76 HLT Terminate

Flow Chart:- START

Get the lower byte of first No.

Get the lower byte of second No.

Add. Two lower bytes

Get the higher byte of first No.

Get the higher byte of second

Add. two higher bytes and carry


from the pervious solution

Store the result

END

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 8 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Input Data 2201- 2202-


2203- 2204-
Output Data
2205- 2206-
Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 9 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 3 (a)


Aim-
Write a well-documented program using 8085 for substraction of two 8-bit numbers.
Apparatus-
8085 microprocessor kit, Keyboard.
Theory(Program)-

Memory Opcode Mnemonics Operands Comments


address
2000 21,01,22 LXI H, 2201 Get address of
ist no. in HL
pair
2003 7E MOV A, M Move Ist no. in
accumulator
2004 23 INX H HL points
2202H.
2005 96 SUB M Substract 2nd
no. from Ist no.
2006 23 INX H HL points 2203
H.
2007 77 MOV M, A Move contents
of acc. to
memory
2008 76 HLT Stop

Flow Chart :- START

Get the first No.

Get the second No.

Subtract second number


from first number

Store the result

END
PREPARED BY: BALVINDER PANWAR APPROVED BY:
FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 10 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Input Data 2201-


2202-
Output Data
2203-
Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 11 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 3 (b)

Aim
Write a program using 8085 for subtraction of two 16-bit numbers.
Apparatus
8085 microprocessor kit, Keyboard.
Theory (Program)

Memory Machine Mnemonics Operands Comments


Address Code
2000 2A, 01,22 LHLD 2201 H Get 1st 16 bit no. in HL pair
2003 EB XCHG Exchange HL pair with DE.
2004 2A, 03,22 LHLD 2203 H Get 2nd 16 bit no. in HL pair
2007 7B MOV A, E Get lower byte of ist no.
2008 95 SUB L Subtract lower byte of 2nd no.
2009 6F MOV L, A Store the result in reg. L
200A 7A MOV A, D Get higher byte of Ist no.
200B 96 SBB H Subtract higher byte of 2nd no. with
borrow
200C 67 MOV H,A Move from acc. To H
200D,E, F 22,05,22 SHLD 2205H Store 16 bit result at 2205&2206
2010 76 HLT Terminate

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 12 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Flow Chart :-

START

Get the lower byte of first No.

Get the lower byte of second No.

Sub. lower byte of second No.


from lower byte of first No.

Get the higher byte of first No.

Get the higher byte of second

Sub. higher byte of second No. and


borrow from the pervious sub.

Store the result

END

Input Data 2201- 2202-


2203- 2204-
Output Data
2205- 2206-
Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 13 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 4
Aim
Write a program using 8085 for multiplication of two 8-bit numbers by repeated addition method.
Apparatus
8085 microprocessor kit, Keyboard.

Theory (Program)

Memory Machine Code Mnemonics Operands Comments


Address
2000 0E,10 MVI C, No. 1 Move the 1st no. in
reg. C
2002 1E,20 MVI E, No. 2 Move the 2nd no. in
reg. E
2004 06,00 MVI B, 00 Clear the reg. B
2006 21,00,00 LXI H,0000 Initialize HL pair
with 0000H
2009 UP1: 09 DAD B HL+BC=>HL
200A 1D DCR E Decrement reg. E
200B C2,09,70 JNZ UP1 Jump if not zero to
location up1
200E 76 HLT Terminate

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 14 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Flow Chart:-

START

Get the first No. in reg. C

Get the second No. in reg. E (Counter)

Initial Product in HL =0000

Add first No. in initial Product

NO
Is Counter
in reg. E=0

YES
Store Product in HL pair

END

Input Data

Reg.C= No.1(8-bit)
Reg.E= No.2 (8-bit)

Output Data
H-L=

Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 15 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 5

Aim
Write a program using 8085 for multiplication of two 8 bit numbers by bit -rotation method.

Apparatus
8085 microprocessor kit, Keyboard.

Theory(Program)

Memory Machine Mnemonics Operands Comments


Address Code
2000 2A,01,22 LHLD 2201 H Get Multiplicand
in H-L pair.
2003 EB XCHG Exchange HL pair
with DE pair
2004 3A,03,22 LDA 2203 H Get 2nd no. in acc.
2007 21,00,00 LXI H,0000 Initial product in
HL=00
200A 0E,08 MVI C,08H Count=08 in reg .C
200C 29 :Loop DAD H Shift partial product
left by 1 bit
200D 17 RAL Rotate multiplication
by 1 bit. Is multiplier
= 1?
200E D2,12,20 JNC Ahead No, go to ahead
2011 19 DAD D Product=Product +
Multiplicand
2012Ahead 0D DCR C Decrement Count
2013 C2,0C,20 JNZ Loop No, go to loop.
2016 22,04,22 SHLD 2204 Store result
2019 76 HLT Terminate

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 16 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Flow Chart:-
START

Get Multiplicand, Get Multiplier

Initial value of Product = 00


Count =08

Shift Product left one Bit


Shift Multiplier left one Bit

NO IS
Carry from
Multiplier?

YES

Product = Product + Multiplicand

Count = Count - 1

NO IS
Count =0?

YES
Store Product

END

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 17 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Input Data 2201-


2202-
2203-
Output Data
2204-
2205-
Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 18 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

EXPERIMENT No. 6

Aim
Write a program using 8085 to find square of a number from look –up method.
Apparatus
8085 microprocessor kit, Keyboard.
Theory (Program)

Memory Machine Code Mnemonics Operands Comments


Address
2000 3A,00,22 LDA 2200 H Get 1st no. in
acc.
2003 6F MOV L,A Move From A
into reg. L
2004 26,26 MVI H,26H Get 26 in reg H
2006 7E MOV A,M Square of data
in accumulator
2007 32,01,22 STA 2201 H Store square in
2201 H.
200A 76 HLT Terminate

Look-Up table
Address Square
2600 - 00
2601 - 01
2602 - 04
2603 - 09
2604 - 16
2605 - 25
2606 - 36
2607 - 49
2608 - 64
2609 - 81

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 19 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Circuit Diagram / Block Diagram:-

PREPARED BY: BALVINDER PANWAR APPROVED BY:


FORM NO. GCE-FRM-36
GURGAON COLLEGE OF ENGINEERING
LABORATORY MANUAL
EXPERIMENT NO. : ISSUE NO.: 00 ISSUE DATE :
REV. NO. : 00 REV. DATE: - 00 PAGE: 20 of 33
DEPTT. : ECE LABORATORY: MPI SEMESTER: 5th

Input Data 2200-

Output Data
2201-

Precautions:-

Make sure that all the machine codes should be as per specified in the program.

PREPARED BY: BALVINDER PANWAR APPROVED BY:

You might also like