[Top][All Lists]

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

Re: [avr-gcc-list] Access to constants via elpm

From: E. Weddington
Subject: Re: [avr-gcc-list] Access to constants via elpm
Date: Fri, 30 Aug 2002 09:24:15 -0600

On 30 Aug 2002 at 9:20, Roland Zitzke wrote:

> Hi,
> I am using an atmega 128 which has 128k of flash. gcc by default uses
> one 64k "bank" for code and the other 64k section for data. If I
> understand the mechanism correctly this allows for a maximum of 64k
> constants stored in flash. This limit is of cause set by the pointer
> length of 16 bit. I am now looking for a conveniant enhancement for
> the PRG_RDB instruction of the run-time library which uses the elpm
> instruction which would allow more than 64k constants in total. I am
> thinking of either a macro like #define PRG_RDB_E(symname, offset) ...
> which returns the byte found at symname + offset or two functions like
> #define GET_LONG_POINTER(symname) returning a 32 bit pointer to the
> symbols address and unsigned char PRG_RDB_E(unsigned long longpointer)
> which returns the byte found at *longpointer using the elpm
> instruction. I am not to handy with the constrains handling of gcc's
> assember. Does anyone have an idea or solution for this problem? This
> should may be even become part of the runtime library. Thanks Roland
> Zitzke
The PRG_RDB macro is a redefinition of the _LPM() macro which is 
defined in ina90.h. There is also the _ELPM() macro which is also 
defined in ina90.h. This is perhaps what you are looking for.


avr-gcc-list at http://avr1.org

reply via email to

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