Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22113

GCC extended inline assembly - "invalid instruction suffix for mov"

$
0
0

I try to understand how the extended inline assembly in GCC works. But when I try to run a simple test program I get the error: "invalid instruction suffix for mov"

The sample program:

unsigned char destination;
unsigned char ret;
unsigned int somevalue;

asm ("movb %1, %%al\n\t""push %1\n\t""pop edx\n\t""not %%al\n\t""movb %%al, %0"
    : "=r" (destination), "=r"(somevalue)
    : "r" (ret));

destination shall be loaded into al. After that somevalue is pushed onto the stack. After that it is pop'd in the edx register. The not instruction shall be performed on al which contains the value of destination. After that the result shall be given out to ret. There is no restriction which registers to use to perform this program (I guess that means all registers as clobbers?).


Viewing all articles
Browse latest Browse all 22113

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>