Another Simple AT&T Assembly problem

Programming, for all ages and all languages.
Post Reply
srg

Another Simple AT&T Assembly problem

Post 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
Tim

Re:Another Simple AT&T Assembly problem

Post 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));
Post Reply