You are on page 1of 5

EXPERIMENT -5

AIM: Write a program to perform addition of 2 strings in 8086 Microprocessor.


REQUIREMENT:
8086 Microprocessor Emulator Software.
PROCEDURE:
• Open 8086 Emulator and click on new.
• Now choose the bn template.
• Write the code on assembler.
• After this, go to emulator option and click on the option assemble and load in emulator or
directly click on the option emulate.
• Now, a new window pops up in which you have to input the values in defines location.
• After inputting the values through extended value viewer click on the run option in the
emulator .
• Now, the Result/Output is available at the defined location.

Address Mnemonics Operands Comments


0000H CLC Clear/Reset carry

0001H MOV CX,0004H 0004H data is given to


CX.
0004H MOV SI,1300H
1300H data is given to SI.

0007H MOV DI,1308H 1308H data is given to


DI.

000AH AHEAD:MOV AX, [SI] Effective address SI is


given to AX .
000BH ADC [DI], AX AX is given to effective
address DI.

000CH INC SI Increment in the SI


register by 1.
000DH INC SI
Increment in the SI
register by 1.

1
000EH INC DI Increment in the DI
register by 1.
000FH INC DI
Increment in the DI
register by 1.
00010H DEC CX Decrement in the CX
counter by 1.
0011H JNZ AHEAD Jump if zero flag ZF=0.
0012H HLT End of Program.

ASSEMBLER

2
FLOWCHART START

Clear carry CF=0

Insert the value at counter CX

Insert the value at SI

Insert the value at DI

Effective address s given to AX

Addition is performed with carry

Increment operation is performed on SI and DI

CX counter is decremented until its value becomes 0

Jump operation is performed till the counter is not zero

STOP

3
OUTPUT:-

Before Execution After Execution

0500:1300 0500:1308 06308 -22H


06300 :11 06308 : 11 06309 -24H
06301 :12 06309 : 12 0630A -26H
06302 :13 0630A : 13 0630B –28H
06303 :14 0630B : 14 0630C -2AH
06304 :15 0630C : 15 0630D -2CH
06305 :16 0630D : 16 0630E –2EH
06306 :17 0630E : 17 0630F –30H
06307 :18 0630F : 18

4
Result:- Addition of 2 strings in 8086 has been completed successfully.

You might also like