[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PDP/Vax/Alpha Well Ordered Little Endians
From: |
james hanratty |
Subject: |
PDP/Vax/Alpha Well Ordered Little Endians |
Date: |
Mon, 29 Nov 2004 18:26:26 -0800 (PST) |
Hi,
I coded on PDP-11s from 1974, on Vaxs from 1982, and have had a little to do on
Alphas in the last few years.
The DEC machines are all well behaved Little-Endians, not NUXI as shown in many
of the include files in LINUX.
I think perhaps the root of the mis-understanding comes from
1) the ordering of bytes/words/double word and how they are drawn in memory
layouts. If someone is unfamiliar with little endians, bad information is
assumed and propogated.
2) the confusion of byte and numeric values (HEX). 1234x is stored as 3412 But
this is not byte ordering-- this is normal little endian numbering.1234 is a 16
bit number, not a 32 bit number as indicated in the byte ordering of PDP-ENDIAN
= 3412.
byte word d-word q-word
a
b ba
c
d dc dcba
e
f fe
g
h gh ghfe ghfedcba
DEC labeled their dumps with the address in the midst of the dump data
(assuming hex in place of the octal of PDP/VAX):
.byte 'A 41 addr
.byte 'B 42 addr+1
The above text string becomes
Label:
.ascii "ABCDEFGH" 4847464544434241 :addr ABCDEFGH
^ ^^
^ /// ADDR
^ ^^
^ // ADDR+1
and so forth. Label: has the address of addr and is where A resides.
The memory locations of the data in a string def reads reversed in the order of
memory location from the visual order of the string. In the ascii dump, the
order increases from the addr on the dump and is in the same order as the
string human ordering.
This is all normal little-endian.
The several swab instructions are needed to convert from "12345678" to
"87654321". The existentce of these instructions and the use of octal may have
helped create the NUXI misinformation. Numeric values of 12345678 and 87654321
do not represent the byte order. 12-34-56-78 does.
The PDP_ENDIAN definition of 3412 violates both the little endian nature of
these machines where the last byte contains the even/odd (parity) of the number
(1) and the first bit/byte the sign (4). Does 34-12x represent a number and not
the byte order??? byte order of 1234 is really 01-02-03-04 or in DEC
04-03-02-01.
I know some of ATT's unix machine from the early 70's are still
running--although they are being replaced with Intel machines--same endian!
Hope this helps.
Jim Hanratty
---------------------------------
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- PDP/Vax/Alpha Well Ordered Little Endians,
james hanratty <=