Date: Tue, 30 Jan 1996 09:11:51 +0200 (IST) From: Eli Zaretskii To: Mark Lee Cc: djgpp AT delorie DOT com, mlee AT heartlab DOT rri DOT uwo DOT ca Subject: Re: Parallel/Serial port programming On Mon, 29 Jan 1996, Mark Lee wrote: > while(read) > { > while(inportb(STATUS_PORT)) /* check DATA is beening sent */ > { /* read DATA and print */ > fprintf(stderr," DATA READ %d \n",inportb(DATA_PORT)); > } > outportb(CONTROL_PORT,1); /* Send Stop Request */ > /* End reading */ > read=0; > } It seems that if `inportb(STATUS_PORT)' returns zero first time through the `while(read)' loop (meaning probably that the other PC didn't write anything yet), your program immediately sets `read' to zero and exits the loop. I would add another loop (before `while(read)' one) which waits for STATUS_PORT to go high until some timeout is reached, *then* enter the `while(read)' loop.