20BCS7550 Yash Gautam Exp2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Experiment 2: Addition of two 16-bit numbers

Student Name: Yash Gautam UID: 20BCS7550


Branch: CSE Section/Group: 718 B
Semester: 4th Date of Performance:18/02/2022
Subject Name: MPI Lab Subject Code:20CSP-153

1. Aim/Overview of the practical: Write a program to add two 16-bit numbers.

2. Task to be done: We have to write a program to show addition of two 16-bit numbers in
Jubin 8085 simulator.

3. Apparatus/Simulator used (For applied/experimental sciences/materials based labs):


 Jubin 8085 Simulator
 Java Language

4. Algorithm/Flowchart (For programming based labs):


 Point HL pair with address 7000H.
 Define the value in address 1000, 1001, 1002 and 1003 using DB command.
 Exchange HL pair with DE pair.
 Add HL+DE in HL.
 Jump to LABEL if carry=0.
 Increment C if carry=1 and copy C into A.
 Store value of A at 1202H.
 Store the resultant value of HL at 1200H.

5. Description/ Code:
#ORG 7000H

LHLD 1000H //H=68H, L=55H

XCHG // DE exchange with HL

LHLD 1002H //H=63H, L=ABH

DAD D // HL+DE IN HL

JNC LABEL// jump to label if carry=0

INR C
MOV A, C//C=A=1

STA 1202H

LABEL:SHLD 1200H

HLT

#ORG 1000H
#DB 50H,50H,50H,50H

6. Result/Output/Writing Summary:

 Coding part:
 Assembling starts:

 Assembling ends:
 Memory allocation:
Learning outcomes (What I have learnt):

1. Learnt LHLD command.

2. Learnt XCHG command.

3. Leant DAD command.

4. Learnt STA command.

5. Learnt basic programming in Jubin Simulator.

Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):

Sr. No. Parameters Marks Obtained Maximum Marks


1.
2.
3.

You might also like