[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Order of bytes
From: |
Gre7g Luterman |
Subject: |
Re: [avr-gcc-list] Order of bytes |
Date: |
Sun, 7 Oct 2007 10:02:04 -0700 (PDT) |
AVR is a little-endian processor family, so the first
byte in memory of a multi-byte value is the LSB. That
would be by0 in your example since union will not
re-arrange anything on you. by3 would be the MSB.
HTH,
Gre7g
--- Royce Pereira <address@hidden> wrote:
> Hi,
>
> Sorry for my rusty C,
>
> In the following union
>
> union
> {
> uint32_t as_ul;
>
> struct
> {
> uint8_t by0;
> uint8_t by1;
> uint8_t by2;
> uint8_t by3;
> }
> asbyte;
> }
> lvar;
>
> What is the order of the bytes? by0= MSB, or by3=
> MSB ?
> AVR stores low byte at the lower address. Is this
> order retained in the above example?
>
> Thanks,
>
> --Royce
>
> --
> Using Opera's revolutionary e-mail client:
> http://www.opera.com/mail/
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
>
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com