How to use uninitialized data in GCC inline assembly?

If you're mixing C and inline assembly you should let the C compiler handle the memory allocation. Declare your memory as char myvar1024 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 to asm() and let the compiler choose the addressing format for you.

Up vote 1 down vote favorite 1 share g+ share fb share tw.

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; } assembly intel inline-assembly link|improve this question edited Apr 17 '11 at 2:44 asked Apr 17 '11 at 2:35nh215928 90% accept rate.

So does that mean GCC will always ignore resbs, even if I write the assembly myself in an . S file into the proper region? – nh2 Apr 17 '11 at 22:11 1 When you use GCC you're assembling with GAS which has different syntax than NASM (which you must be used to if you want resb).

If you put the right command (eg . Lcomm) in the right section GAS will reserve space for you. Check out: ibm.com/developerworks/linux/library/l-g... .

However, I think you would be better off doing the allocation in C for mixed code. – Ben Jackson Apr 17 '11 at 23:22.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions