Experiment - 3
Student Name: Harpreet UID: 20BCS2568
Branch: CSE Section/Group: 612-B
Semester: 4 Date of Performance: 3-Mar-2021
Subject Code: 22E-20CSP-253
Subject Name: Microprocessor and Interfacing Lab
1.Aim/Overview of the practical:
a) Subtraction of two 8 bit numbers along with considering borrow
b) Subtraction of two 16 bit numbers along with considering borrow
2. Task to be done:
We have to do the subtraction of 8 bit and 16 bit number with the help of Jublin Application.
3.Apparatus/Simulator used :
1. Jubin Application
2. 8085 Simulator
3. JDK
4.Algorithm/Flowchart
A)
1. Load the data into the accumulator
2. Load the data into another register.
3. Subtract the another register from accumulator
4. Check for carrying.
5. If carry is present take 2’s complement of Accumulator.
6. Store the value of borrow in a memory location.
7. Store the difference value (present in Accumulator) to a memory location
8. Terminate the program.
B.)
1. Initialize the MSBs of difference to 0
2. Get the first number.
3. Subtract the second number from the first number.
4. If there is any borrow, increment MSBs of difference by 1.
5. Store LSBs of difference
6. Store MSBs of difference.
5. DESCRIPTION/CODE
a)
MVI C, 00
LDA 4150
MOV B, A
LDA 4151
SUB B
JNC LOOP
CMA
INR A
INR C
LOOP: STA 4152
MOV A, C
STA 4153
HLT
b)
MVI C,00H
LHLD 5500H
XCHG
LHLD 5502
MOV A,E
SUB L
JNC LOOP 1
CMA
INR A
LOOP 1 STA 5900
MOV A,D
SUB
JNC LOOP 2
CMA
INR A
INC C
LOOP 2 STA 5901H
MOV A,C
STA 5902
HLT
6.Result/Output/Writing Summary:
A)
Learning outcomes (What I have learnt):
1. Working of microprocessors.
2. Learn how to do mathematical operations in microprocessors.
3. Learn about 8085 simulator.
4. Operations of 8 bit numbers as well as 16 bit numbers.
5. Learn about the different instructions that are needed to be given to the memory
to perform some tasks.