This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: packing/unpacking 4-octet longs
- From: Lars Brinkhoff <lars dot spam at nocrew dot org>
- To: Richard dot Earnshaw at arm dot com
- Cc: Andrew Cagney <ac131313 at cygnus dot com>, twall at oculustech dot com, gdb at sources dot redhat dot com
- Date: 05 Dec 2001 19:09:26 +0100
- Subject: Re: packing/unpacking 4-octet longs
- Organization: nocrew
- References: <200112051645.QAA06737@cam-mail2.cambridge.arm.com>
Richard Earnshaw <rearnsha@arm.com> writes:
> > > 0xaabbccdd is stored as 0xbb 0xaa 0xdd 0xcc.
> > I'm pretty sure that there is another very old wacko architecture
> > that did something similar to this, I'm trying to remember which.
> > pdp11?
> PDP11, I think.
Yes. That ordering is sometimes called "PDP-endian" (incorrectly
in my opinion, since there are many different PDP architectures).
> It's a bit before my time, but IIRC it's because earlier PDPS (8?
> 9?) were 16-bit machines, so there wasn't really any concept of
> word-ordering beyond that: 16-bit words were little-endian, but the
> most significant word was always at the lowest address (or the other
> way around).
Not quite. All earlier PDP architectures were word-adressable. PDP-1
and PDP-4/7/9 had 18-bit words, PDP-5/8 had 12-bit words, and PDP-6/10
had 36-bit words. I don't know if the other machines had multiple-word
operands, but the PDP-6/10 stored the most significant word first.
PDP-11 was the first 16-bit machine, and the first byte-addressable.
--
Lars Brinkhoff http://lars.nocrew.org/ Linux, GCC, PDP-10
Brinkhoff Consulting http://www.brinkhoff.se/ programming