bsf

Bit Scan Forward

BSF r, r/m

Scans for LSB set to 1.

Details

The Bit Scan Forward instruction scans for LSB set to 1.

Pseudocode Operation

DEST <- index of lowest set bit in SRC
ZF <- 1 if SRC = 0

Example

BSF rax, rbx

Encoding

Binary Layout
0F
+0
BC
+1
 
Format Legacy
Opcode 0F BC
Extension Base

Operands

  • dest
    General-purpose register
  • src
    Register or memory operand