0% found this document useful (0 votes)
99 views3 pages

Experiment No 5: Aim Apparatus: Theory

The document describes an experiment using an 8085 microprocessor simulator to subtract 16-bit numbers with borrow. It loads the operands from addresses 4000h and 4002h into registers, performs subtraction operations using SUB and SBB instructions, and stores the result back to address 4004h. Key steps include exchanging register values using XCHG, copying between registers using MOV, and conditionally jumping with JNC based on the carry flag.

Uploaded by

Jaspreet Kaur
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)
99 views3 pages

Experiment No 5: Aim Apparatus: Theory

The document describes an experiment using an 8085 microprocessor simulator to subtract 16-bit numbers with borrow. It loads the operands from addresses 4000h and 4002h into registers, performs subtraction operations using SUB and SBB instructions, and stores the result back to address 4004h. Key steps include exchanging register values using XCHG, copying between registers using MOV, and conditionally jumping with JNC based on the carry flag.

Uploaded by

Jaspreet Kaur
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/ 3

DEPARTMENT OF ELECTRONICS AND COMM.

ENGG

Experiment no 5
Aim : To subtract 16 bits number with borrow using 8085 microprocessor
software kit.
Apparatus: Microprocessor 8085 simulator software kit 1.
Theory:
SUB instruction: subtract the contents of register to accumulator.
REGISTERS: Six of the register can be used to hold 16 bit quantities. These pairs
are BC, DE, HL where B ,D,H hold the MSB of the value and C,E,L hold the LSB
respectively.
CARRY FLAG: it is a single bit in a system status (flag) register used to indicate
when an arithmetic carry or borrow has been generated out of the most significant
ALU bit position.
JNC: (conditional jump) The program sequence is transferred to particular level or
a 16-bit address if C=0(or carry is 0).
Procedure:
1.Open Microprocessor 8085 simulator software kit 1.0.
2.Typed the program.
3.Simulate and run the program.
4.In the address block we mentioned the addresses for the first operand (4000) for
second (4002), and for result in (4004).
5. We wrote the value of first of second operand and stimulate again to get the
result.
Srishti sabharwal
16BEC1032
7. Observation table was drawn.
Address Mnemonics operands opcode bytes comments
8000 LHLD 4000h 2A 3 Load H and
8001 00 L register
8002 40 direclty
8003 XCHG ----------- EB 1 Exchange H
and L with
D and E.
8004 LHLD 4002h 2A 3 Load H and
8005 02 L register
8006 40 direclty
8007 MOV AE 7B 1 Copy from
source to
destination
8008 SUB L 95 1 Subtract
regiter to
accumulator
8009 MOV LA 6F 1 Copy from
source to
destination
800A MOV AD 7A 1 Copy from
source to
destination
800B SBB H 9C 1 Subtract
register to
accumulator
using
borrow
800C MOV HA 67 1 Copy from
source to
destination
800D SHLD 4004h 22 3 Store H and
800E 04 L register
800F 40 directly
8010 HLT ----------- 76 1 halt

Srishti sabharwal
16BEC1032
output:

Result: address data (hexadecimal)


4000 2A
4002 4D

Srishti sabharwal
16BEC1032

You might also like