Re: Problem with reading 4-byte floats from file on Intel
Re: Problem with reading 4-byte floats from file on Intel
- Subject: Re: Problem with reading 4-byte floats from file on Intel
- From: Doug McNutt <email@hidden>
- Date: Wed, 5 Dec 2007 20:49:34 -0700
At 01:06 +0100 12/6/07, jj wrote:
> > As far as I can tell, "dd" can only swap consecutive bytes. When you
>> are working with multi-byte quantities such as "small real", ABCD
>> becomes DCBA, not BADC. Hope that is clear.
>
>It wasn't till now... I thought the only difference between little and big
>endian was based on couples of bytes (that means I was expecting BADC from
>ABCD, instead of DCBA) ;-)
That seems to depend on whether you're using Microsoft (DCBA) or Sun Microsystems (BADC) rules for 32 bit quantities. Those were determined when machines were intrinsically 16 bits even though they had 32 bit accumulators. Think 68k Motorola.
Now with hardware running 32 bits and even 64 bits for access to their memory busses there are real questions about just what happens and it depends on the wiring of the circuit boards.. ABCD -> BADC or DCBA is just the tip of the iceberg. There are even more possibilities with 64 bits.
Counting from left to right seems so logical at first and that's the internet standard for transmission. But when you place volumes of an encyclopedia on the shelf you place the first page of volume one against the last page of volume two which is just the opposite of they way one reads a multivolume set. Intel and DEC just might be correct. (I avoid the term "right" here.)
Personally I have a problem with circuits consisting of binary flipflops arranged as a counter. It is so logical to have a transition of one flipflop toggle the next flipflop to its right in the schematic drawing. Logical signals go from from from left to right - don't they? But the result is that the most significant bit ends up on the right side which is not the way Arabic numerals work.
One more but, Arabic text reads from left to right. I opine that the values of bits in a byte ought to increase in the same direction that applies to bytes in a word but that still leaves options. Good old RS232 transmitted the least significant bit first. I don't yet know which way USB and Ethernet go.
I'm afraid we have a problem that will never go away. If anyone knows of an established, or even simply printed, standard please provide a URL
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden