avr-gcc-list
[Top][All Lists]
Advanced

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

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


From: Roland Zitzke
Subject: [avr-gcc-list] Access to constants via elpm
Date: Fri, 30 Aug 2002 09:20:50 +0200

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

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



reply via email to

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