linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Marmond <fmarmond@eprocess.fr>
To: RaZoR <razor@NewBG.org>
Cc: linux-assembly@vger.kernel.org
Subject: Re: I need help about inline assembly
Date: Mon, 29 Mar 2004 09:39:40 +0200	[thread overview]
Message-ID: <4067D2BC.2030504@eprocess.fr> (raw)
In-Reply-To: <S262538AbUC2Ayw/20040329005452Z+285@vger.kernel.org>

hum, something like:

int main()
{
    char a=1,b=2;
    printf("a=%i    b=%i\n",a,b);
           __asm__ __volatile__(
            "movb    %0,%1\n\t"    /*a=b*/
               :"=r" (a)
               :"r" (b)
               :"cx","dx","di","si");
    printf("a=%i    b=%i\n",a,b);
            return 0;
}

tell me if you need explainations
Fred

RaZoR wrote:

>Hi again :) I've got one question and here it is:
>
>There's a C program:
>main() {
>char c='g',b='j';
>...
>
>Now how (with the help of inline assembly) to copy c in b. (Without using C
>library functions)
>
>And if you can give me an example using mov*.
>
>Thank you
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>  
>


      reply	other threads:[~2004-03-29  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29  5:57 I need help about inline assembly RaZoR
2004-03-29  7:39 ` Frederic Marmond [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=4067D2BC.2030504@eprocess.fr \
    --to=fmarmond@eprocess.fr \
    --cc=linux-assembly@vger.kernel.org \
    --cc=razor@NewBG.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).