Unit 'System' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

BsfWord

Return the position of the rightmost set bit in a 16-bit value.

Declaration

Source position: systemh.inc line 1225

function BsfWord(

  const AValue: Word

):Cardinal;

Description

BsfWord scans the word AValue, starting at position 0 (rightmost position) , and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsfByte

  

Return the position of the rightmost set bit in an 8-bit value.

BsrWord

  

Return the position of the leftmost set bit in a 16-bit value.

BsfDWord

  

Return the position of the rightmost set bit in a 32-bit value.

BsfQWord

  

Return the position of the rightmost set bit in a 64-bit value.


Documentation generated on: Jul 24 2023