hidden pixel

Test (X86 Instruction) Information

In the x86 assembly language, the TEST instruction performs a bitwise AND on two operands. The flags SF, ZF, PF, CF, OF and AF are modified while the result of the AND is discarded. There are 9 different opcodes for the TEST instruction depending on the type and size of the operands. It can compare 8bit, 16bit, 32bit or 64bit values. It can also compare registers, immediate values and register indirect values.[1]

TEST opcode variations

The TEST operation sets the flags CF and OF to zero. The SF is set to the MSB of the result of the AND. If the result of the AND is 0, the ZF is set to 1, otherwise set to 0. The parity flag is set to the bitwise XNOR of the result of the AND. The value of AF is undefined.

References

  1. ^ "Intel Architecture Software Developer's Manual, Volume 2: Instruction Set Reference Manual" (PDF). http://download.intel.com/design/PentiumII/manuals/24319102.PDF. Retrieved 2007-10-25.

Categories: X86 instructions

 

The above information uses material from Wikipedia and is licensed under the GNU Free Documentation License.
Some facts may not have been fully verified for accuracy. [Disclaimers]
This page was last archived by our server on Mon Feb 21 12:04:22 2011.
Displaying this page or its contents does not use any Wikimedia Foundation's resources.
The owners of this site proudly support the Wikimedia Foundation.