View Single Post
Old Apr 4th, 2006, 11:20 PM   #2
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
It is a lot like the "cmp" instruction and is often found right before a conditional jump. The difference is the "cmp" instruction uses subtraction to compare them and set the flags while test uses a bitwise AND.

The most common usage of test is to see if a value is 0 or not:
test eax, eax;  eax & eax == 0 only if eax == 0
jz .L1
Kaja Fumei is offline   Reply With Quote