bitFieldExtract()
Purpose
Extract a number of bits from a binary number
Description
Extract the specified number of bits from a 32 bit signed binary number starting at the specified bit
Syntax
result = bitFieldExtract( number, start, count )
Arguments
number 32 bit signed binary number
start Start position (first position is 0)
count Number of bits to extract
result The specfied bits
Example
number = 0
for i = 0 to 16 loop
number = bitSet( number, i, 1 )
lowbyte = bitFieldExtract( number, 0, 8 )
highbyte = bitFieldExtract( number, 8, 8 )
printAt( 0, i , number, " ", lowbyte, " ", highbyte )
update()
repeat
sleep( 3 )
Associated Commands
bitCount(), bitGet(), bitSet(), bitFieldInsert(), leadingZeroes(), trailingZeroes()