Jump to content
  • Advertisement
Sign in to follow this  

[C++] [GCC] - Inline Assembly

This topic is 4041 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;"
         "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");

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!