Experiment No 5: Aim Apparatus: Theory
Experiment No 5: Aim Apparatus: Theory
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:
Srishti sabharwal
16BEC1032