
#include<REG51.H>
#define Port0 P0

bit TimeOut;
int main()
{
  ......   // Initialize your registers here
  ......   // Just like you do in Assembly
  ......   // For eg: EA = 0x81 or something
  ......   // Remember all SFRs are in Upper Case
  TimeOut = 0;
  while(1) // Create an Infinite Loop
  {
    P0 ^= 0x01;
    while(TimeOut == 0);
    TimeOut = 0;
  }
}

void T0_Isr(void) interrupt 1
{
   // Write your Timer 0 ISR here. 
   // Set the Bit TimeOut and Reload TH0 and TL0

   TimeOut = 1;
   TH0 = 0x..;
   TL0 = 0x..;
}
