NASM 2.05 based x86 Instruction Reference[ch343]
A.5.317 TEST: Test Bits (notional bitwise AND) TEST r/m8,reg8 ; 84 /r [8086] TEST r/m16,reg16 ; o16 85 /r [8086] TEST r/m32,reg32 ; o32 85 /r [386] TEST r/m8,imm8 ; F6 /0 ib [8086] TEST r/m16,imm16 ; o16 F7 /0 iw [8086] TEST r/m32,imm32 ; o32 F7 /0 id [386] TEST AL,imm8 ; A8 ib [8086] TEST AX,imm16 ; o16 A9 iw [8086] TEST EAX,imm32 ; o32 A9 id [386] TEST performs a "mental" bitwise AND of its two operands, and affects the flags as if the operation had taken place, but does not store the result of the operation anywhere. (For bitwise AND that does store the result, see section A.5.8.) The Carry Flag is cleared by TEST. The Zero Flag is set according to whether the result is zero.