Important: The information in this document is obsolete and should not be used for new development.
BitTst
You can use theBitTst
function to determine whether a given bit is set.
FUNCTION BitTst (bytePtr: Ptr; bitNum: LongInt): Boolean;
bytePtr
- A pointer to a byte in memory.
bitNum
- The bit to be tested, specified as a positive offset from the high-order bit of the byte pointed to by the
bytePtr
parameter. The bit being tested need not be in the byte pointed to bybytePtr
.DESCRIPTION
TheBitTst
function returnsTRUE
if the bit specified by thebytePtr
andbitNum
parameters is set (that is, has a value of 1) and returnsFALSE
if the specified bit is cleared (that is, has a value of 0).SPECIAL CONSIDERATIONS
The bit-numbering scheme used by theBitTst
function is the opposite of MC680x0 bit numbering. To convert an MC680x0 bit number to the format required by theBitTst
function, subtract the MC680x0 bit number from the highest bit number.SEE ALSO
For an example of the use of theBitTst
function, see Listing 3-2 on page 3-15. For more information about reversed bit-numbering see, "Reversed Bit-Numbering" on page 3-7.