[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] stack handling
From: |
Flemming Gram Christensen |
Subject: |
[avr-gcc-list] stack handling |
Date: |
Mon, 12 Mar 2001 16:06:55 +0100 |
User-agent: |
Mutt/1.2.5i |
Hi.
I'm new to this list, so please excuse me if this question is "often-asked"
I studied the way avr-gcc and the iar c compiler handles the stack.
In the documentation for iar it says the iar compiler uses two stacks:
one for return addresses (using call and return instructions) and another
for data (flushed local variables, structs etc.) accessed through the Y
register.
avr-gcc is only using one stack. When a stack frame is needed the SP IO register
is raised using in/out instructions.
What are the pro and cons?
The iar way wastes some memory and special care is needed to ensure the two
stacks
do not overwrites each other. But frame allocation and deallocation is
efficient.
The gcc way uses more code space, but less memory.
Is there anything written on the codegeneration principles of avr-gcc?
Regards Flemming
--
Flemming Gram Christensen, M.Sc., Software Engineer, MjĂžlner Informatics
------------------------------------------------------------------------
Mjolner Informatics A/S Phone: +45 70 27 43 43
Helsingforsgade 27 Fax: +45 70 27 43 44
DK-8000 Aarhus C, Denmark E-mail: address@hidden
------------------------------------------------------------------------
- [avr-gcc-list] stack handling,
Flemming Gram Christensen <=