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

Re: [SLUG] Endian-ness.



Endian-ness is not the arrangement of the bits, but rather of the bytes
within a multi-byte type.

For a 4 byte type (such as int on a 32 bit machine):

byte A is bits 7-0
byte B is bits 15-8
byte C is bits 23-16
byte D is bits 31-24

Little-endian would arrange this in memory as ABCD


low address            high address
00000000 11111100 22221111 33222222
76543210 54321098 32109876 10987654
   A        B        C        D

Intel chips use this format.


Big-endian would arrange this in memory as DCBA

low address            high address
33222222 22221111 11111100 00000000
10987654 32109876 54321098 76543210
   D        C        B        A

Motorola chips use this format.

Matthew
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text