We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
can any one solve this #include <AT89X51.H>
#include<stdio.h> bdata unsigned int a;
sbit lsb=a^0; sbit msb=a^7; bit i; void main() { a=0xaa; while(1) { i=lsb; a=a>>1; msb=i; a^7=msb; P1=a; } }
for this code iam getting error as syntax error near"="
you have synta error near"="
That is usually a very important question. In this case, the answer is fairly trivial, though:
a^7=msb;
This is not valid syntax. "^" can only specify bits within an sbit declaration. In any other expression, it is regarded as an XOR operator.