From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX"  8-JUN-1992 09:26:10.92
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: Converting VMS time

In article <1992Jun4.215947.23585@interlan.Interlan.COM>, davis@interlan.Interlan.COM (Mike Davis) writes:

|> I am trying to convert VMS format time into C time_t time.

You could try the following -- it's the manly way to do it :-)

Keep in mind that VMS time is 64-bit, time_t is 32-bit.

If you take the time to add comments or convert it to C,
please mail me a copy.

;
; TIMECVT.MAR
; by some generous but unremembered person, at some unknown time
;
; Convert between unix and vms time formats
;
	.title	timecvt
;
;  unixtime = vms2unix(vmstime)
;
	.entry	vms2unix,^m<>
	movq	@B^4(ap),r0
	subl2	#^x4BEB4000,r0
	sbwc	#^x007C9567,r1
	ediv	#10000000,r0,r0,r1
	ret
;
;  unix2vms(unixtime,vmstime)
	.entry	unix2vms,^m<>
	emul	@B^4(ap),#10000000,#0,r0
	addl2	#^x4BEB4000,r0
	adwc	#^x007C9567,r1
	movq	r0,@B^8(ap)
	ret
;
	.end

jim mullens
mullens@jamsun.ic.ornl.gov (128.219.64.31)
voice: 615-574-5564

