[En-Nut-Discussion] Reading Program Memory Arrays

peter.scandrett at transport.alstom.com peter.scandrett at transport.alstom.com
Tue Oct 8 02:56:25 CEST 2002


Harald,

Thankyou for replying yet again. Sorry for not getting back earlier, but 
my e-mail was down on Thursday, I took Friday off to spend some time with 
my wife, and Monday was a public holiday. It's such a tough life here!

Since I last wrote I realised there was a byte version of what I was 
talking about. You actually used it in your example. It's form is
        val_8  = PRG_RDB( &byte_array  [ ii ] );

What I was wondering was if there were 16 bit and 32 bit versions of this 
routine. Rather than the cumbersome names I used before, I now suggest the 
following
        val_16 = PRG_R16( &ushort_array[ ii ] );
        val_32 = PRG_R32( &ulong_array [ ii ] );

Cheers,
Peter S

Peter Scandrett
Engineering Systems Department
ALSTOM Australia Limited
3 Bridge Street, Pymble, 2073, Australia
Phone (+612) 94 88 49 11      Fax (+612) 94 88 49 00
peter.scandrett at transport.alstom.com




Harald Kipp <harald.kipp at egnite.de>
Sent by: en-nut-discussion-admin at egnite.de
07-10-2002 07:38 pm
Please respond to en-nut-discussion

 
        To:     en-nut-discussion at egnite.de
        cc:     (bcc: Peter Scandrett/AUMIL01/Transport/ALSTOM)
        Subject:        Re[2]: [En-Nut-Discussion] Reading Program Memory Arrays



>
>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

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo/en-nut-discussion



CONFIDENTIALITY: This e-mail and any attachments are confidential and may 
be privileged. If you are not a named recipient, please notify the sender 
immediately and do not disclose the contents to another person, use it for 
any purpose or store or copy the information in any medium.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20021008/b3a2acd1/attachment.html>


More information about the En-Nut-Discussion mailing list