ts-7000
[Top] [All Lists]

Re: [ts-7000] Endianess Problem

To:
Subject: Re: [ts-7000] Endianess Problem
From: David Hawkins <>
Date: Mon, 23 Mar 2009 14:23:19 -0700
Hi Adriano,

> I'm having some problems with arm endianess of floating types.
> 
> For example, the "double" value 10.0:
> my PC writes it to a file:
> 0x00.00.00.00.00.00.24.40
> while the TS-arm writes:
> 0x00.00.24.40.00.00.00.00
> 
> So, when arm reads a binary file written by a PC it interprets a wrong value, 
> and vice-versa. This causes a lot of problems when using third part libraries 
> and standards.
> 
> If anyone wants to check, I attached a program to illustrate it. Running it 
> on PC and on ARM will show the numbers above.

This is a standard problem with machine-to-machine
communications of data types. The general solution is
to use a machine-independent specification of the binary
type, and communicate using that, eg.

1) XDR External Data Representation
    - basically everything is big-endian

2) CORBA Common Data Representation (CDR)
    - endian flag indicates whether data is big
      or little endian, and the 'reader makes right',
      i.e., if the reader is different it has to
      convert the data

MATLAB data files are also defined to be machine independent.

So you haven't stumbled on something new, you just have to
decide what solution will work for you.

Personally most of my development uses the ACE C++ library,
and I use its C++ CDR encode/decode functions to transport data
between big-endian PowerPc processors and little-endian x86
processors.

Cheers,
Dave


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU