bsf{wl} r/m[16|32], reg[16|32]
(r/m = 0) 0 -> ZF (r/m [ne ] 0) 0 -> ZF
bsf scans the bits, starting at bit 0, in the doubleword operand or the second word. If the bits are all zero, ZF is cleared. Otherwise, ZF is set and the bit index of the first set bit, found while scanning in the forward direction, is loaded into the destination register.
bsf 4(%edi), %edx
bsr{wl} r/m[16|32], reg[16|32]
(r/m = 0) 0 -> ZF (r/m [ne ] 0) 0 -> ZF
bsr scans the bits, starting at the most significant bit, in the doubleword operand or the second word. If the bits are all zero, ZF is cleared. Otherwise, ZF is set and the bit index of the first set bit found, while scanning in the reverse direction, is loaded into the destination register
bsr 4(%edi), %edx
bt{wl} imm8, r/m[16|32] bt{wl} reg[16|32], r/m[16|32]
BIT [LeftSRC, RightSRC] -> CF
The bit indicated by the first operand (base) and the second operand (offset) are saved by bt into CF (carry flag).
btl $253, 4(%edi) btl %edx, 4(%edi)
btc{wl} imm8, r/m[16|32] btc{wl} reg[16|32], r/m[16|32]
BIT [LeftSRC, RightSRC] -> CF
NOT BIT [LeftSRC, RightSRC] -> BIT[LeftSRC, RightSRC]
The bit indicated by the first operand (base) and the second operand (offset) are saved by btc into CF (carry flag) and complements the bit.
btl $253, 4(%edi) btl %edx, 4(%edi)
btr{wl} imm8, r/m[16|32] btr{wl} reg[16|32], r/m[16|32]
BIT[LeftSRC, RightSRC] -> CF
0 -> BIT[LeftSRC, RightSRC]
The value of the first operand (base) and the second operand (bit offset) are saved by btr into the carry flag and then it stores 0 in the bit.
btrl $253, 4(%edi) btrl $edx, 4(%edi)
bts{wl} imm8, r/m[16|32] bts{wl} reg[16|32], r/m[16|32]
BIT[LeftSRC, RightSRC] -> CF
0 -> BIT[LeftSRC, RightSRC]
The value of the first operand (base) and the second operand (bit offset) are saved by bts into the carry flag and then it stores 1 in the bit.
btsl $253, 4(%edi) btsl $edx, 4(%edi)