Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Multibyte Addtion

suruthi2007suruthi2007 Posts: 1Member
Hi. The below program is multibyte addition program. Here am using ADC for addtion. But it did not add carry for large numbers. suppose adding 2 numbers like
E 1000 02 00
E 1002 AA AA AA AA
E 2000 FF FF FF FF
the ouptut will be 1AAAAAAA9

but while compile this program the output wil be
A9. AA. A9. AA. 00. 00. 00

Any one explain why the program did not add carry?is there any solution.....

ASSUME CS:CODE
CODE SEGMENT

MOV SI,1000H
MOV BX,2000H
MOV DI,2500H
MOV DL,00H
MOV CX,[SI]
ADD SI,02H

L: MOV AX,[SI]
ADC AX,[BX]
MOV [DI],AX
ADD BX,02H
ADD SI,02H
ADD DI,02H
LOOP L
JNC L1
INC DL

L1: MOV [DI],DL
MOV AH,4CH
INT 21H
CODE ENDS
END




Sign In or Register to comment.