[En-Nut-Discussion] Reading Program Memory Arrays
Harald Kipp
harald.kipp at egnite.de
Mon Oct 7 11:38:32 CEST 2002
>
>What would be fantastic would be efficient routines to do the following.
> u_char uchar_P( u_char *p_uchar );
> u_short ushort_P( u_short *p_ushort );
> u_long ulong_P( u_long *p_ulong );
>
>Then it would be possible to do something like this.
> a = b + ushort_P( &c ) + d;
>This is a lot easier to read and understand.
There has been a discussion in the AVRGCC mailing list,
wether the compiler should be able to automatically
detect ROM based variables and generate the proper
code.
I'm not sure about such a feature. One advantage
of C is, that it does _not_ hide everything. The
language is not only a high level language but also
a highly portable assembly language.
Harald
More information about the En-Nut-Discussion
mailing list