.MCALL .MODULE .MODULE CVTTIM,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. ;++ ; ; ; Edit Who Date Description of modification ; ---- --- ---- --------------------------- ; 001 WLD 14-SEP-90 Use SOB instruction if supported. ;-- ;+ ;COND ; EIS$I (0) use SOB macro ; 1 use SOB instruction ; ; SLIB$M (0) Generate standard SYSLIB routine ; SLIB$M 1 Generate U mode part of Supervisor library ; SLIB$M 2 Generate S mode part of Supervisor library ; ; SLIB$M values are referenced using symbols of the form *PART ; in conditional statements. ; ; If SLIB$M <> 0, EIS$I is forced to 1 ;- .IIF NDF EIS$I EIS$I=0 .IIF NDF SLIB$M SLIB$M=0 .IIF NE SLIB$M EIS$I=1 OPART = SLIB$M ;0 = generate if building old library UPART = SLIB$M-1 ;0 = generate if building User part SPART = SLIB$M-2 ;0 = generate if building Supy part OSPART = OPART*SPART ;0 = generate ... old or Supy OUPART = OPART*UPART ;0 = generate ... old or User ;+ ; RT-11 SYSTEM LIBRARY (SYSLIB) SUBROUTINE ; ; CALLABLE ENTRIES: CVTTIM ; ; FUNCTIONAL DESCRIPTION: ; ; The CVTTIM routine converts a two-word internal format time into ; its time components, that is, -- hours, minutes, seconds, and ticks. ; ; CALLING SEQUENCE: ; ; CALL CVTTIM(TIME, HRS, MIN, SEC, TICK) ; ; ; PASSED ARGUMENTS: ; ; TIME - INTEGER*4 time in internal binary format ; TIME(low word): high order word of time ; TIME(high word): low order word of time ; ; ; ; RETURNED ARGUMENT VALUES: ; ; HRS - INTEGER hours ; MIN - INTEGER minutes ; SEC - INTEGER seconds ; TICK - INTEGER time in ticks ; ; FUNCTION RETURN VALUE: ; ; ; ; ; EXTERNAL REFERENCES: ; ; $DIV60 ; $DIVTK ; $NXADR ; ; ; MACRO REFERENCES: ; ; SOB .SBTTL CVTTIM - FORTRAN-callable system subroutine .GLOBL $SYSLB, $NXADR, $DIV60, $DIVTK .WEAK $MSARG .IIF EQ EIS$I .MCALL SOB .PSECT SYS$I,I CVTTIM::MOV (R5)+,R4 ; get arg count (and junk) CALL $NXADR ; get address of user's JTIME argument BCS 100$ ; it MUST be supplied. MOV R0,R3 ; R3 temporarily gets it. MOV SP,R1 ; save the SP. MOV #4,R2 ; get 4 return argument addresses 10$: CALL $NXADR ; get an argument BCS 90$ ; no luck. Abort with error. MOV R0,-(SP) SOB R2,10$ ; BR if more arguments to get. MOV (R3)+,R0 ; Get JTIME MOV (R3)+,R1 CALL $DIVTK ; Get no. of ticks (returned in R3). MOV R3,@(SP)+ ; Return no. ticks to caller. CALL $DIV60 ; Get no. of seconds (returned in R3). MOV R3,@(SP)+ ; Return no. seconds to caller. CALL $DIV60 ; Get no. of minutes & hours (both returned ; in R3 and in R1 respectively). MOV R3,@(SP)+ ; Return no. minutes to caller. MOV R1,@(SP)+ ; Return no. hours to caller. BR 110$ ; BR to RETURN ; Error return/trap 90$: MOV R1,SP ; restore the stack pointer 100$: TRAP $MSARG ; Handle any missing arguments in call. 110$: RETURN .END