ALP to subtract two 16-bit numbers - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Sunday, October 30, 2011

ALP to subtract two 16-bit numbers


ALP to subtract two 16-bit numbers

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

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

No comments:

Post a Comment