From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f8a1,3f733b75cefd0ba6 X-Google-Attributes: gid10f8a1,public X-Google-Thread: 11cfa8,3f733b75cefd0ba6 X-Google-Attributes: gid11cfa8,public X-Google-Thread: 1164f8,3f733b75cefd0ba6 X-Google-Attributes: gid1164f8,public From: putleya@logica.com (Adrian Putley) Subject: Re: DEC Alpha-> Vax conversion Date: 1997/03/20 Message-ID: <5grfba$11r0_001@logica.co.uk>#1/1 X-Deja-AN: 227075240 References: <5gr59p$ich@romeo.logica.co.uk> <5grd87$lj5@romeo.logica.co.uk> Organization: Logica UK Ltd Newsgroups: logica.comp,comp.sys.dec,vmsnet.alpha >>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 ------