Path: utzoo!attcan!uunet!husc6!ukma!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.sys.apple Subject: Re: Long and short integers Message-ID: <8971@smoke.BRL.MIL> Date: 24 Nov 88 02:42:33 GMT References: <8960@smoke.BRL.MIL> <8811231628.AA10036@hub.ucsb.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 40 In article <8811231628.AA10036@hub.ucsb.edu> bfox%cornu@hub.ucsb.edu writes: > From: Doug Gwyn > In article <8811221659.AA15060@hub.ucsb.edu> bfox%cornu@hub.ucsb.edu writes: > >Hah! That's pretty funny. > >In the Apple, the MSB is the leftmost bit in the byte. > That's even funnier! > ASL foo ;multiply foo by 2 by arithmetic shifting LEFT. Of course, bytes don't have left and right sides. That's purely an artifact of one way of drawing diagrams of them on paper. Putting the MSB on the left in such a diagram is consistent with conventional (Arabic) positional numeric notation. When dealing with matters of "reality", it is extremely important to distinguish between things that concretely exist and things that are just part of our way of describing what exists. Instead of "first" (implying time sequencing) or "left" (implying spatial arrangement), one should talk about "lowest-addressed" or "least significant", both of which have physical/mathematical significance. In the majority of modern architectures, when several bytes are clumped into a word by the hardware, the lowest-addressed byte contains the most significant bits of the word (considered as an integer). The 65xx, PDP-11, VAX, and NS32xxx families follow the opposite convention. Actually, PDP-11 hardware support (FP11) for 32-bit integers is a crazily scrambled order due to the FPU designer thinking big-endian while the CPU designer thought little-endian. The VAX (also the PDP-11 Fortran compiler!) straightened out the integer byte order. The PDP-11 Fortran compiler is a good example of how much of this stuff is convention; although the only hardware support for 4-byte integers used one order, the compiler used a different storage order (and swapped it around when necessary during computation). As you note with your example, hardware designers often don't keep their sequencing concepts straight. That may help to explain why there are so many poor choices made by computer architects, for example use of big-endian byte suborder in the MC680x0. By the way, time sequence IS important in bit-serial communication.