[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <73c1f2160911222143j196fac7cqf0464c4ad9c35cfc@mail.gmail.com>
Date: Mon, 23 Nov 2009 00:43:47 -0500
From: Brian Gerst <brgerst@...il.com>
To: Johnny Hung <johnny.hacking@...il.com>
Cc: Jiri Slaby <jirislaby@...il.com>, kernelnewbies@...linux.org,
linux-kernel@...r.kernel.org, linux-embedded@...r.kernel.org
Subject: Re: How to move two valuables to x86 CPU register ebx, ecx by using
AT&A inline asm.
On Sun, Nov 22, 2009 at 10:14 PM, Johnny Hung <johnny.hacking@...il.com> wrote:
> After testing:
>
> # gcc inlineasm.c
> inlineasm.c: Assembler messages:
> inlineasm.c:7: Error: suffix or operands invalid for `out'
> [root@...ian-johnny] ~/workspace/test
>
> # cat inlineasm.c
> #include <stdio.h>
>
> int main ()
> {
> unsigned int val = 5, tmp = 10;
> asm volatile ("outb $0x27, %%al"
> :
> : "a" (0xb2), "b"(val), "c" (tmp)
> );
> }
>
> It seems the source of outb instruction cannot be a constant. Is
> there a AT&T instructions document for x86?
In AT&T syntax, the source register comes first. So it should be
"outb %%al, $0x27", assuming that 0x27 is the port number you are
trying to write to.
--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists