DATAREA SEGMENT
X DB 38H
Y DB 21H
RS DB 0
DATAREA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATAREA
START:MOV AX,DATAREA
MOV DS,AX
MOV AL,X
ADD AL,Y
MOV RS,AL
MOV AL,X
MOV CL,4
SHR AL,CL
ADD AL,30H
MOV DL,AL
CMP DL,39H
JLE P1
ADD DL,07H
P1: MOV AH,02H
INT 21H
MOV DL,X
AND DL,0FH
ADD DL,30H
CMP DL,39H
JLE P2
ADD DL,07H
P2: INT 21H
MOV DL,'+'
INT 21H
MOV AL,Y
MOV CL,4
SHR AL,CL
ADD AL,30H
MOV DL,AL
CMP DL,39H
JLE P3
ADD DL,07H
P3: MOV AH,02H
INT 21H
MOV DL,Y
AND DL,0FH
ADD DL,30H
CMP DL,39H
JLE P4
ADD DL,07H
P4: INT 21H
MOV DL,'='
INT 21H
MOV AL,RS
MOV CL,4
SHR AL,CL
ADD AL,30H
MOV DL,AL
CMP DL,39H
JLE P5
ADD DL,07H
P5: MOV AH,02H
INT 21H
MOV DL,RS
AND DL,0FH
ADD DL,30H
CMP DL,39H
JLE P6
ADD DL,07H
P6: INT 21H
MOV AH,4CH
INT 21H
code ends
end START