Sign in to follow this  

[C++] [GCC] - Inline Assembly

This topic is 3730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The following code seems to be considered ilegal in GCC, why?
movb 2(%1, %%ecx), (%0, %%ecx);
Why when i try to compile my program with the following code and the option -O3 the compiler says to me that the symbol bgrLoop was already defined?
    __asm__ __volatile__ (
         "xorl %%ecx, %%ecx;"
         "bgrLoop:;"
         "movb  (%1, %%ecx), %%al;"
         "movb 2(%1, %%ecx), %%ah;"
         "movb %%al, 2(%0, %%ecx);"
         "movb %%ah,  (%0, %%ecx);"
         "addl $3, %%ecx;"
         "decl %2;"
         "jnz bgrLoop;" : "=r" (buffer) : "r" (buffer), "r" (size) : "ah", "al", "ecx");
Felipe

Share this post


Link to post
Share on other sites

This topic is 3730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this