bsr

Bit Scan Reverse

BSR r, r/m

Scans for MSB set to 1.

Details

The Bit Scan Reverse instruction scans for MSB set to 1.

Pseudocode Operation

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

Example

BSR rax, rbx

Encoding

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

Operands

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