| ARM Technical Support Knowledge Articles | |
Applies to: C51 C Compiler
Information in this article applies to:
I'm trying to use the SBIT keyword to create a bit in a BDATA variable. However, I can't seem to get the example program to work:
void main (void)
{
bdata int ibase;
sbit mybit0 = ibase ^ 0;
.
.
.
mybit0 = 1;
}
The C51 command line I use is:
c:c51examplesmy>C51 TEST.c
and the error message I receive is:
syntax error near "sbit"
What's wrong with my program?
You must declare the bdata and sbit variables OUTSIDE of a function. For example:
bdata int ibase;
sbit mybit0 = ibase ^ 0;
void main (void)
{
mybit0 = 1;
}
Article last edited on: 2006-03-12 09:28:59
Did you find this article helpful? Yes No
How can we improve this article?