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.

24594 Rev. 3.10 February 2005 AMD64 TechnologyADDSigned or Unsigned AddAdds the value in a register or memory location (first oper<strong>and</strong>) <strong>and</strong> an immediatevalue or the value in a register a memory location (second oper<strong>and</strong>), <strong>and</strong> stores theresult in the first oper<strong>and</strong> location. The instruction cannot add two memory oper<strong>and</strong>s.The instruction sign-extends an immediate value to the length of the destinationregister or memory oper<strong>and</strong>.This instruction evaluates the result for both signed <strong>and</strong> unsigned data types <strong>and</strong> setsthe OF <strong>and</strong> CF flags to indicate a carry in a signed or unsigned result, respectively. Itsets the SF flag to indicate the sign of a signed result.The forms of the ADD instruction that write to memory support the LOCK prefix. Fordetails about the LOCK prefix, see “Lock Prefix” on page 10.Mnemonic Opcode DescriptionADD AL, imm8 04 ib Add imm8 to AL.ADD AX, imm16 05 iw Add imm16 to AX.ADD EAX, imm32 05 id Add imm32 to EAX.ADD RAX, imm32 05 id Add sign-extended imm32 to RAX.ADD reg/mem8, imm8 80 /0 ib Add imm8 to reg/mem8.ADD reg/mem16, imm16 81 /0 iw Add imm16 to reg/mem16ADD reg/mem32, imm32 81 /0 id Add imm32 to reg/mem32.ADD reg/mem64, imm32 81 /0 id Add sign-extended imm32 to reg/mem64.ADD reg/mem16, imm8 83 /0 ib Add sign-extended imm8 to reg/mem16ADD reg/mem32, imm8 83 /0 ib Add sign-extended imm8 to reg/mem32.ADD reg/mem64, imm8 83 /0 ib Add sign-extended imm8 to reg/mem64.ADD reg/mem8, reg8 00 /r Add reg8 to reg/mem8.ADD reg/mem16, reg16 01 /r Add reg16 to reg/mem16.ADD reg/mem32, reg32 01 /r Add reg32 to reg/mem32.ADD reg/mem64, reg64 01 /r Add reg64 to reg/mem64.ADD reg8, reg/mem8 02 /r Add reg/mem8 to reg8.ADD 67

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

Saved successfully!

Ooh no, something went wrong!