Hello all.
Code:
asm (
"bsf %1,%0;"
"btr %0,%1"
: "=r" (col) // output
: "0" (thisdelta) // input
);
I'm using the Bloodshed compiler.
This code should find the first set bit in thisdelta, and then clear it, leaving the index of the set bit in col. Using the Bsf on it's own works fine, but here the bit never seems to get cleared.
I don't know whether the problem is in the assembly code itself or the way I'm specifying the parameters.
Can anyone recommend any good books/resources on x86 assembler?