Path: utzoo!attcan!uunet!lll-winken!ames!xanth!mcnc!rti!xyzzy!throopw From: throopw@xyzzy.UUCP (Wayne A. Throop) Newsgroups: comp.arch Subject: Re: Endian wars Message-ID: <3089@xyzzy.UUCP> Date: 27 Jan 89 15:30:13 GMT References: <6133@columbia.edu> <3505@tekcrl.CRL.TEK.COM> Organization: Data General, RTP NC. Lines: 31 > stevev@tekchips.CRL.TEK.COM (Steve Vegdahl) >> eppstein@garfield (David Eppstein) >> Big endian lets you use integer comparison instructions to do string >> compares a word at a time. > This depends on how strings are represented. [...] > consider a representation of strings where the characters are laid out > "backwards" in memory; [...] > Now, big endian and little endian find their roles reversed WRT the > above optimization. True, true... BUT this role reversal is by no means "free". Now the little-endian-but-backwards-strings machine cannot use the same routines to allocate, read, write, and otherwise treat as an uninterpreted bucket of bits strings and non-strings. All manipulators of pointers will have to "know" what they point at. There will be much "duplicated" code on this machine relative to a machine where all memory-chunks are addressed by their "least" (or greatest) component-address. And of course all the attendant bugs that occur when a pointer of one kind is fed to a routine expecting the other kind. Not that these problems are insolvable. It may (possibly) even be worthwhile to do things this way. But the big-endian way is still superior in this respect, and making this change is only trading one difficulty for another. (Of course, the little-endian way is superior in other respects.) -- There are two ways to write error-free programs; only the third one works. --- Alan J. Perlis -- Wayne Throop !mcnc!rti!xyzzy!throopw