.MCALL .MODULE .MODULE TIME1,VERSION=03,COMMENT=,IDENT=NO,LIB=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .SBTTL TIME1 - FORTRAN CALLABLE SUBROUTINE ; ; TIME CONVERSION SUBROUTINE FOR SYSLIB ; ; CALCULATES THE TWO-WORD INTEGER TIME BETWEEN THE CURRENT TIME ; AND A SPECIFIED TIME-OF-DAY. USED BY CALL UNTIL(...) AND CALL ; SCHED(...) TO CALCULATE THE APPROPRIATE TIME INTERVAL. ; ; INPUTS: ; USES THE NEXT FOUR ARGUMENTS FROM THE ARGUMENT LIST, ; AS IHRS, IMIN, ISEC, ITCK. ; ; OUTPUTS: ; (R2,R3) = TIME INTERVAL DESIRED ; ; DESTROYS: R0,R1,R2,R3,R4 ; UPDATES R5 BEYOND NEXT FOUR ARGUMENTS ; ; CALLING SEQUENCE: JSR PC,$TIME1 ; ; MAS .PSECT SYS$I .GLOBL $TIME$, $GVAL $TIME1::JSR PC,$TIME$ ;SET (R0,R1) = DESIRED TIME-OF-DAY MOV R0,R2 ;COPY IT INTO (R2,R3) MOV R1,R3 CMP -(SP),-(SP) ;ALLOCATE SPACE FOR CURRENT TIME-OF-DAY MOV SP,R0 MOV R0,-(SP) ;MACHINE-INDEPENDENCE MOV #21*400,-(SP) ;SET .GTIM CODE MOV SP,R0 ;R0 -> ARG BLOCK EMT 375 ;.GTIM CMP (SP)+,(SP)+ ;DISCARD ARG BLOCK MOV (SP)+,R0 ;(R0,R1) = CURRENT TIME MOV (SP)+,R1 SUB R1,R3 SBC R2 SUB R0,R2 ;CALCULATE INTERVAL BPL 10$ ;IF IT ISN'T REALLY TOMORROW MOV #300,R0 ;CHECK CONFIG WORD FOR 50 CYCLE JSR PC,$GVAL BIT #40,R0 ;50 CYCLE CLOCK SYSTEM ? BNE 20$ ;YES IF NE ADD #15000,R3 ;IT IS - ADD 24 HOURS ADC R2 ADD #117,R2 10$: RETURN 20$: ADD #165400,R3 ;50 CYCLE CONSTANTS TO ADD ADC R2 ADD #101,R2 RETURN .END