IA-32 Assembly Language Reference Manual

Unsigned Multiplication of AL, AX or EAX(mul)

mul{bwl} 	r/m[8|16|32]
Operation

r/m8 x AL -> AX

r/m16 x AX -> DX:AX

r/m32 x EAX -> EDX:EAX

Description

mul executes a unsigned multiply of a byte, word, or long by the contents of the AL, AX, or EAX register and stores the product in the AX, DX:AX or EDX:EAX register respectively.

mul clears the overflow and carry flags under the following conditions:

Table 2-6 Clearing OF and CF Flags -- mul

Instruction Form  

Condition for Clearing OF and CF 

r/m8 x AL -> AX 

clear to 0 if AH is 0; otherwise, set to 1  

r/m16 x AX -> DX:AX  

clear to 0 if DX is 0; otherwise, set to 1  

r/m32 x EAX -> EDX:EAX 

clear to 0 if EDX is 0; otherwise, set to 1  

Example

Perform an 8-bit unsigned multiply of the AL register and the contents of the effective address (addressed by the ESI register plus an offset of 1):

mulb 1(%esi)

Perform a 16-bit unsigned multiply of the AL register and the contents of the effective address (addressed by the EDI register plus an offset of 4):

mulw 4(%edi)

Perform a 32-bit unsigned multiply of the AL register and the contents of the effective address (addressed by the EDI register plus an offset of 1):

mull 1(%edi)