When a local array of char is declared in C, i.e. something like: void foo() { char s[] = "hello world"; }The compiler does just the same thing as you by MOVL, and when the string is rather long, the compiler would place the string in .data and call memcpy() to copy it to stack.
On 04/18/2012 10:58 PM, Daniel Hilst wrote:
Is possible to declare strings on stack? I'm using mov + ebp offsets to do something like that.. Is there an easier way to do it? Here is an sample off how I'm doing it: http://sprunge.us/UUZI The hex numbers are a "Hello World" string.. I have tried .assci without success :( Thanks in advance!
-- Regards, Zhongye -- To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
- References:
- [linux-assembly] Declare strings on stack, gas
- From: Daniel Hilst
- [linux-assembly] Declare strings on stack, gas
- Prev by Date: [linux-assembly] Declare strings on stack, gas
- Next by Date: Re: [linux-assembly] Declare strings on stack, gas
- Previous by thread: [linux-assembly] Declare strings on stack, gas
- Next by thread: Re: [linux-assembly] Declare strings on stack, gas
- Index(es):