Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

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()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.