comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Byte sex confusion
Date: 1997/05/08
Date: 1997-05-08T00:00:00+00:00	[thread overview]
Message-ID: <01bc5bfd$78858100$LocalHost@xhv46.dial.pipex.com> (raw)
In-Reply-To: 33716475.43A9@top.monad.net




Steven O'Neill <oneills@top.monad.net> wrote in article
<33716475.43A9@top.monad.net>...
> I have an interesting problem well known to anyone who has tried to
> develop on multiple platforms.  I have binary data that was recorded on
> a big-endian machine (SGI) which I am in need of reading on a
> little-endian machine (Intel).  The current method involves using C
> routines to fread the data into buffers and then casting the data into a
> variety of Ada records.  
> 
> This is a dangerous practice (its not my code) but it works fine as long
> as the layout of the records remain the same and the underlying data
> formats are consistent.
> 
> What I'm looking for are ideas on how to access this data in an easy anc
> consistent fashion on both architectures...  Any ideas?


I'm currently fascinated by Intel's BSWAP instruction (little things please
little minds, I suppose :-). If you have package Machine_Code available,
maybe this one would solve your problem.

Incidentally, for those readers wondering, the 'sex' in the subject line
refers (I assume, anyway) to the old Intel "sign exchange" instruction,
which they were going to call SEX, but got cold feet just before
publication (and called it CBW/CWD instead - not the same!)

Nick.





  reply	other threads:[~1997-05-08  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-07  0:00 Byte sex confusion Steven O'Neill
1997-05-08  0:00 ` Nick Roberts [this message]
1997-05-09  0:00   ` Roy Grimm
1997-05-09  0:00   ` Robert Dewar
1997-05-14  0:00     ` Steve Sciance
1997-05-09  0:00 ` Jeff Carter
1997-05-10  0:00   ` Robert Dewar
1997-05-11  0:00   ` Matthew Heaney
1997-05-11  0:00   ` Oliver Kellogg
replies disabled

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