[mod.computers.vax] How do I do quadword arithmetic

SYSTEM@seivax.pnet (11/14/86)

Gentlefolk-

I have an application that gets the date of a library module as
a quadword (64 bit system time), and I would like to compare this
to a file time obtained using the VAX C stat() call, which returns
(among other things) the mod time as a 32 bit integer. The 64 bit
system time is in 100's of nanoseconds since 1858, while the
32 bit C time is in seconds since 1970.

I have looked through various doc sets to find out how to do quadword
arithmetic. It's too inconvenient to convert all the C times to
64 bit times (I could do it converting to ASCII, editing, and using
SYS$BINTIM, but there are reasons enough not to do that). I'm not
concerned with using FORTRAN if the facilities exist, and if I could
do it in C that would be best. I can always go to MACRO, but I've never
done any in VAX-11 and it doesn't seem in my best interests to learn
it just to do bit-twiddling. Anyone got any ideas, tips, or suggestions?

FYI- The arithmetical operations are:
        o Start with 64 bit system time format
        o Use SYS$BINTIM to get 64 bit system time for
1-JAN-1970.
        o Subtract 1-JAN-1970 from the time
Now I have the time based according to the C standard, so...
        o Divide by 10,000,000 to convert from 100's of nanoseconds
          to seconds. Voila!

ADthanksVANCE,
Todd Aven
the Softwear Sweatshop
<aven@umdhep.bitnet>
<todd@cincom.umd.edu>

Pyoung.pasa@XEROX.COM (11/17/86)

Hi,

In VMS PL/I we use LIB$SUBX to do quadword arithmetic on 64-bit time
values and LIB$EDIV to convert the quotient to something we can print
(e.g. seconds).

Phil Young