On Fri, 16 Jun 2017 17:56:42 -0500, Paul Gilmartin
([email protected]) wrote about "Re: RFE?
xlc compile option for C integers to be "Intel compat" or Little-Endian"
(in <[email protected]>):

> On Fri, 16 Jun 2017 22:56:18 +0100, David W Noon wrote:
[snip]
>> The endianness is determined by where the MSB and LSB are stored. On IBM
>> machines the MSB is in the left-most byte of the register and the LSB in
>> the right-most byte. That is big-endian.
>>
>> Ascribing indices to the bit positions in either order makes no
>> difference. It is the order of *storage* that determines endianness.
>>
> ???  We're talking about *registers* here.  See your first paragraph I quoted.
> 
> What do you mean by "the order of *storage*" of bits in a register
> other than how one ascribes indices?  If I rotate my laptop 180° on
> my desk, have I swapped the left end and the right end?

The bytes are ordered, otherwise shift instructions would produce rather
random results. The bits are ordered within bytes; that ordering remains
fixed (i.e. bits are never reversed when loading/storing), even during
shift instructions as bits are shifted in and out.

You can see the byte ordering when coding an ICM or STCM instruction.
These instructions have a bit mask to select affected bytes and the
bytes are ordered in the same order as the bit mask -- and it is big-endian.

>> The computers perform their arithmetic in whatever byte order the
>> hardware designers choose.
>>
> If they operate serially, it's simplest if they start at the less significant 
> end.

True, but a serial ALU can start at the LSB end, even on big-endian systems.

>> My first system was a clone of an IBM 360. I felt dismay when I first
>> read a core dump from a PDP-11.
>>
> That's one data point confirming my conjecture that people perceive
> the conventions they learned earliest as Natural Law.

I never cited it as "Natural Law".

>> Fortunately, DEC realized that their design was crap and added a
>> hardware instruction to put 16-bit binary integers into big-endian
>> order; it had the assembler mnemonic SWAB (SWAp Bytes). The company I
>> worked for in the 1970s exchanged data between many PDP-11s and a
>> central IBM 370, usually without problems.
>>
> EBCDIC?  Well, not if your data were entirely numeric.  Hexadecimal floating 
> point?

No.

Text was in ASCII and binary data as integers; these PDP-11s did not
have FPUs, so no floaters were used even in emulation.

Note also that we did not use DECtape drives to exchange with the
mainframe. We used a 9-track tape transport (spring tensioners, no
vacuum columns) that wrote at 800BPI. The tapes had ANSI labels.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
[email protected] (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to