Volume 3: General-Purpose and System Instructions - Stanford ...
Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...
AMD64 Technology 24594 Rev. 3.10 February 2005IMULSigned MultiplyMultiplies two signed operands. The number of operands determines the form of theinstruction.If a single operand is specified, the instruction multiplies the value in the specifiedgeneral-purpose register or memory location by the value in the AL, AX, EAX, or RAXregister (depending on the operand size) and stores the product in AX, DX:AX,EDX:EAX, or RDX:RAX, respectively.If two operands are specified, the instruction multiplies the value in a generalpurposeregister (first operand) by an immediate value or the value in a generalpurposeregister or memory location (second operand) and stores the product in thefirst operand location.If three operands are specified, the instruction multiplies the value in a generalpurposeregister or memory location (second operand), by an immediate value (thirdoperand) and stores the product in a register (first operand).The IMUL instruction sign-extends an immediate operand to the length of the otherregister/memory operand.The CF and OF flags are set if, due to integer overflow, the double-widthmultiplication result cannot be represented in the half-width destination register.Otherwise the CF and OF flags are cleared.Mnemonic Opcode DescriptionIMUL reg/mem8 F6 /5IMUL reg/mem16 F7 /5IMUL reg/mem32 F7 /5IMUL reg/mem64 F7 /5IMUL reg16, reg/mem16 0F AF /rMultiply the contents of AL by the contents of an 8-bit memoryor register operand and put the signed result in AX.Multiply the contents of AX by the contents of a 16-bit memory orregister operand and put the signed result in DX:AX.Multiply the contents of EAX by the contents of a 32-bit memoryor register operand and put the signed result in EDX:EAX.Multiply the contents of RAX by the contents of a 64-bit memoryor register operand and put the signed result in RDX:RAX.Multiply the contents of a 16-bit destination register by thecontents of a 16-bit register or memory operand and put thesigned result in the 16-bit destination register.146 IMUL
24594 Rev. 3.10 February 2005 AMD64 TechnologyMnemonic Opcode DescriptionIMUL reg32, reg/mem32 0F AF /rIMUL reg64, reg/mem64 0F AF /rMultiply the contents of a 32-bit destination register by thecontents of a 32-bit register or memory operand and put thesigned result in the 32-bit destination register.Multiply the contents of a 64-bit destination register by thecontents of a 64-bit register or memory operand and put thesigned result in the 64-bit destination register.IMUL reg16, reg/mem16, imm8IMUL reg32, reg/mem32, imm8IMUL reg64, reg/mem64, imm8IMUL reg16, reg/mem16, imm16IMUL reg32, reg/mem32, imm32IMUL reg64, reg/mem64, imm32Related InstructionsIDIV6B /r ib6B /r ib6B /r ib69 /r iw69 /r id69 /r idMultiply the contents of a 16-bit register or memory operand by asign-extended immediate byte and put the signed result in the16-bit destination register.Multiply the contents of a 32-bit register or memory operand bya sign-extended immediate byte and put the signed result in the32-bit destination register.Multiply the contents of a 64-bit register or memory operand bya sign-extended immediate byte and put the signed result in the64-bit destination register.Multiply the contents of a 16-bit register or memory operand by asign-extended immediate word and put the signed result in the16-bit destination register.Multiply the contents of a 32-bit register or memory operand bya sign-extended immediate double and put the signed result inthe 32-bit destination register.Multiply the contents of a 64-bit register or memory operand bya sign-extended immediate double and put the signed result inthe 64-bit destination register.IMUL 147
- Page 126 and 127: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 128 and 129: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 130 and 131: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 132 and 133: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 134 and 135: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 136 and 137: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 138 and 139: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 140 and 141: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 142 and 143: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 144 and 145: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 146 and 147: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 148 and 149: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 150 and 151: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 152 and 153: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 154 and 155: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 156 and 157: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 158 and 159: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 160 and 161: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 162 and 163: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 164 and 165: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 166 and 167: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 168 and 169: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 170 and 171: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 172 and 173: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 174 and 175: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 178 and 179: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 180 and 181: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 182 and 183: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 184 and 185: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 186 and 187: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 188 and 189: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 190 and 191: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 192 and 193: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 194 and 195: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 196 and 197: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 198 and 199: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 200 and 201: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 202 and 203: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 204 and 205: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 206 and 207: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 208 and 209: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 210 and 211: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 212 and 213: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 214 and 215: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 216 and 217: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 218 and 219: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 220 and 221: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 222 and 223: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 224 and 225: AMD64 Technology 24594 Rev. 3.10 Fe
24594 Rev. 3.10 February 2005 AMD64 TechnologyMnemonic Opcode DescriptionIMUL reg32, reg/mem32 0F AF /rIMUL reg64, reg/mem64 0F AF /rMultiply the contents of a 32-bit destination register by thecontents of a 32-bit register or memory oper<strong>and</strong> <strong>and</strong> put thesigned result in the 32-bit destination register.Multiply the contents of a 64-bit destination register by thecontents of a 64-bit register or memory oper<strong>and</strong> <strong>and</strong> put thesigned result in the 64-bit destination register.IMUL reg16, reg/mem16, imm8IMUL reg32, reg/mem32, imm8IMUL reg64, reg/mem64, imm8IMUL reg16, reg/mem16, imm16IMUL reg32, reg/mem32, imm32IMUL reg64, reg/mem64, imm32Related <strong>Instructions</strong>IDIV6B /r ib6B /r ib6B /r ib69 /r iw69 /r id69 /r idMultiply the contents of a 16-bit register or memory oper<strong>and</strong> by asign-extended immediate byte <strong>and</strong> put the signed result in the16-bit destination register.Multiply the contents of a 32-bit register or memory oper<strong>and</strong> bya sign-extended immediate byte <strong>and</strong> put the signed result in the32-bit destination register.Multiply the contents of a 64-bit register or memory oper<strong>and</strong> bya sign-extended immediate byte <strong>and</strong> put the signed result in the64-bit destination register.Multiply the contents of a 16-bit register or memory oper<strong>and</strong> by asign-extended immediate word <strong>and</strong> put the signed result in the16-bit destination register.Multiply the contents of a 32-bit register or memory oper<strong>and</strong> bya sign-extended immediate double <strong>and</strong> put the signed result inthe 32-bit destination register.Multiply the contents of a 64-bit register or memory oper<strong>and</strong> bya sign-extended immediate double <strong>and</strong> put the signed result inthe 64-bit destination register.IMUL 147