The TEST operation clears the flags CF and OF to zero. The SF is set to the most significant bit of the result of the AND. If the result is 0, the ZF is set to 1, otherwise set to 0. The parity flag is set to the bitwiseXNOR of the least significant byte of the result, 1 if the number of ones in that byte is even, 0 otherwise. The value of AF is undefined.
Examples
; Conditional Jumptestcl,cl; set ZF to 1 if cl == 0jz0x8004f430; jump if ZF == 1; Conditional Jump with NOTtestcl,cl; set ZF to 1 if cl == 0jnz0x8004f430; jump if ZF == 0; ortesteax,eax; set SF to 1 if eax < 0 (negative)jserror; jump if SF == 1; regular applicationtestal,$0F; set ZF if "al AND $0f = 0" (here: address-align test for 16b)jnz@destination; jump if eax IS NOT "MODULO 16=0"