...char *PtrRx;
char CompDataRx[16];

R_serial () interrupt 4
{
	if(RI)
	{
		 serialR = SBUF;
		 aid = serial;
//		 *PtrRx = serialR;
//		 ++PtrRx;
		 RI=0;
		 
	} /* wait for receive data */
	else
		TI = 0;
		
}



void main()
{
	while(1){
	PtrRx = &CompDataRx[0];		// start address in the array
	
	CompAddress1 = P1;
	CompAddress2 = CompAddress1 + 0x80;
	CompAddress3 = CompAddress1 + 0x90;
	HwDelay(20);
	CompAddress1 = P1;
	CompAddress2 = CompAddress1 + 0x80;
	CompAddress3 = CompAddress1 + 0x90;   
	SerialInit(9600);
	SendCompAddress();
	
	PtrRx = &CompDataRx[0];
	while (PtrRx != &CompDataRx[1]);
	CompState = CompDataRx[0];
        
        if  (CompState==0x41)
		{
       		PtrRx = &CompDataRx[0];
			
			P2 = 0xF8;
			P1 = 0x01;
			ACK_PC(0xFA);
			CompON = 1;
						

			while (PtrRx != &CompDataRx[16]);
			
					
		}


	...