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

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

[avr-gcc-list] Frame Layout, Stack Layout


From: Josef Eisl
Subject: [avr-gcc-list] Frame Layout, Stack Layout
Date: Tue, 17 Mar 2009 13:21:39 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hello,

I recently tried to find out how the avr-gcc frame layout (stack layout)
looks like. I couldn't find any official documentation about this or is
there an *avr-gcc internals* manual I have not found yet?
I've created a figure [1] showing the stack after a CALL instruction and
 how I think it works. I have assumed that avr-gcc was called with -O0.
I understand that the optimizer removes instructions if they are not needed.
There are a few things I am not sure about:

- In which order is the return address saved on the stack? Unfortunately
there is no hint about that in the description of the CALL instruction.
I assumed that the high byte is pushed before the low byte, correct?
Is it the same on devices with 22bit PC?

- What is the right terminology? Frame Layout, Stack Layout, Activation
Record?
In my understanding the epilogue is used to save call-saved registers
(and the frame pointer Y) as well as reserving memory for function
arguments and local variables (that is the actual frame, right?) on the
stack. Storing the content of the argument registers on the stack is not
really a part of the prologue.

I hope I got it right, feedback appreciated :).
Anyway, maybe some of these informations should be added to the docs.

BW
Josef

[1]: http://web.student.tuwien.ac.at/~e0625147/FrameLayout.png




reply via email to

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