This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: REAL meaning of little-endian and big-endian?


The bit/nibble order is not affected. For more info, see link below:
http://www.byteswap.net/mikesnotes/2002/getting-started/byteorder.html



>-----Original Message-----
>From: johnsonest@hotmail.com [mailto:johnsonest@hotmail.com]
>Sent: Tuesday, December 17, 2002 9:08 AM
>To: ecos-discuss@sources.redhat.com
>Subject: [ECOS] REAL meaning of little-endian and big-endian?
>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


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]