[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping
From: |
Anatoly Sokolov |
Subject: |
[avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping to it |
Date: |
Tue, 13 Feb 2007 16:51:49 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 |
Follow-up Comment #1, bug #19050 (project avr-libc):
Call main() as a normal function have some drawback:
1. Loss of two bytes of RAM for storing 'main' return address in stack.
2. Increase code size, if 'main' function has local variables.
Now stack frames for 'main' function is setup by a following code:
REG_Y (frame pointer) = RAM_END - frame_size
SP = REG_Y
Size = 4 instruction.
If 'main' will be usual function, that in prologue will be a following code:
PUSH REG_Y
REG_Y = SP
REG_Y = REG_Y - frame_size
SP = REG_Y
Size - 7/8 instruction and loss of two bytes more of RAM. And 7/8 more
instructions in an epilogue of function.
3. If in 'main' function 'call-saved' registers (r2..r17) will be used, then
they will be saved in a stack.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?19050>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping to it, Joerg Wunsch, 2007/02/13
- [avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping to it, Joerg Wunsch, 2007/02/13
- [avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping to it,
Anatoly Sokolov <=
- RE: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Eric Weddington, 2007/02/13
- Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Anatoly Sokolov, 2007/02/13
- RE: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Eric Weddington, 2007/02/13
- Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Joerg Wunsch, 2007/02/13
- RE: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Eric Weddington, 2007/02/13
- Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Anatoly Sokolov, 2007/02/13
- Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Björn Haase, 2007/02/13
- Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it, Joerg Wunsch, 2007/02/13
- RE: [avr-libc-dev] [bug #19050] gcrt1.S should call main ratherthanjumping to it, Eric Weddington, 2007/02/13
- Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main ratherthanjumping to it, Joerg Wunsch, 2007/02/13