.MCALL .MODULE .MODULE TIMASC,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 ; or multi-job environment. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library ; ; EQUATED SYMBOLS: ; INTASC = 366 ;Integer to ASCII number division constant(0400 - 10.) ; ; EXTERNAL REFERENCES: ; .GLOBL $DIV60 ; Entry point to divide by 60 routine .GLOBL $DIVTK ; Entry point to divide by ticks/sec routine .GLOBL $SYSLB ; Include system library work area .GLOBL $NXADR .GLOBL $ERRP0 ; Entry point to EMT error conversion routine .WEAK $MSARG ; Trap code for missing argument .SBTTL TIMASC - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The TIMASC routine converts a two-word internal format time into an ; ASCII string of the form: ; ; hh:mm:ss ; ; where: ; ; hh - two-digit hours ; mm - two-digit minutes ; ss - two-digit seconds ; ; CALLING SEQUENCE: ; ; CALL TIMASC( itime, string ) ; ; INPUT PARAMETERS: ; ; R5 - address of TIMASC's argument block ; 0(R5) - argument count of TIMASC call ; 2(R5) - address of two-word area holding internal format time interval ; 4(R5) - address of eight-byte area to receive ASCII time string ; ; OUTPUT PARAMETERS: ; ; string - converted ASCII time string ; ;-- .PSECT SYS$I TIMASC:: MOV (R5)+,R4 ; R4(low byte) <- argument count CALL $NXADR ; get 'itime' address BCS ERR ; MOV R0,R1 ; R1 <- address of two-word internal time $TMSC:: CALL $NXADR ; get 'strng' address BCS ERR ; missing 'strng' then err MOV R0,R5 ; R5 <- address of ASCII time string buffer MOV (R1)+,R0 ; R0 <- high-order word of internal time MOV @R1,R1 ; R1 <- low-order word of internal time MOV #-1,-(SP) ; Set time to ascii conversion stopper CALL $DIVTK ; Get no. of ticks and toss'em away ; and discard them CALL $DIV60 ; Get no. of seconds (returned in R3) MOV R3,-(SP) ; Save no. seconds for conversion CALL $DIV60 ; Get no. of minutes (returned in R3) MOV R3,-(SP) ; Save no. minutes for conversion MOV R1,R3 ; R3 <- no. hours for conversion BR 20$ 10$: MOVB #':,(R5)+ ; Output time component delimiter 20$: ADD #INTASC,R3 ; Accumulate quotient in high byte, ; and remainder in the low byte TSTB R3 ; finished division ? BPL 20$ ; If PL, no - loop until it's converted ADD #"00-INTASC,R3 ; Adjust, and convert to ASCII SWAB R3 ; Get high-order digit of component in low-byte MOVB R3,(R5)+ ; and output to ASCII time string buffer SWAB R3 ; Get low-order digit of component in low-byte MOVB R3,(R5)+ ; and output to ASCII time string buffer MOV (SP)+,R3 ; Any more components remaining to convert? BPL 10$ ; If PL, yes - loop until all are converted RETURN ERR: TRAP $MSARG ; Handle any missing arguments in call RETURN .END