Subject: byte swapping subroutines needed

From: pence at heawk1.gsfc.nasa.gov ( William Pence)
Date: 18 Nov 91 23:02:00 GMT

Can anyone tell me where I can find some efficient code for byte
swapping on  VAX/VMS  and DECstations machines?  Ideally I would like 
assembly lanuage routines which are callable from Fortran to swap the
byte order in an array of Integer*2 data, and to reverse the byte order
in an array of Integer*4 data (from 1234 to 4321).

I also need an efficient routine to convert between the single and double
floating point formats used on a VAX and the IEEE formats used by
FITS.  It would be useful if these routines also handled the IEEE
special values such as NaN, Infinity, etc.

Thanks in advance for any help.

---------------------------------------------------------------------------
Bill Pence                          pence at tetra.gsfc.nasa.gov
HEASARC/GSFC                        LHEAVX::PENCE
---------------------------------------------------------------------------