Xref: utzoo comp.arch:7785 comp.misc:4626 comp.lang.misc:2468 comp.protocols.misc:440 Path: utzoo!attcan!uunet!lll-winken!ames!elroy!cit-vax!wen-king From: wen-king@cit-vax.Caltech.Edu (King Su) Newsgroups: comp.arch,comp.misc,comp.lang.misc,comp.protocols.misc Subject: Re: "big endian" and "little endian" - first usage for computer Message-ID: <9036@cit-vax.Caltech.Edu> Date: 6 Jan 89 15:40:12 GMT References: <2766@cbnews.ATT.COM> <10147@well.UUCP> <13045@cup.portal.com> <20264@ames.arc.nasa.gov> <2695@rti.UUCP> Reply-To: wen-king@cit-vax.UUCP (Wen-King Su) Organization: California Institute of Technology Lines: 44 In article <2695@rti.UUCP> bcw@rti.UUCP (Bruce Wright) writes: >My immediate thought on seeing the VAX instruction set when it first came like a Fortran compiler to take a statement like: < > call sub (1) < >and pass a number to it (a longword - 4 bytes) which would be interpreted or a longword (4 bytes). This is not possible in a "big endian" machine - the low order byte. This cannot have anything to do with byte-ordering because the two byte-ordering conventions are totally symmetrical and isomorphic. Any difference between two machines must have been a result of some asymmetries that was imposed on on the machine when the machine was designed. In the example above, the asymmetry was imposed when the following question is answered: If a data unit is consisted of a sequence of bytes, what should the address of the data unit be: the address of the MSByte or the address of the LSByte. In VAX, and in most little-endian machines, the address of the LSByte was used to represent the address of the data unit. In 68K and most big-endian machines, the address of the MSByte was used. The choice is quite arbitrary, but the important thing is that it imposes an asymmetry. The supposed "advantage" of the little-endian byte-ordering is really the advantage of choosing the address of the LSByte to be the address of a multi-byte unit. We can build a big-endian machine with exactly the same advantage if we make the same choice for it as we have made for VAX. In this case, a 'long' that occupies byte address 0x20 0x21 0x22 0x23, will have 0x23 as its address. In general, given any little-endian machine, we can build a big-endian machine that is exactly as good as the little-endian machine (in fact, they will be duals), and vice versa. Byte-ordering should cease to be the focal point of any arguments; talks about the decisions that lead to the asymmetries should replace it. -- /*------------------------------------------------------------------------*\ | Wen-King Su wen-king@vlsi.caltech.edu Caltech Corp of Cosmic Engineers | \*------------------------------------------------------------------------*/