linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: Johnny Hung <johnny.hacking@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>,
	kernelnewbies@nl.linux.org, linux-kernel@vger.kernel.org,
	linux-embedded@vger.kernel.org
Subject: Re: How to move two valuables to x86 CPU register ebx, ecx by using  AT&A inline asm.
Date: Mon, 23 Nov 2009 00:43:47 -0500	[thread overview]
Message-ID: <73c1f2160911222143j196fac7cqf0464c4ad9c35cfc@mail.gmail.com> (raw)
In-Reply-To: <cb9ecdfa0911221914t78f7849h9f00c68420f63d14@mail.gmail.com>

On Sun, Nov 22, 2009 at 10:14 PM, Johnny Hung <johnny.hacking@gmail.com> wrote:
> After testing:
>
> # gcc inlineasm.c
> inlineasm.c: Assembler messages:
> inlineasm.c:7: Error: suffix or operands invalid for `out'
> [root@debian-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

      reply	other threads:[~2009-11-23  5:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  9:50 How to move two valuables to x86 CPU register ebx, ecx by using AT&A inline asm Johnny Hung
2009-11-19 10:05 ` Viral Mehta
2009-11-19 10:19   ` Johnny Hung
2009-11-19 10:21     ` Viral Mehta
2009-11-19 11:11       ` Johnny Hung
2009-11-20  6:04         ` stas
2009-11-20 10:43           ` David Woodhouse
2009-11-20  6:48 ` Américo Wang
2009-11-20  8:45 ` Jiri Slaby
2009-11-23  3:14   ` Johnny Hung
2009-11-23  5:43     ` Brian Gerst [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73c1f2160911222143j196fac7cqf0464c4ad9c35cfc@mail.gmail.com \
    --to=brgerst@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=johnny.hacking@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).