This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
REAL meaning of little-endian and big-endian?
- From: =?gb2312?B?1cUgwcE=?= <johnsonest at hotmail dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 17 Dec 2002 11:37:31 +0800
- Subject: [ECOS] REAL meaning of little-endian and big-endian?
- Bcc:
hello,every one!
I have a "old" and "simple" question (i think like this before):
1 both endian mode only differ in byte order? how bit-order in one
byte?
2 if differ in bit order,one byte with little-endian come from
net,then how me(receiver host with big-endian) to read it correctlly? from
IP processing,it simplely read it! why?
3 if identical in bit order,why so define:
struct ip_hdr
{
#if BYTE_ORDER ==LITTLE_ENDIAN
unsigned char ip_version;4,
ip_hlen:4;
#elif BYTE_ORDER ==BIG_ENDIAN
unsigned char ip_hlen :4,
ip_version:4;
#endif
BRS/zhangliang
}
_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer: http://explorer.msn.com/lccn/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss