Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site twitch.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!twitch!grt From: grt@twitch.UUCP ( G.R.Tomasevich) Newsgroups: net.lang.c Subject: PDP-11 byte order in longs Message-ID: <356@twitch.UUCP> Date: Tue, 8-Apr-86 13:16:42 EST Article-I.D.: twitch.356 Posted: Tue Apr 8 13:16:42 1986 Date-Received: Fri, 11-Apr-86 01:20:15 EST References: <> <7046@cca.UUCP> <1223@ulysses.UUCP> Organization: AT&T Bell Labs, Holmdel Lines: 21 > > Well, no, little-endian came about because the engineers at DEC > > who designed the PDP-11 made an arbitrary decision that was not well > > thought out. I will not essay to defend the sanity of DEC engineers, > > Richard Harter, SMDS Inc. > > As an old PDP-11 hacker, I can't agree with the condemnation of the > DEC engineering decision. > Griff Smith AT&T (Bell Laboratories), Murray Hill I agree with Harter's complaint but for a different reason. The machine instruction ASHC, arithmetic shift combined, when given an even-numbered register, does a 32-bit shift, in which the lower-numbered register has the high-order bits. Who ordered that??? This seems to have led the C compiler writer to store longs with the shorts in big-endian order, even though the bytes of a short are stored in little-endian order. I see no reason for that convention being more convenient than strictly little-endian order, since there are no long move instructions. In other words, the byte order is 2,3,0,1 if you number from LSB. -- George Tomasevich, ihnp4!twitch!grt AT&T Bell Laboratories, Holmdel, NJ