I wanted to write a program that adds two Numbers and show the result in Decimal form, initially it was looking a piece of cake but as it turned out, it wasn't !!! because there is just 0-9 characters in decimal and when we want to add any number greater than those we've to perform some mathematics,
Here is what i've done, I wanted to add two numbers 35 and 39,
35 + 39 = 74
MOV BL,35H
MOV AL,39H
ADD AL,BL
DAA ;Decimal after Addition => the result of it would be 0074H
PUSH AX ;PRESERVE 0074H
; Separating the two numbers
AND AL,00001111B ; AL => 0000 0100
ADD AL,30H ; ; AL => 0004H + 30H = 4 of Decimal
POP AX ;AX = 74H => 01110100
ROR AL,1
ROR AL,1
ROR AL,1
ROR AL,1
AND AL,00001111B ;AL => 0000 0111
ADD Al,30H ;A: => 0007H + 30H = 7 of Decimal
MOV DL,AL
MOV AH,4CH ;Return Control to the DOS
INT 21H
I recovered both the numbers but now how to show the result as '74' ???
Also , this method is so time consuming, is there any better and more efficient way to do this ?