delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/28/01:33:23

Date: Sun, 28 Jan 1996 08:26:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Cuthalion / Sliced Bread <enrico AT max DOT tiac DOT net>
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019