October 2018
Beginner to intermediate
436 pages
9h 36m
English
MUL is used for multiplication and DIV for division. In multiplication, we expect that multiplying values would exceed the capacity of the register value. Hence the product is stored in AX, DX:AX or EDX:EAX (long or QWORD):
mov eax, 0x80000000mov ecx, 2mul ecx
The product stored in eax is zero (0), and edx now contains 0x00000001. SF =0; CF = 1; and OF = 1.
For division, the dividend is placed in AX, DX:AX, or EDX:EAX, and after the division operation, the quotient is placed in AL, AX, or EAX. The remainder is stored in AH, DX, or EDX.
Read now
Unlock full access