test instruction
An instruction that ANDs two values only to set the flags, often used to ask "is this zero?" or "is this bit set?".
test a, b (x86-64) and tst xa, xb (ARM64, ands xzr, xa, xb) compute a & b, set ZF/SF (Z/N) from it, clear CF and OF (C and V), and write no register; test eax, eax checks for zero.
Examples
test eax, eaxthenjejumps wheneaxis 0, without changingeax.
See also