# masked_off_bit_count_c

num_masked_off.i4.v = masked_off_bit_count_c(value.g.v, mask_value.g.v,
start_bit.i4.v,
num_bits.i4.v,
lowest_masked.i4.r,
highest_masked.i4.r)
This routine counts the number of set bits which will be masked off
in a byte string by a given mask value. A little endian byte
ordering is assumed.
value value to test
mask_value mask value
start_bit starting bit number (starts at 1)
num_bits number of bits to test
lowest_masked bit number of lowest masked bit found (starts at 1)
(If this value is not needed, a value of NULL
can be passed.)
highest_masked bit number of highest masked bit found (starts at 1)
(If this value is not needed, a value of NULL
can be passed.)
This function returns status values as follows:
CLIB_INVARG invalid starting bit number or number of bits
otherwise number of masked off bits
This function requires the following include files:
cnsparam_h, clib_h
Related functions:
bit_count_c, tstbit(_c), setbit(_c), rstbit(_c),
bit_field_circular_shift_c, icshft
C/C++ usage:
int num_masked_off;
int value = VALUE;
int mask_value = MASK_VALUE;
int start_bit = 1;
int num_bits = 32;
int lowest_masked;
int highest_masked;
num_masked_off = masked_off_bit_count_c((void *) &value,
(void *) &mask_value,
start_bit,num_bits,
&lowest_masked,&highest_masked);