I download intsio.zip and only changed some word in main.c as following:
void main (void) { com_initialize (); /* initialize interrupt driven serial I/O */ com_baudrate (38400); /* setup for 38400 baud */ printf ("Interrupt-driver Serial I/O Example\r\n\r\n"); while (1) { unsigned char c,cCmd,cCmdLen,i; c = getchar(); if (c == 0xaa) { c = getchar(); if (c == 0x55) { c = getchar(); if (c == '@') { c = getchar(); cCmd = c; c = getchar(); if ((c+cCmd) == 0xff) { cCmdLen = getchar(); for ( i = 0 ; i < cCmdLen ; i ++) { c = getchar(); printf("%c" ,c); } } } } } } }
"It seems like you expect getchar() to echo the received character." Yes, that is the documented behaviour of the standard Keil C51 implementation: http://www.keil.com/support/man/docs/c51/c51_getchar.htm