Date: Sun, 28 Jan 1996 08:26:34 +0200 (IST) From: Eli Zaretskii To: Cuthalion / Sliced Bread Cc: djgpp AT delorie DOT com Subject: Re: Waiting for retraces........................................ On Fri, 26 Jan 1996, Cuthalion / Sliced Bread wrote: > The basic code was while((inportb(0x3DA)&8)!=1); > > I also tried: > int temp = 0; > while(temp & 8 != 1) temp = inportb(0x3DA); What happens if you declare `temp' to be volatile, like this: volatile int temp = 0; When you use -O3 in DJGPP v2.0, `inportb' is expanded to inline code, so GCC never sees the function call and might thus optimize out the entire loop. Look at the code with a debugger to see what gets into the binary, or ask gcc to generate an assembly listing.