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 TechnologyTESTTest BitsPerforms a bit-wise logical AND on the value in a register or memory location (firstoper<strong>and</strong>) with an immediate value or the value in a register (second oper<strong>and</strong>) <strong>and</strong> setsthe flags in the rFLAGS register based on the result. While the AND instructionchanges the contents of the destination <strong>and</strong> the flag bits, the TEST instructionchanges only the flag bits.Mnemonic Opcode DescriptionTEST AL, imm8A8 ibTEST AX, imm16A9 iwTEST EAX, imm32A9 idTEST RAX, imm32A9 idTEST reg/mem8, imm8F6 /0 ibTEST reg/mem16, imm16F7 /0 iwTEST reg/mem32, imm32F7 /0 idTEST reg/mem64, imm32F7 /0 idTEST reg/mem8, reg8 84 /rTEST reg/mem16, reg16 85 /rTEST reg/mem32, reg32 85 /rTEST reg/mem64, reg64 85 /rAND an immediate 8-bit value with the contents of the ALregister <strong>and</strong> set rFLAGS to reflect the result.AND an immediate 16-bit value with the contents of the AXregister <strong>and</strong> set rFLAGS to reflect the result.AND an immediate 32-bit value with the contents of the EAXregister <strong>and</strong> set rFLAGS to reflect the result.AND a sign-extended immediate 32-bit value with the contentsof the RAX register <strong>and</strong> set rFLAGS to reflect the result.AND an immediate 8-bit value with the contents of an 8-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.AND an immediate 16-bit value with the contents of a 16-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.AND an immediate 32-bit value with the contents of a 32-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.AND a sign-extended immediate32-bit value with the contents ofa 64-bit register or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflectthe result.AND the contents of an 8-bit register with the contents of an 8-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.AND the contents of a 16-bit register with the contents of a 16-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.AND the contents of a 32-bit register with the contents of a 32-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.AND the contents of a 64-bit register with the contents of a 64-bitregister or memory oper<strong>and</strong> <strong>and</strong> set rFLAGS to reflect the result.TEST 285

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

Saved successfully!

Ooh no, something went wrong!