#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");
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.