Add Two Numbers in Assembly Language


Write and run a program using 8086 assembly language that adds two single digit ASCII digits stored in two consecutive memory locations. The result must be moved to DL register. [June 2015, Set-2]

DATA SEGMENT
    NUM1 DB ‘2’ ; 
    NUM2 DB ‘5’ ;
DATA ENDS

CODE SEGMENT
START:

    ASSUME CS:CODE, DS:DATA 
    MOV AX, DATA
    MOV DS, AX

    MOV AL, NUM1
    ADD AL, NUM2  
    MOV DL, AL
    
    MOV AX, 4C00H
    INT 21H    
CODE ENDS

END START