Multiply two digits

Read two digits and print their product.

Input

One line with two digits a and b, written together (for example 78).

Output

a × b in decimal, without leading zeros.

Examples

Example 1 · Input
78
Expected output
56
Example 2 · Input
00
Expected output
0

Hints

Hint 1

Turn both keys into numbers, then MUL: with a byte operand the product is in AX.

Hint 2

AAM (or DIV by 10) splits the product into tens (AH) and ones (AL).

Hint 3

Print the tens digit only if it is not 0.

Solution

Show one correct solution (try it yourself first)
; Multiply two digits
.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC
    MOV AH, 1
    INT 21H
    SUB AL, '0'
    MOV BL, AL
    MOV AH, 1
    INT 21H
    SUB AL, '0'
    MUL BL              ; AX = a x b
    AAM                 ; AH = tens, AL = ones
    MOV BX, AX
    CMP BH, 0
    JE ONES             ; no leading zero
    MOV DL, BH
    ADD DL, '0'
    MOV AH, 2
    INT 21H
ONES:
    MOV DL, BL
    ADD DL, '0'
    MOV AH, 2
    INT 21H
    MOV AH, 4CH
    INT 21H
MAIN ENDP
END MAIN

Lesson: Multiplication and division →