Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: putleya@logica.com (Adrian Putley)
Subject: Re: DEC Alpha-> Vax conversion
Date: 1997/03/20	[thread overview]
Message-ID: <5grfba$11r0_001@logica.co.uk> (raw)
In-Reply-To: 5grd87$lj5@romeo.logica.co.uk


>>Roger Peden wrote:
>>>Does anyone have any experience of converting 64 bit files on an Alpha back 
>>>to a 32 bit VAX readable form?
>>
>>	I don't see the problem.  Can you explain in more detail?
>>
>
>As I understand it (I am dealing with this problem second hand), our code has 
>been compiled to use IEEE standard floating point. Thus the numbers generated 
>in the binary file are stored in this 64 bit format.
>
>When this file is copied to the VAX to be read by the software there, it 
>cannot be read because the VAX expects 32 bit number formats. (I expect there 
>would be a similar problem if it was copied to , say , a PC)

There is no generic way of doing this.  You will need to know the exact format 
of the data in the file and to understand exactly which fields are affected in 
this way.

What I expect you will find is that numerically-encoded items (eg integers as 
well as floating point) are held in different-sized formats on the 64-bit 
Alphas as compared to VAXes.  The exact details will depend on how the file is 
written and what language the application is in.  

For example, a C/C++ long is also 4 bytes (32 bits) on a VAX but 8 (64) on an 
Alpha. If the program is setting up the fields of a data structure in memory 
and then writing this out eg using 'write', then the size and shape of the 
data will be different between the two platforms.

It may be simpler to modify the original application to keep the file format 
compatible, eg change the declarations of 'long' to 'int', which happens to be 
4 bytes on both platforms.

The only way to convert such files is to write a bespoke converter that 
understands the formats of the files in detail and explicitly converts the one 
to the other.

Finally, re floating-point formats, there is also a 32-bit IEEE standard 
format.  We used this all over the place in MC2000, eg between Alphas, MIPS 
systems, VAXes and Intel PCs.

HTH
Adrian

------------------------------------------------------------------------------
Adrian Putley             |  Logica UK Ltd, Medina House, Business Park 4,   |
putleya@logica.com        |  Randalls Way, Leatherhead, Surrey KT22 7TW, UK  |
(+44 171) 446 5715        |                               fax: 01372 227019  |
------------------------------ These are my opinions, not my employer's ------




  reply	other threads:[~1997-03-20  5:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-20  5:00 DEC Alpha-> Vax conversion Roger Peden
1997-03-20  5:00 ` Robert Koehler
1997-03-20  5:00 ` Dr Ivan D Reid, muSR Facility
1997-03-20  5:00   ` Roger Peden
1997-03-20  5:00     ` Adrian Putley [this message]
1997-03-25  5:00       ` Stephen Hoff Hoffman
1997-03-20  5:00 ` Jan Vorbrueggen
1997-03-21  5:00 ` Immo Huneke
1997-03-23  5:00 ` Boris Gubenko
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