Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!cwjcc!mailrus!tut.cis.ohio-state.edu!rutgers!elbereth.rutgers.edu!ron.rutgers.edu!ron From: ron@ron.rutgers.edu (Ron Natalie) Newsgroups: comp.protocols.misc Subject: Re: big endians are good for networking, huh? Message-ID: Date: 25 Jan 89 18:11:19 GMT References: Organization: Rutgers Univ., New Brunswick, N.J. Lines: 19 > On a 68000 or MIPSM, "up" is "right" and since the "<<" is "up" it's actually > "right" on those machines. In my case, if I compared "longports" to something > extracted via the "overlay the u_long array" method, it would be different. Untrue, C is not little endian by nature. On the 68000 (and with every other machine that I've seen) the bits in a word are presented as if they were a binary number. That is, the least significant bits are on the right, the most significant on the right. Shifts and rotates are referenced to this. On the 68000, the rotate left/right instructions behave as you would expect with this implementation. Moving in the "right" direction moves bits towards the more significant part of the word and the "left" direction is towards the least signficant part. While various machines number their bits differently (for example, IBM numbers the most significant bit 0 and the least 31, where as 68000's and VAX's use little numbers for low order bits, and I think that the Univac numbers them from 1 rather than 0), they all represent them as having the LSB on the RIGHT. What makes them big or little endian is how they map this representation into the machines address space. -Ron