ALP to add two 16-bit numbers - Code

Latest

programs

Sunday, October 30, 2011

ALP to add two 16-bit numbers


ALP to add two 16-bit numbers

DATA SEGMENT
NO1 DW 05A0H
NO2 DW 7050H
DATA ENDS
CODE SEGMENT
            ASSUME CS:CODE,DS:DATA
            START:MOV AX,DATA
                          MOV DS,AX
                          MOV AX,NO1
                          MOV BX,NO2
                          ADD AX,BX
                          MOV DS:[2000H],AX
                          HLT
            CODE ENDS
            END START


RESULT:
            I/P : AXß05A0H                                          O/P: AXß75F0HH
                    BXß7050H                                                    [2000H]ßF0H
                                                                                             [2001H]ß75H

No comments:

Post a Comment