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

Experiment No.

2
Name: Varun Thakur Uid:19bel1026
Subject name:
MICROPROCESSORS AND MICROCONTROLLER LABORATORY
Subject code: ELP-355
Date of Exp:24-02-2022 Date of Submission:24-02-2022

S.N Equipment Range QuanXt Type


. y of
instrument
(if
applicable)
1. 8085 IC -8085
Microprocessor
programming kit,
Instruc:on coding sheet.
2. AC supply 220 V single phase --
AC
Aim: .

Develop and execute a program using 8085 & Tes:mony for


A. Subtrac:on of two 8-Bit numbers & 16 bit numbers. (Display of
Borrow)

List of Equipment’s Used (with specifica:ons):

GNUN8085 Microprocessor soTware

Table 1: Equipment detail

3. Computers I3 Processor, 2 GB 20
RAM,40 GB Hard
Disk
PROGRAM:

Addre Mnemoni Operan Opcod Remar


ss cs d e ks

2000 LXI H, 21 Load H-L pair with address 3000H.


3000H

2001 00 Lower-order of 3000H.

2002 30 Higher-order of 3000H.

2003 MOV A, M 7E Move the 1st operand from memory to reg. A.

2004 INX H 23 Increment H-L pair.

2005 MOV B, M 46 Move the 2nd operand from memory to reg.


B.
2006 MVI C, 00H 0E Ini:alize reg. C with 00H.

2007 00 Immediate value 00H.

2008 SUB B 90 Subtract B from A.

2009 JNC 200D D2 Jump to address 200DH if there is no borrow.

200A 0D Lower-order of 200DH.

200B 20 Higher-order of 200DH.

200C INR C 0C Increment reg. C.

200D INX H 23 Increment H-L pair.

200E MOV M, A 77 Move the result from reg. A to memory.

200F INX H 23 Increment H-L pair.


2010 MOV M, C 71 Move borrows from reg. C to memory.

2011 HLT 76 Halt.

simulaXon

Observation:
INPU OUTPU
T T
3000 05 3002 02
H H
3001 03 3003 00
H H
B.SubtracXon of two 16-Bit Numbers. (Display of Borrow)
Memory Lab Mnemonic Hex Comment
address el s Cod s
e
850 MVI C,00 0E C = 00H
0
850 00
1
850 LHL 8000 2A L – 1st No.
2 D
850 00
3
850 80
4
850 XLH EB HL – DE
5 G
850 LHL 8002 2A HL – 2nd No.
6 D
850 02
7
850 80
8
850 MO A,E 7B LSB of ‘1’ to
9 V ‘A’
850 SUB L 95 A–A–L
A
850 STA 8004 32 A – memory
B
850 04
C
850 80
D
850 MO A,D 7A MSB of 1 to
E V A

850 SBB H 9C A- A – H
F
851 STA 800 32 A – memory
0 5
851 05
1
851 80
2
851 HLT 76 Stop
3 execu:on
Simulation part of 16 bit

Precautions:
Make sure that all the machine codes are entered correctly in the
microprocessor.

You might also like