Page 1 of 1

Another Simple AT&T Assembly problem

Posted: Wed Mar 17, 2004 5:04 pm
by srg
Hi

I'm trying to use the "in" instruction (I'm remapping PICs) like this:

asm ("inb %1, %0" : "=a" (temp1) : "d" (PIC1_DATA));

but I'm getting:

Error: suffix or operands invalid for `in'

What am I doing wrong this time??

Thanks
srg

Re:Another Simple AT&T Assembly problem

Posted: Wed Mar 17, 2004 5:45 pm
by Tim
I'm guessing gcc is resolving this to inb edx, eax, which is wrong. (You could confirm this by compiling to an assembly listing.)

Try this:

Code: Select all

asm ("inb %dx, %al" : "=a" (temp1) : "d" (PIC1_DATA));