[Top][All Lists]

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

Re: [avr-gcc-list] Memory problem

From: David Kelly
Subject: Re: [avr-gcc-list] Memory problem
Date: Mon, 22 Jun 2009 12:35:43 -0500
User-agent: Mutt/

On Mon, Jun 22, 2009 at 10:17:50AM -0700, Parthasaradhi Nayani wrote:
> Hello all,
> I have interfaced flash memory to my mega64 and created a section for
> this memory. I have some variables and two structures which are
> located in this memory. Initially I defined the variables first and
> then the structure. After linking I checked the map and list files and
> found that the first defined variable occupied the first memory
> location and so on. Later I moved the structure to the top and
> compiled again but this time the variables remained in the same old
> order (the structure should have occupied the first byte onwards). Why
> is this happening? If I need to put some variables in some fixed
> address in this memory how can I do it? Thanks in advance for your
> help.

The order variables are created only has accidental effect on their
final resting place.

In ancient times FORTRAN "programmers" often relied on variables being
allocated in alphabetical order. Not all compilers/linkers behaved that
way, which increased the difficulty of porting complex codes such as

Study the include files for register definitions for a means of
controlling the absolute address of allocation.

David Kelly N4HHE, address@hidden
Whom computers would destroy, they must first drive mad.

reply via email to

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