| ||||||||
Technical Support Support Resources Product Information | C51: DECLARING BDATA AND SBIT VARIABLESInformation in this article applies to:
QUESTIONI'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:\c51\examples\my>C51 TEST.c and the error message I receive is: syntax error near "sbit" What's wrong with my program? ANSWERYou 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;
}
MORE INFORMATION
Last Reviewed: Sunday, March 12, 2006 | |||||||
| ||||||||