I am analyzing a sequence of x86 instructions, and become confused with the following code:135328495: sbb edx, edx135328497: neg edx135328499: test edx, edx135328503: jz 0x810f31cI understand that sbb equals to des = des - (src + CF), in other words, the first instruction somehow put -CF into edx. Then it negtive -CF into CF, and test whether CF equals to zero??But note that jz checks flag ZF, not CF! So basically what is the above code sequence trying to do? This is a legal x86 instruction sequence, produced by g++ version 4.6.3.
x86 sbb with same register as first and second operand
assembly;x86