org 100h

JMP MAIN
MSG1 DB "Enter a number to multiply from (0-9) : $"
MSG2 DB "Enter a number to multiply from (0-9) : $"
MSG3 DB "The Result is : $"
NUM1 DB ?
NUM2 DB ?
RESULT DB ?

MAIN:
CALL NEXTLINE

MOV AH, 09H
MOV DX, OFFSET MSG1
INT 21H

INPUT:
MOV AH, 01H
INT 21H

CMP AL, 30H
JL MAIN

CMP AL, 39H
JG MAIN

SUB AL,30H
MOV NUM1,AL

MAIN2:

CALL NEXTLINE

MOV AH, 09H
MOV DX, OFFSET MSG2
INT 21H
INPUT2:
MOV AH,01H
INT 21H

CMP AL, 30H
JL MAIN2

CMP AL, 39H
JG MAIN2

SUB AL,30H
MOV NUM2,AL

MUL NUM1

MOV RESULT,AL
AAM

ADD AH,30H
ADD AL,30H

MOV BX,AX

CALL NEXTLINE

MOV AH, 09H
MOV DX, OFFSET MSG3
INT 21H

MOV AH, 02h
MOV DL,BH
INT 21H

MOV AH, 02h
MOV DL,BL
INT 21H

MOV AH,4CH
INT 21H

NEXTLINE:

MOV AH, 02H
MOV DL, 0AH
INT 21H

MOV DL, 0DH
INT 21H

ret

Related Interests