
void main()
{
   startapp = 0;  // for program loading 
   config();      // power on initialisation
   Init_COM();

   while(1)
   {
     delay_ms(100);
     SFRPAGE = 0;
     if(putchar1('A') == -1) // if buffer is full
        putchar2('E');
     else
        putchar2('B');
     SBUF0 = 'C';   // the 'C' is received.

     if(TI0)           // TI0 = UART0 tramsit interrupt flag
	putchar2('D');

     if(ES0)           // ES0 = serial port interrupt enable
	putchar2('F');

     if(EA)            // EA = enable interrupts
	putchar2('G');

     recvbyte2();
   }
}
