Using 10 year old version of gas

Arno Puder arno@research.att.com
Fri Mar 2 23:58:00 GMT 2001


Hi,

I have a piece of code that I wrote over a decade ago which doesn't
compile with a recent version of gas. Don't ask me which version I was
using; I simply don't know anymore. Here is the code:

unsigned char inportb( short int port )
{
      unsigned char value;

      asm( "inb %1,%0" : "ral=" (value) : "rdx" (port) );
      return( value );
}

I try to compile the code for a 386 machine. I use a gcc 2.95.2 and gas
2.9.5. The above code yields the following error message:

inout.c: In function `inportb':
inout.c:9: warning: output constraint `=' for operand 0 is not at the
beginning
/tmp/cckUlS1D.s: Assembler messages:
/tmp/cckUlS1D.s:11: Error: suffix or operands invalid for `in'


Can anyone tell me how this code show look like nowadays?

Thanks,
Arno



More information about the Binutils mailing list