From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b265a36017ac1dd0 X-Google-Attributes: gidfee84,public From: lionel@quark.enet.dec.com (Steve Lionel) Subject: Re: Endian problems with the Alpha Date: 1996/05/04 Message-ID: <4mea6v$tg1@zk2nws.zko.dec.com>#1/1 X-Deja-AN: 153708647 references: <31883EE2.59FEC2A2@rt66.com> organization: Digital Equipment Corporation - Nashua, NH reply-to: lionel@quark.enet.dec.com newsgroups: comp.unix.osf.osf1 In article <31883EE2.59FEC2A2@rt66.com>, Kevin Barrett writes: >Does anyone know of >a facility provided by OSF's C compiler (or the Alpha itself) to automatically >operate on big-endian values? Might there be a library of good (efficient) >conversion routines we can use? We also have to do some conversions of >floating-point formats (IEEE/IBM). Any response would be appreciated... The C compiler doesn't provide this (though Fortran does if you use unformatted I/O.) Endian-conversion is a rather simple task, especially when done with shifts and masks. There is a cvt_ftof routine (see the man page for it) that will convert between IEEE and IBM System\360 format (among others). IBM workstations use big-endian IEEE. I think that cvt_ftof may even be able to do endian-conversions on IEEE floats. Steve Lionel mailto:lionel@quark.zko.dec.com Fortran Development http://www.digital.com/info/slionel.html Digital Equipment Corporation 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" For information on Digital Fortran 90, see http://www.digital.com/info/hpc/f90/