Mail Archives: djgpp/1996/01/28/01:33:23
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 -