The MUL instruction
Unsigned multiplication.
Format of the MUL instruction
| Instruction | Description |
|---|---|
| MUL reg/mem8 | Unsigned multiplication (AX := AL ∗ reg/mem8). |
| MUL reg/mem16 | Unsigned multiplication (DX:AX := AX ∗ reg/mem16). |
Performs unsigned multiplication of the first operand (the destination operand) and the second operand (the source operand) and stores the result in the destination operand. The destination operand is an implied operand located in the al or ax register (depending on the operand size); the source operand is in a general-purpose register or in a memory location.
The result is stored in the ax register or in the register pair dx:ax (depending on the operand size), with the high-order bits of the product contained in the ah or dx registers respectively. If the high-order bits of the product are 0, the CF and OF flags are cleared; otherwise the flags are set.
Usage example
title .model small .stack 100h code segment public ; Start of the code segment assume cs:code main proc ; Start of the main procedure mov ax, 35 ; Copy the value 35 into the ax register mov bx, 69 ; Copy the value 69 into the bx register mul bx ; Perform unsigned multiplication of ax by bx mov ax, 4C00h ; Copy the process termination function number into ah and the value into al int 21h ; Call the interrupt main endp ; End of the main procedure code ends ; End of the code segment end main ; End of file. The main procedure is the entry point
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".