8086 ASSEMBLY LEVEL CODE TO MULTIPLY TWO SINGLE DIGIT NUMBERS USING 'AAM' INSTRUCTION AND DISPLAY THE RESULT ON CONSOLE
DATA SEGMENT
MSG1 DB 10,13,'ENTER THE TWO NUMBERS:$'
MSG2 DB 10,13,'PRODUCT OF THE TWO NUMBER IS: $'
NEW DB 10,13,'$'
INST DB 4 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,01H
INT 21H
AND AL,0FH
MOV [SI],AL
INC SI
LEA DX,NEW
MOV AH,09H
INT 21H
LOOP UP
LEA SI,INST
MOV AX,0
MOV AL,[SI]
MOV BL,[SI+1]
MUL BL
AAM
ADD AH,30H
ADD AL,30H
MOV BX,AX
LEA DX,MSG2
MOV AH,09H
INT 21H
MOV DL,BH
MOV AH,02H
INT 21H
MOV DL,BL
MOV AH,02H
INT 21H
INT 3H
CODE ENDS
END START
END
Comments
Post a Comment