[Simh] PDP-11 and VAX data format conversion routines

Larry Baker baker at usgs.gov
Thu Mar 3 14:24:31 EST 2016


I also wrote a library of routines to convert (PDP-11 and) VAX integer and floating-point data to/from IEEE format, libvaxdata, which you can access at https://pubs.er.usgs.gov/publication/ofr20051424 (which leads you to the actual files at http://pubs.usgs.gov/of/2005/1424/).  The PDF report is at http://pubs.usgs.gov/of/2005/1424/of2005-1424_v1.2.pdf.  Unlike the code, in the GNU compiler suite, or example, which is not a complete implementation, my code handles subnormal representation, NaNs and infinities.  Since it is the work if the US Government, this code is in the public domain, so you can copy it as you wish.  You cannot copyright it.  I.e., you cannot republish it with an open-source license attached, for example.  I do not know what the law is if you create your own derivative work.  Here's the Abstract.

> ABSTRACT
> 
> libvaxdata provides a collection of routines for converting numeric data—integer and floating-point—to and from the formats used on a Digital Equipment Corporation1 (DEC) VAX 32-bit minicomputer (Brunner, 1991). Since the VAX numeric data formats are inherited from those used on a DEC PDP-11 16-bit minicomputer, these routines can be used to convert PDP–11 data as well. VAX numeric data formats are also the default data formats used on DEC Alpha 64-bit minicomputers running OpenVMS
> 
> The libvaxdata routines are callable from Fortran or C. They require that the caller use two's-complement format for integer data and IEEE 754 format (ANSI/IEEE, 1985) for floating-point data. They also require that the "natural" size of a C int type (integer) is 32 bits. That is the case for most modern 32-bit and 64-bit computer systems. Nevertheless, you may wish to consult the Fortran or C compiler documentation on your system to be sure.
> 
> Some Fortran compilers support conversion of VAX numeric data on-the-fly when reading or writing unformatted files, either as a compiler option or a run-time I/O option. This feature may be easier to use than the libvaxdata routines. Consult the Fortran compiler documentation on your system to determine if this alternative is available to you.
> 
> 
> 1Later Compaq Computer Corporation, now Hewlett-Packard Company
> 
Larry Baker
US Geological Survey
650-329-5608
baker at usgs.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20160303/6fbc867a/attachment.html>


More information about the Simh mailing list