O'Reilly logo
  • You Wang thinks this is interesting:

test can be used for the fastest 'is it a zero?' check


The TEST instruction performs a logical AND of two operands and sets the SF, ZF, and PF flags according to the
results. The flags can then be tested by the conditional jump or loop instructions or the SETcc instructions. The
TEST instruction differs from the AND instruction in that it does not alter either of the operands.