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"="
The line
a^7=msb;
is incorrect. You can't use the '^' for bit operations - it represents an xor operation, and hence a^7 is not an lvalue, i.e. something you can assign to.
The overloaded meaning of '^' can only be used when declaring bit variables.
Too slow again :)