64 bit architectures and C/C++

Dave Scidmore daves at ex.heurikon.com
Wed May 8 14:27:34 AEST 1991


>rli at buster.stafford.tx.us (Buster Irby) writes:
>>An Intel or BIG_ENDIAN machine stores the
>>bytes in reverse order, while a Motorolla or LITTLE_ENDIAN
>>machine stores the bytes in normal order (High to low).

In article <13357 at goofy.Apple.COM> turk at Apple.COM (Ken Turkowski) writes:
>You've got this perfectly reversed.  Motorola is a BIG_ENDIAN machine,
>and Intel is a LITTLE_ENDIAN machine.  Additionally, there is no
>such thing as "normal".

Exactly. Both conventions have good points and bad points. The "normal"
Motorolla convention starts to look a little less normal when dynamic
bus sizing is required, in which case all byte data comes over the most
significant data bus lines. In addition big endian machines have values
that expand in size from the most significant location (i.e. two bytes
values at location X have least significant bytes in a different location
than four byte values at the same location). On the other hand the little
endian convention looks odd when you do a dump of memory and try to find long
words within a series of bytes.

In the end you can make either convention look "normal" by how you draw
the picture of it. For example which of these is normal for storing the
value 0x12345678 ?

Motorola:	Location	0	1	2	3
		Bytes		0x12	0x34	0x56	0x78

Intel:		Location	3	2	1	0
		Bytes		0x12	0x34	0x56	0x78
--
Dave Scidmore, Heurikon Corp.
dave.scidmore at heurikon.com



More information about the Comp.lang.c mailing list