#include <intrins.h>
bit _testbit_ (
bit b); /* bit to test and clear */
Description
The _testbit_ routine produces a JBC instruction in
the generated program code to simultaneously test the bit b and clear it to 0. This routine may be used only on
directly-addressable bit variables and is invalid on any type of
expression. This routine is implemented as an intrinsic function.
Return Value
The _testbit_ routine returns the value of b.
Example
#include <intrins.h>
#include <stdio.h> /* for printf */
void tst_testbit (void){
bit test_flag;
if (_testbit_ (test_flag))
printf ("Bit was set\n");
else
printf ("Bit was clear\n");
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.