MUL: Unsigned multiplication
==================================================
;Affect the OF and CF marking positions
;Instruction format:
;MUL r/m ;The parameter is a multiplier
;If the parameter is r8/m8, AL will be used as a multiplier, and the result will be placed in AX
;If the parameter is r16/m16, AX will be multiplied and the result will be placed in EAX
;If the parameter is r32/m32, EAX will be multiplied, and the result will be placed in EDX:EAX
When there is a significant number of the result in the high half of the product (AH, DX, EDX, RDX), then CF=OF=1, otherwise CF=OF=0.
=======================================================
IMUL: signed multiplication
=======================================================
;Affect the OF and CF marking positions
;The first instruction format:
;IMUL r/m ;Single operand
;If the parameter is r8/m8, AL will be used as a multiplier, and the result will be placed in AX
;If the parameter is r16/m16, AX will be multiplied and the result will be placed in EAX
;If the parameter is r32/m32, EAX will be multiplied, and the result will be placed in EDX:EAX
;The above are the same as MUL, but the calculation results are sometimes the same and sometimes different.
;IMUL has two other instruction formats:
;IMUL r16/r32, r16/r32/m16/m32/i ;Double operand, (1)*(2) -> (1)
;IMUL r16/r32, r16/r32/m16/m32, i ;Three operands, (2)*(3) -> (1)
;The number of digits of constant i can <= but not > other operands
=======================================================
Simple application
=================================================
imul edx, ebx ;edx=edx*ebx
imul edx, ebx,8 ;edx=ebx*8
1. The number of destinations is 16 or 32 registers
Two, operand lengths are equal
Three, three operands are the purpose, source, count immediately
4. Unlike single operands that do not overflow, overflow may occur.
That's a brief description...
The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.