What is the format of the MUL instruction
Most people don't understand the knowledge points of this article "What are the formats of MUL instructions", so Xiaobian summarizes the following contents for everyone. The contents are detailed, the steps are clear, and they have certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "What are the formats of MUL instructions".
The MUL(unsigned multiply) instruction has three formats: The first is to multiply an 8-bit operand by al. The second is to multiply a 16-bit operand by ax; the third is to multiply a 32-bit operand by eax
Multiplier and multiplicand must be the same size, and the size of the product must be twice the multiplier/multiplicand size. All three formats accept both register and memory operands. However, immediate operands are not accepted (note this).
For example:
If you want to multiply the value in the al register by 2, you need to store the immediate number 2 in a register and multiply it by mul, or place the immediate number in a memory address and multiply it by a memory location.
Examples:
mov bl, 2
mul bl ; Multiply the value in bl register by the value in al register at this point
The only operand in an instruction is a multiplier.
That is, when our multiplier is 8 bits, multiply by al, if our multiplier is 16 bits multiply by ax, if our multiplier is 32 bits multiply by eax register.
The above is the content of this article about "What are the formats of MUL directives?" I believe everyone has a certain understanding. I hope the content shared by Xiaobian will help everyone. If you want to know more relevant knowledge, please pay attention to the industry information channel.