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

Experiment Title-1.

Student Name: Shivam Garg UID:20BCS3215


Branch: CSE Section/Group:20BCS618-B
Semester: fourth DateofPerformance:18February 2022
Subject Name: MICROPROCESSOR AND INTERFACING LAB
Subject Code: 22E-20CSP-253

1. Aim/Overview of the practical: Addition of two 8bit numbers, sum 8 bit.

2. Apparatus/Simulator used: JUBIN


3. Algorithm/Flowchart:
 Load the first number from memory location B124 to accumulator.
 Move the content of accumulator to register H.
 Load the second number from memory location B125 to accumulator.
 Then add the content of register H and accumulator using “ADD” instruction and storing
result at B125
 The carry generated is recovered using “ADC” command and is stored at memory
location B126

4. Description/ Code:

// ADDITION OF TWO 8 BIT NUMBERS


// Manually strore 1st no in the memory location B124
// Manually store 2nd no in the memory location B125
// Result is stored in B126
# BEGIN 0000H
LXI H,B124
MOV A,M
INX H
ADD M
STA B126
HLT
// EXAMPLE-> B124 = 30H, B125 =40H
// ANSWER -> B126 = BBH

# ORG B124
# DB 30H,40H

5. Result/Output/Writing Summary:

LDA B124 moves the contents of B124 memory location to the accumulator.

MOV H, A copies contents of Accumulator to register H to A

LDA B125 moves the contents of B125 memory location to the accumulator.

ADD H adds contents of A (Accumulator) and H register (F9). The result is stored in A
itself. For all arithmetic instructions A is by default an operand and A stores the result as
well

MOV L, A copies contents of A (34) to L

MVI A 00 moves immediate data (i.e., 00) to A

ADC A adds contents of A(00), contents of register specified (i.e A) and carry (1). As
ADC is also an arithmetic operation, A is by default an operand and A stores the result as
well

MOV H, A copies contents of A (01) to H


SHLD B124 moves the contents of L register (34) in B125 memory location and contents
of H register (01) in B126 memory location

HLT stops executing the program and halts any further execution

Learning outcomes (What I have learnt):

1.Various Commands of 8085 microprocessor

2.Adding two 8 bits number

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