Trailing-Edge
-
PDP-10 Archives
-
decus_20tap5_198111
-
decus/20-0137/csmp/times.mac
There are 2 other files named times.mac in the archive. Click here to see a list.
00100 TITLE TIMES SUBROUTINE AND OTHERS
00200 SEARCH MACSYM ;[W1]
00205 ;
00210 ;[W1] EDIT TO USE RET MACRO RATHER THAN THE F40 JRA RETURN SEQUENCE
00300 ;
00400 INTERNAL TIMES,RSAC,RELEA
00500 OPDEF TTCALL [51B8]
00600 OPDEF RESET.[15B8]
00700 ;
00800 ; RSAC IS A ROUTINE TO FIND IF THERE HAS BEEN ANY INPUT FROM
00900 ; THE TTY. THE TWO INPUTS IT CHECKS FOR ARE "^" AND "_".
01000 ; IF IT FINDS ANOTHER CHARACTER THERE IS AND ERROR AND IT RETURNS
01100 ; A TRUE VALUE.
01200 ; THE FIRST ONE IS THE TTY COMMAND TO STOP EXECUTION OF A PART
01300 ; OF A PROGRAM.
01400 ; THE SECOND ONE IS USED TO STOP THE LISTING OF THE
01500 ; HELP COMMAND
01600 ;
01700 RSAC: MOVE 1,@(16) ;GET PARAMETER
01800 TTCALL 2,3
01900 JRST EXIT
02000 JUMPN 1,RTARR ;JUMP IF NOT 0
02100 CAIE 3,"^" ;SKIP IF STOP CHARACTER
02200 JRST FALSE ; NOPE, MUST BE SOMETHING WRONG
02300 JRST EXIT-2
02400 RTARR: CAIE 1,12 ;IF NOT 10 (DECMAL) THEN ERROR
02500 HALT
02600 CAIE 3,"_"
02700 JRST FALSE ;NOPE, MUST BE SOMETING WRONG
02800 JRST EXIT-2
02900 SETO 0,
03000 RET
03100 EXIT: SETZ 0,
03200 RET
03300 FALSE: TTCALL 11, ;CLEAR INPUT BUFFER
03400 TTCALL 3,[ASCIZ/
03500 ?
03600 /] ;OUTPUT ERROR QUESTION MARK
03700 JRST EXIT ;GOOD-BYE
03800 ;
03900 ;
04000 ; NOW FOR THE TIME SUBROUTINE
04100 ; TIMES GETS BOTH THE CPU TIME AND THE ELAPSED TIME
04200 ; FOR THE JOB IN WHICH IT IS RUNNING
04300 ;
04400 TIMES: MOVE 4,@3(16) ;GET INPUT PARAMETER
04500 CALLI 2,23 ;READ CLOCK IN MSEC
04600 SETZ 3, ;SET TO ZERO SO TIME IS THIS JOB
04700 CALLI 3,27 ;READ CPU TIME FOR THIS JOB
04800 MOVE 5,2 ;SAVE TIME INCASE RESET
04900 MOVE 1,3 ;SAVE CPU TIME INCASE RESET
05000 JUMPE 4,RESET ;THEY WANT TO RESET TIMES
05100 SUB 1,CPUTIME ;GET CPU TIME UNTIL NOW
05200 MOVEM 1,@0(16) ;PUT IN VARIABLE
05300 SUB 5,STIME ;SUBTRACT START TIME
05400 IDIVI 5,^D1000 ;DIVIDE BY 1000 DROP MSEC
05500 IDIVI 5,^D60 ;CONVERT TO HRS, SEC
05600 MOVEM 5,@1(16) ;PUT OUT HOURS
05700 MOVEM 6,@2(16) ; PUT OUT SEC
05800 CAIE 4,2
05900 RET
06000 RESET: MOVEM 3,CPUTIME ;STORE CPU TIME
06100 MOVEM 2,STIME ;STORE START TIME
06200 RET
06300 CPUTIME: 0
06400 STIME: 0
06500 ;
06600 ; THE RELEAS ROUTINE DOES A FORTRAN "RESET."- THEREBY RELEASING
06700 ; ALL DEVICES
06800 ; IT IS USED SO AS TO ENTER DIFFERENT FILE NAMES ON A
06900 ; DEVICE
07000 ;
07100 ;
07200 ; DEFINED THE FORTRAN RESET. UUO
07300 ;
07400 RELEA: RESET.
07500 RET
07600 END