avr-chat
[Top][All Lists]
Advanced

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

[avr-chat] Simple endianess question


From: Rick Mann
Subject: [avr-chat] Simple endianess question
Date: Sat, 15 Apr 2006 23:26:08 -0700

All my life I've worked on big-endian machines (just about). Certainly all my C career.

In C, do I write hex constants for use on a little-endian machine as big-endian or little?

For example, if I want to mask off the high 4 bits of a 16-bit integer, would I write this:

uint_16 foo;

foo & 0x0FFF;

or would I write:

foo & 0xFF0F;

TIA,

--
Rick






reply via email to

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