Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Alvin Starr <alvin@iplink.net>
To: Janice McCarthy <janice@acpub.duke.edu>
Cc: axp-list@redhat.com
Subject: Re: OFF-TOPIC: little-endian vs. big-endian conversion
Date: Fri, 3 Apr 1998 12:54:04 -0500 (EST)	[thread overview]
Message-ID: <Pine.OSF.3.91.980403124956.8092H-100000@caesar.iplink.net> (raw)
In-Reply-To: <Pine.SOL.3.91.980403120737.15690D-100000@godzilla2.acpub.duke.edu>

On Fri, 3 Apr 1998, Janice McCarthy wrote:

> Hello all!  I know this is off-topic, but I am getting desperate.  I have 
> some binary files that were generated on an sgi, but I need to read them 
> on my Alpha (UDB with linux 2.0.20).  I have learned that the sgi is 
> big-endian, where the alpha is little-endian.  The files are in the 
> following format:
> 
> 1 int followed by 52 doubles - repeated 20,000 times.

Ints(32bit) should be swaped 

1,2,3,4 => 4,3,2,1 in 4 byte chunks

If I remember correctly ieee is defined in a endian insensitive format. 
That is you should be able to read it correctly on all machines. But it 
has been a long time and I may have forgotten somthing.
If the doubles have to be swaped you should be swaping the order

1,2,3,4,5,6,7,8 => 8,7,6,5,4,3,2,1 in 8 byte chunks

Alvin Starr                   ||   voice: (416)493-3325
Interlink Connectivity        ||   fax:   (416)493-7974
alvin@iplink.net              ||


  parent reply	other threads:[~1998-04-03 17:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-03 17:15 OFF-TOPIC: little-endian vs. big-endian conversion Janice McCarthy
1998-04-03 17:33 ` Uncle George
1998-04-03 17:54 ` Alvin Starr [this message]
1998-04-06 12:39 ` Mike Howard
  -- strict thread matches above, loose matches on Subject: below --
1998-04-03 17:27 Greg Lindahl
1998-04-03 17:51 ` Michal Jaegermann
1998-04-03 17:54 Greg Lindahl
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox