I want to use GCC inline assembly, Intel syntax.
Is there an equivalent for what I do in NASM:
myvar resb 1024
which reserves 1024 bytes memory at location myvar?
GCC does not seem to like it:
Error: no such instruction: `myvar resb 1024'
for
int main () {
asm("myvar resb 1024");
return 0;
}
If you’re mixing C and inline assembly you should let the C compiler handle the memory allocation. Declare your memory as
char myvar[1024]and reference that from the inline assembly as needed. You can probably access it directly but it would be best to pass it as an arg toasm()and let the compiler choose the addressing format for you.