David Kelly wrote:
On Apr 16, 2006, at 2:02 AM, Rick Mann wrote:
On Apr 15, 2006, at 23:53 , Russell Shaw wrote:
it is the same as foo & 4095. If endian mattered, you'd have to
change every number in your program to compile it on a different endian machine.
Yes, of course. It makes sense, I just needed the sanity check.
Endian does matter and you have to compensate for every machine you
target. Look for macros for "network byte order", these are big- endian
and when used on a big-endian machine the data falls thru and nothing
is done, but on a little-endian machine the bytes get re- ordered.
Just off hand I don't find any endian macros in avr-gcc.
It matters only where memory layout matters such as for writing
to a memory-mapped peripheral. With that, you have to think about
masking physically high-order or low-order bits. For numerical
values used only within a program where you want to mask the
numerical high/low-order bits, endianess doesn't matter, which
is what the OP seemed to be asking about.
_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat