Endian wars - How to convert VAX double to x86 unix

Endian wars - How to convert VAX double to x86 unix

Post by Matt » Wed, 11 Apr 2001 10:44:06



Can someone provide me with some insight on how to convert a VAX double
(stored in a binary file from a compiled VAX basic program) to an x86 (or
any other architecture for that matter) Unix (specifically Linux) system?

What I have is a binary file stored by a VAX basic program running on VMS
7.1 on a VAX 6000-620.  I can read in this double, but the format is not the
same as expected by the x86 system.  Does anyone have any source available
to convert the double in C?  Even a format (or formula) for how VAX stores
doubles would be appreciated.  Thanks in advance.

PS:  Please CC to my e-mail if possible.

Matt

 
 
 

Endian wars - How to convert VAX double to x86 unix

Post by JF Meze » Wed, 11 Apr 2001 13:08:01



> Can someone provide me with some insight on how to convert a VAX double
> (stored in a binary file from a compiled VAX basic program) to an x86 (or
> any other architecture for that matter) Unix (specifically Linux) system?

On VMS:

HELP RTL CVT$ CVT$CONVERT_FLOAT  and then ask to see the arguments (will show
what convertsions are possible).

 
 
 

Endian wars - How to convert VAX double to x86 unix

Post by Robert Deining » Wed, 11 Apr 2001 14:04:13




> Can someone provide me with some insight on how to convert a VAX double
> (stored in a binary file from a compiled VAX basic program) to an x86 (or
> any other architecture for that matter) Unix (specifically Linux) system?

> What I have is a binary file stored by a VAX basic program running on VMS
> 7.1 on a VAX 6000-620.  I can read in this double, but the format is not the
> same as expected by the x86 system.  Does anyone have any source available
> to convert the double in C?  Even a format (or formula) for how VAX stores
> doubles would be appreciated.  Thanks in advance.

If you want the bit patterns for the various floating point formats, here
is one place they are documented:

http://www.openvms.compaq.com:8000/72final/5843/5843pro_008.html#55_v...

Actually, this isn't the best manual; these figures don't explain the bias
in the exponent, what happens to the leading "1" bit in the mantissa,
etc.  I prefer the stuff that appears in the language reference manuals --
Fortran, for instance.  You might want to hunt around the compaq web site
for the Fortran home page; I think the manuals are still on-line there.

Note that VAXen support 2 different double precision formats, D and G.

There are VMS library routines to do such conversions, and many of the
language compilers support conversions in the language these days.  But
these are not relevent if you have to do the conversion on a non-VMS
platform.

--
Robert Deininger

 
 
 

Endian wars - How to convert VAX double to x86 unix

Post by Hoff Hoffm » Thu, 12 Apr 2001 00:13:33



:Can someone provide me with some insight on how to convert a VAX double
:(stored in a binary file from a compiled VAX basic program) to an x86 (or
:any other architecture for that matter) Unix (specifically Linux) system?

  Please see the OpenVMS FAQ.

 ---------------------------- #include <rtfaq.h> -----------------------------
      For additional, please see the OpenVMS FAQ -- www.openvms.compaq.com    
 --------------------------- pure personal opinion ---------------------------
   Hoff (Stephen) Hoffman   OpenVMS Engineering   hoffman#xdelta.zko.dec.com

 
 
 

1. NT-Unix war is a contiunation of VMS-Unix war (?)


I was at a DEC/MS conference on Windows NT last fall, and DEC went out of their
way to say NT was the successor to VMS.

The one class on porting Unix to NT was worth going just to watch the hair
on the back of the Unix guys necks stand up <G>.

--
Tom Krotchko

"The information contained in this article represents my current view on
the issues discussed at the date of posting.  Because I must respond
to changing market conditions, it should not be interpreted to be a
commitment on my part, and I cannot guarantee the accuracy of any
information presented after the date of posting"

2. Modal Form not drawing content

3. NT-Unix war is a continuation of VMS-Unix war (?)

4. Those darn mouse button wars again (was-Re: discussion '

5. Big Endian vs little Endian

6. Excessive Use Of Computers?

7. Flipping from big-endian to little endian in C

8. Pascal: double converting to quadruple - losing precsion - where?

9. Converting VAX/VMS extracted text files -> Unix mail files

10. Unix wars/Trek story

11. OS-wars: Unix file system(s)

12. OS-wars: UNIX file system(s)