8086 ASSEMBLY LEVEL PROGRAM TO ADD TWO ONE DIGIT NUMBER USING 'AAA' INSTRUCTION

;;LAB 7A
DATA SEGMENT
MSG1 DB 10,13,'ENTER THE TWO NUMBERS: $'
MSG2 DB 10,13,'RESULT IS: $'
NEW DB 10,13,'$'
INST DB 5 DUP(0)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,09H
INT 21H
LEA DX,NEW
MOV AH,09H
INT 21H
LEA SI,INST
MOV CX,02
UP:
MOV AH,01
INT 21H
MOV [SI],AL
INC SI
LEA DX,NEW
MOV AH,09H
INT 21H
LOOP UP
MOV AX,0
LEA SI,INST
MOV AL,[SI]
MOV BL,[SI+1]
ADD AL,BL
AAA
MOV BX,AX              
LEA DX,MSG2
MOV AH,09H
INT 21H
ADD BL,30H
ADD BH,30H
MOV DL,BH
MOV AH,02H
INT 21H
MOV DL,BL
MOV AH,02H
INT 21H
INT 3
CODE ENDS
END START
END

Comments