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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24594 Rev. 3.10 February 2005 AMD64 TechnologyANDLogical ANDPerforms a bitwise AND operation on the value in a register or memory location (firstoper<strong>and</strong>) <strong>and</strong> an immediate value or the value in a register or memory location(second oper<strong>and</strong>), <strong>and</strong> stores the result in the first oper<strong>and</strong> location. The instructioncannot AND two memory oper<strong>and</strong>s.The instruction sets each bit of the result to 1 if the corresponding bit of bothoper<strong>and</strong>s is set; otherwise, it clears the bit to 0. The following table shows the truthtable for the AND operation:X Y X AND Y0 0 00 1 01 0 01 1 1The forms of the AND instruction that write to memory support the LOCK prefix. Fordetails about the LOCK prefix, see “Lock Prefix” on page 10.Mnemonic Opcode DescriptionAND AL, imm8AND AX, imm16AND EAX, imm32AND RAX, imm3224 ib25 iw25 id25 idAND the contents of AL with an immediate 8-bit value <strong>and</strong> storethe result in AL.AND the contents of AX with an immediate 16-bit value <strong>and</strong> storethe result in AX.AND the contents of EAX with an immediate 32-bit value <strong>and</strong>store the result in EAX.AND the contents of RAX with a sign-extended immediate 32-bitvalue <strong>and</strong> store the result in RAX.AND reg/mem8, imm8 80 /4 ib AND the contents of reg/mem8 with imm8.AND reg/mem16, imm16 81 /4 iw AND the contents of reg/mem16 with imm16.AND reg/mem32, imm32 81 /4 id AND the contents of reg/mem32 with imm32.AND reg/mem64, imm32 81 /4 id AND the contents of reg/mem64 with sign-extended imm32.AND 69

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

Saved successfully!

Ooh no, something went wrong!