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.