#include<reg51.h>
sfr port= 0x80; void main() { port=~port; }
This code was successfully compiled...but yu expect the port pins are complemented only once..But what i experiened when used with a simulator software, was the port pins get complemented for infinite times( somthing like the 'port=~port;' instruction was put in a while(1) loop..)
What could be the wrong?
priyan, first of all, why don't you place an infinite loop in main? second, once your main terminates what happens is compiler dependent - it might be that your processor repeatedly resets which is the reason for the behavior you see.