.MCALL .MODULE .MODULE IUNTIL,VERSION=04,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 Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; ENVIRONMENT: ; ; This routine can be used by any job running in a single-job ; (SYSGENed with timer support) or multi-job environment. It ; uses "TRAP" to provide error processing. ; ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .TWAIT ; TWAIT programmed request. .MCALL SOB ; ; ; EXTERNAL REFERENCES: ; .GLOBL $ERRP0 ; Entry point to EMT error conversion routine. .GLOBL $NXVAL ; Entry point to next value routine. .GLOBL $SYSLB ; Include system library work area. .GLOBL $TIME1 ; Entry point to time conversion routine. .WEAK $MSARG ; Trap code for missing argument .SBTTL IUNTIL - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IUNTIL function suspends execution of the calling job until the ; specified time-of-day. Completion routines still continue to execute. ; ; CALLING SEQUENCE: ; ; i = IUNTIL( hrs, min, sec, tick ) ; ; INPUT PARAMETERS: ; ; R5 - address of IUNTIL's argument block ; ; 0(R5) - argument count of IUNTIL call ; 2(R5) - address of word containg integer number of hours ; 4(R5) - address of word containg integer number of minutes ; 6(R5) - address of word containg integer number of seconds ; 10(R5) - address of word containg integer number of ticks ; ; OUTPUT PARAMETERS: ; ; R0 - job sleep status ; ; RETURNED FUNCTION VALUE: ; ; 0 - normal return ; 1 - no queue element was available; unable to schedule request ; ; -- .PSECT SYS$I UNTIL:: IUNTIL:: MOV (R5)+,R4 ; R4(low byte) <- argument count. MOV R5,-(SP) ; Save pointer of 1st argument in call MOV #4,R3 ; Check that all IUNTIL arguments were passed 10$: CALL $NXVAL ; Was this argument passed by caller? BCS ERR ; If CS, error - an argument wasn't supplied SOB R3,10$ ; Checked all arguments in call? MOV (SP)+,R5 ; Restore pointer to 1st argument in call CALL $TIME1 ; Convert specified time to internal format ; delta time (result returned in R2 & R3) MOV R3,-(SP) ; Store low-order word of interval in TWAIT's ; two-word param-block MOV R2,-(SP) ; Store high-order word of interval in TWAIT's ; two-word param-block MOV SP,R2 ; R2 <- address of two-word interval to wait CMP -(SP),-(SP) ; Allocate space for TWAIT's argument block .TWAIT SP,R2 ; Suspend job execution for specified interval CALL $ERRP0 ; Get and convert any errors (status in R0) ADD #8.,SP ; Purge stack of all temporary storage RETURN ERR: TST (SP)+ ; Purge stack of temporary TRAP $MSARG ; Handle any missing arguments in call; RETURN .END