TEST
Operands:
REG, memory
memory, REG
REG, REG
memory, immediate
REG, immediate
Logical AND between all bits of two operands for flags only. These flags are
affected: ZF, SF, PF. These rules apply:
1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0
Result is not stored anywhere.
Example:
MOV AL, 00000101b
TEST AL, 1 ; ZF = 0.
TEST AL, 10b ; ZF = 1.
RET
Flags:
C Z S O P
0 r r 0 r