avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] When does the Stack Frame Pointer (Y) get setup?


From: Weddington, Eric
Subject: Re: [avr-gcc-list] When does the Stack Frame Pointer (Y) get setup?
Date: Tue, 3 Jul 2012 22:44:22 +0000


> -----Original Message-----
> From: Bob Paddock [mailto:address@hidden
> Sent: Tuesday, July 03, 2012 4:00 PM
> To: Weddington, Eric
> Cc: AVR-GCC
> Subject: Re: [avr-gcc-list] When does the Stack Frame Pointer (Y) get setup?
> 
> 
> > I'm not sure why your program doesn't seem to work...
> 
> It does not work because the code I posted is overwriting a structure
> array that was initialized in an earlier .init8 section, and is now
> filed with zeros because of the errant frame pointer.  Its not a
> question of why my code is broken, but a question of should it be
> broken?
> 
> All my, relevant to this issue, code is in C.

Well it's really hard to follow what you posted as you mix up your C and the 
assembly listing. I can't recreate something that I can test on my end to find 
out what is going on.

I noticed that you have that you're clearing the array in .init8. You have a 
note in a comment that says that memset() should really be used instead. Have 
you tried it with memset()?

For that matter, you're setting the array to all zeros. Why not just make the 
array static? It will end up in the .bss section which gets zeroed out in the 
startup code. You don't have to fiddle with a .init8 section.

Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]