'cause "test" only sets the flags and is faster in execution than "cmp".
1. CMP only sets Flags.
2. TEST is analog of AND for flags.
1. "cmp" matches the first operand with the second one and fixes the flags accordingly.
Internally the first operand is subtracted from the second operand. (This is why test is faster?!?)
The first operand can be a memvariable or a register. The second operand can be a constant additionally. Both operands have to be equal, unless the second is an 8-bit constant. Also it is to regard that at least one operand is a register.
2. "test" executes a logical AND-conjunction and
doesn't save the output, instead it only sets the flags. Both operands must be equal.
Maybe i am wrong, but that's what i've learned.