Google Search

Sunday, October 30, 2011

ALP to add two 8-bit numbers


ALP to add two 8-bit numbers

DATA SEGMENT
NO1 DB 34H
NO2 DB 45H
DATA ENDS
CODE SEGMENT
            ASSUME CS:CODE,DS:DATA
            START:MOV AX,DATA
                          MOV DS,AX
                          MOV AL,NO1
                          MOV BL,NO2
                          ADD AL,BL
                          MOV DS:[2000H],AL
                          HLT
            CODE ENDS
            END START

RESULT:
            I/P : ALß34H                                                O/P: ALß79H
                    BLß45H                                                         [2000H]ß79H

0 comments:

Post a Comment