_bit_scan_forward
Classification
Other, Bit Manipulation, CPUID Test: None
Header File
Instruction
BSF r32, r32
Synopsis
_bit_scan_forward(int a);
Description
Set "dst" to the index of the lowest set bit in 32-bit integer "a". If no bits are set in "a" then "dst" is undefined.
Operation
tmp := 0
IF a == 0
// dst is undefined
ELSE
DO WHILE ((tmp < 32) AND a[tmp] == 0)
tmp := tmp + 1
OD
FI
dst := tmp