title: "GetBit" description: TRSE built-in method (from IDE help)
GetBit
Systems: MOS6502, M6809
Parameters: a,b
[byte] = GetBit( [address], [byte] );
- [address] - to check
- [byte] - bit to check
Description
Returns the bit specified in parameter 2 at the address in parameter 1 (0 or 1).
Example
// Check if sprite "i" is on
is_active := GetBit( SPRITE_BITMASK, i );
// sprite-sprite collision occurred
if ( GetBit( ^$D019, 2 ) = 1) then begin
....