[Top][All Lists]

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

Re: [avr-gcc-list] Using External RAM via the -Tdata approach --- Losing

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Using External RAM via the -Tdata approach --- Losing Pointers in the mist
Date: Tue, 8 Oct 2002 16:44:59 +0200 (MET DST)

Brett Abbott <address@hidden> wrote:

> int main( void )
> {
> int xxx;
> xxx=lentest("Test"); /* Get the length of the passed string */
> if(xxx==4)
>       sei(); /* This is performed when -Tdata is not used - This
>                 is what ought to happen */
> if(xxx!=4)
>       sei(); /* This is performed when -Tdata is used.  oh dear. */

I can't see anything wrong in the disassembled code.  "Test" is stored
in the data section, and the initialization loop from gcrt1.S properly
stores its contents from behind the text segment (0x150 in that simple
test case) to 0x1100 when -Tdata is used.  Accordingly, main() uses
0x1100 as the address to pass down to lentest().


> #include <stdarg.h>
> #include <ctype.h>
> #include <string.h>
> #include <stdlib.h>
> #include <io.h>
> #include <interrupt.h>
> #include <sig-avr.h>

There are a lot of unused header files here (do you really use
character classes from <ctype.h> and variadic functions from
<stdarg.h>?).  Also, the latter three include files should be
spelled <avr/io.h>, <avr/interrupt.h>, and <avr/signal.h> now.

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org

reply via email to

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