_BitScanForward64
Classification
Other, Bit Manipulation, CPUID Test: None
Header File
Instruction
BSF r64, r64
Synopsis
_BitScanForward64(unsigned __int32* index, unsigned __int64 a);
Description
Set "index" to the index of the lowest set bit in 32-bit integer "mask". If no bits are set in "a", then "index" is undefined and "dst" is set to 0, otherwise "dst" is set to 1.
Operation
tmp := 0
IF a == 0
// MEM[index+31:index] is undefined
dst := 0
ELSE
DO WHILE ((tmp < 64) AND a[tmp] == 0)
tmp := tmp + 1
OD
MEM[index+31:index] := tmp
dst := (tmp == 63) ? 0 : 1
FI