13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AMD64 Technology 24594 Rev. 3.10 February 2005IMULSigned MultiplyMultiplies two signed oper<strong>and</strong>s. The number of oper<strong>and</strong>s determines the form of theinstruction.If a single oper<strong>and</strong> 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 oper<strong>and</strong> size) <strong>and</strong> stores the product in AX, DX:AX,EDX:EAX, or RDX:RAX, respectively.If two oper<strong>and</strong>s are specified, the instruction multiplies the value in a generalpurposeregister (first oper<strong>and</strong>) by an immediate value or the value in a generalpurposeregister or memory location (second oper<strong>and</strong>) <strong>and</strong> stores the product in thefirst oper<strong>and</strong> location.If three oper<strong>and</strong>s are specified, the instruction multiplies the value in a generalpurposeregister or memory location (second oper<strong>and</strong>), by an immediate value (thirdoper<strong>and</strong>) <strong>and</strong> stores the product in a register (first oper<strong>and</strong>).The IMUL instruction sign-extends an immediate oper<strong>and</strong> to the length of the otherregister/memory oper<strong>and</strong>.The CF <strong>and</strong> 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 <strong>and</strong> 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 oper<strong>and</strong> <strong>and</strong> put the signed result in AX.Multiply the contents of AX by the contents of a 16-bit memory orregister oper<strong>and</strong> <strong>and</strong> put the signed result in DX:AX.Multiply the contents of EAX by the contents of a 32-bit memoryor register oper<strong>and</strong> <strong>and</strong> put the signed result in EDX:EAX.Multiply the contents of RAX by the contents of a 64-bit memoryor register oper<strong>and</strong> <strong>and</strong> 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 oper<strong>and</strong> <strong>and</strong> put thesigned result in the 16-bit destination register.146 IMUL

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!