.MCALL .MODULE .MODULE ISCHED,VERSION=06,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 (SYSLIB) ; ; CALLABLE ENTRIES: ; ; ISCHED, ITIMER ; ; ENVIRONMENT: ; ; These routines can be used by any job running in a single-job or ; multi-job environment. They use "TRAP" to provide error processing. ; ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .MRKT ; MRKT programmed request. ; ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area. .GLOBL $NXADR ; Entry point to next address routine. .GLOBL $TIME1 ; Entry point to time interval routine .GLOBL $TIME$ ; Entry point to time conversion routine. .GLOBL $ERRP0 ; Entry point to EMT error conversion routine. .GLOBL $CMPLT ; Entry point to set-up linkage to a Fortran ; completion routine. .WEAK $MSARG ; Trap code for missing argument .SBTTL ISCHED,ITIMER - Fortran-callable subroutines ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The ISCHED function schedules a specifed Fortran routine to be run ; as an asynchronous completion routine at a specified time of day. ; ; The ITIMER function schedules a sepcified Fortran routine to be run ; as an asynchronous completion routine after specified time interval ; has elapsed. ; ; CALLING SEQUENCE: ; ; i = ITIMER( hrs, min, sec, tick, area, id, crtn ) ; ; i = ISCHED( hrs, min, sec, tick, area, id, crtn ) ; ; INPUT PARAMETERS: ; ; R5 - address of arguments block ; ; 0(R5) - argument count of ISCHED/ITIMER call ; 2(R5) - address of integer number of hours ; 4(R5) - address of number of minutes ; 6(R5) - address of integer number of seconds ; 10(R5) - address of integer number of ticks ; 12(R5) - address of four-word area for Fortran completion routine linkage ; 14(R5) - address of mark time request id to pass to completion routine ; 16(R5) - address of Fortran completion routine ; ; ; RETURNED FUNCTION VALUE: ; ; 0 - no error setting mark time schedule request ; 1 - no queue element was available; unable to schedule request ; ; -- .SBTTL ISCHED,ITIMER - Fortran-callable subroutines .PSECT SYS$I TIMER:: ITIMER:: CALL CHKARG ; Check if all arg for ITIMER are present, ; returns to caller if missing argument CALL $TIME$ ; Convert specified time to internal format ; delta-time (result returned in R0 & R1) MOV R1,-(SP) ; Store low-order word of interval MOV R0,-(SP) ; Store high-order word of interval BR ISCTIM SCHED:: ISCHED:: CALL CHKARG ; Check if all arg for ISCHED are present, ; returns to caller if missing arguments CALL $TIME1 ; Calculate the time interval between current ; time and specified time-of-the day and then ; convert specified time to internal format ; (result returned in R2 & R3) MOV R3,-(SP) ; Store low-order word of interval MOV R2,-(SP) ; Store high-order word of interval ISCTIM: MOV SP,R2 ; R2 <- address of interval to wait MOV (R5)+,R1 ; R1 <- address of 'area' argument; R1 MUST ; be used - it's an input parameter for $CMPLT MOV @(R5)+,-(SP) ; Store id of request in MRKT's argument block MOV R1,-(SP) ; Store address of completion routine and MOV R2,-(SP) ; interval in MRKT's argument block CALL $CMPLT ; Set-up linkage to Fortran completion routine ; (parameters are passed both in R1 & R5) TST -(SP) ; Allocate remaining space needed for MRKT's ; argument block .MRKT SP ; Schedule mark time completion routine CALL $ERRP0 ; Get and convert any errors (status in R0) ADD #12.,SP ; Purge stack of all temporary storage RETURN ; Return to caller with status in R0 ; ; CHKARG subroutine tests if all arguments for ISCHED/ITIMER are present ; CHKARG: MOV (R5)+,R4 ; R4 <- argument count MOV R5,-(SP) ; Save pointer of 1st argument in call MOV #7,R3 ; Check that all arguments were passed 10$: CALL $NXADR ; Was this argument passed by caller? BCS 20$ ; If CS, error - an argument wasn't supplied DEC R3 ; Checked all arguments in call? BNE 10$ ; If NE, no - loop until all are checked MOV (SP)+,R5 ; Restore pointer to 1st argument in call RETURN 20$: BIT (SP)+,(SP)+ ; Purge stack of temporary and point to ; calling program TRAP $MSARG ; Handle any missing arguments in call RETURN .END