[Top][All Lists]

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

Re: [avr-gcc-list] linker issue, resolving a pointer as uint32_t

From: Brano Katreniak
Subject: Re: [avr-gcc-list] linker issue, resolving a pointer as uint32_t
Date: Tue, 28 Jun 2005 08:04:58 +0200
User-agent: Mutt/1.5.9i

> Is there a possibility to put a pointer into flash memory and from
> that pointer tell where in flash it is pointing to (to my understanding
> this is 99% of the sense of a pointer)?

You read the pointer from flash memory and the value you get is the
value of the pointer. It is up to you whether you use it as a pointer to
data or flash memory.

> Can i then somehow tell if this pointer is in the lower or the upper
> 64k of my ATmega128?

All pointers are only 16bit. As I know, linker will place all data in
flash to the bottom 64k part. I don't know about any support from linker
for the data stored in flash memory above 64k.

> Is the linker at some level capable of resolving this?  It somehow
> has to be able to do this, it can resolve calls between the lower
> and upper 64k, so the information must be available somewhere.

Every instruction in AVR is 2byte or 4byte long and they are addressed
as words. Thus it is possible to address the whole 128kB of flash memory
with only 16bit pointers. Problem occurs only when data are read from


Branislav Katreniak
mailto: address@hidden

reply via email to

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