linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I need help about inline assembly
@ 2004-03-29  5:57 RaZoR
  2004-03-29  7:39 ` Frederic Marmond
  0 siblings, 1 reply; 2+ messages in thread
From: RaZoR @ 2004-03-29  5:57 UTC (permalink / raw)
  To: linux-assembly

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: I need help about inline assembly
  2004-03-29  5:57 I need help about inline assembly RaZoR
@ 2004-03-29  7:39 ` Frederic Marmond
  0 siblings, 0 replies; 2+ messages in thread
From: Frederic Marmond @ 2004-03-29  7:39 UTC (permalink / raw)
  To: RaZoR; +Cc: linux-assembly

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-29  7:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-29  5:57 I need help about inline assembly RaZoR
2004-03-29  7:39 ` Frederic Marmond

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).