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

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

scs.stanford.edu
from scs.stanford.edu More from this publisher
13.07.2015 Views

AMD64 Technology 24594 Rev. 3.10 February 2005MULUnsigned MultiplyMultiplies the unsigned byte, word, doubleword, or quadword value in the specifiedregister or memory location by the value in AL, AX, EAX, or RAX and stores the resultin AX, DX:AX, EDX:EAX, or RDX:RAX (depending on the operand size). It puts thehigh-order bits of the product in AH, DX, EDX, or RDX.If the upper half of the product is non-zero, the instruction sets the carry flag (CF) andoverflow flag (OF) both to 1. Otherwise, it clears CF and OF to 0. The other arithmeticflags (SF, ZF, AF, PF) are undefined.Mnemonic Opcode DescriptionMUL reg/mem8 F6 /4MUL reg/mem16 F7 /4MUL reg/mem32 F7 /4MUL reg/mem64 F7 /4Multiplies an 8-bit register or memory operand by the contentsof the AL register and stores the result in the AX register.Multiplies a 16-bit register or memory operand by the contents ofthe AX register and stores the result in the DX:AX register.Multiplies a 32-bit register or memory operand by the contents ofthe EAX register and stores the result in the EDX:EAX register.Multiplies a 64-bit register or memory operand by the contentsof the RAX register and stores the result in the RDX:RAX register.Related InstructionsDIV210 MUL

24594 Rev. 3.10 February 2005 AMD64 TechnologyrFLAGS AffectedID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CFExceptionsM U U U U M21 20 19 18 17 16 14 13–12 11 10 9 8 7 6 4 2 0Note: Bits 31–22, 15, 5, 3, and 1 are reserved. A flag set to 1 or cleared to 0 is M (modified). Unaffected flags are blank. Undefinedflags are U.Exception RealVirtual8086 Protected Cause of ExceptionStack, #SS X X X A memory address exceeded the stack segment limit or was noncanonical.General protection,#GPX X XA memory address exceeded a data segment limit or was non-canonical.X A null data segment was used to reference memory.Page fault, #PF X X A page fault resulted from the execution of the instruction.Alignment check, #AC X X An unaligned memory reference is performed while alignmentchecking was enabled.MUL 211

AMD64 Technology 24594 Rev. 3.10 February 2005MULUnsigned MultiplyMultiplies the unsigned byte, word, doubleword, or quadword value in the specifiedregister or memory location by the value in AL, AX, EAX, or RAX <strong>and</strong> stores the resultin AX, DX:AX, EDX:EAX, or RDX:RAX (depending on the oper<strong>and</strong> size). It puts thehigh-order bits of the product in AH, DX, EDX, or RDX.If the upper half of the product is non-zero, the instruction sets the carry flag (CF) <strong>and</strong>overflow flag (OF) both to 1. Otherwise, it clears CF <strong>and</strong> OF to 0. The other arithmeticflags (SF, ZF, AF, PF) are undefined.Mnemonic Opcode DescriptionMUL reg/mem8 F6 /4MUL reg/mem16 F7 /4MUL reg/mem32 F7 /4MUL reg/mem64 F7 /4Multiplies an 8-bit register or memory oper<strong>and</strong> by the contentsof the AL register <strong>and</strong> stores the result in the AX register.Multiplies a 16-bit register or memory oper<strong>and</strong> by the contents ofthe AX register <strong>and</strong> stores the result in the DX:AX register.Multiplies a 32-bit register or memory oper<strong>and</strong> by the contents ofthe EAX register <strong>and</strong> stores the result in the EDX:EAX register.Multiplies a 64-bit register or memory oper<strong>and</strong> by the contentsof the RAX register <strong>and</strong> stores the result in the RDX:RAX register.Related <strong>Instructions</strong>DIV210 MUL

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

Saved successfully!

Ooh no, something went wrong!