.Title MONTT ; Program ; Written by: Frank Penner ; April 1983 .PSECT FRANKI,WRT,NOEXE,LONG CHANTT: .WORD 0 ;space for terminal channel number IOSB: .QUAD 0 NUM=26 ;26 LONGWORDS BUFF1: .BLKL NUM BUFF2: .BLKL NUM .ADDRESS BUFFI BUFFI: .BLKL NUM FAODESC:.LONG 10*80 .ADDRESS FAOBUF FAOBUF: .BLKB 10*80 FA2DESC:.LONG 10*80 .ADDRESS FA2BUF FA2BUF: .BLKB 10*80 FAOLEN: .BLKW 1 .BLKW 1 FA2LEN: .BLKW 1 .BLKW 1 .PSECT FRANKP,NOWRT,EXE,LONG,PIC,SHR FORSTR: .ASCID ?time:!%T!+!+!/?- ?reads:!/?- ?!6UL!11(5UL)!/?- ?writes:!/?- ?!6UL!11(5UL)!/? FO2STR: .ASCID ?!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.?- ?!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD.!AD? PARA2: .LONG 30 .ADDRESS FAOBUF .LONG 5 .ADDRESS FAOBUF+30 .LONG 5 .ADDRESS FAOBUF+30+5 .LONG 5 .ADDRESS FAOBUF+30+<2*5> .LONG 5 .ADDRESS FAOBUF+30+<3*5> .LONG 5 .ADDRESS FAOBUF+30+<4*5> .LONG 5 .ADDRESS FAOBUF+30+<5*5> .LONG 5 .ADDRESS FAOBUF+30+<6*5> .LONG 5 .ADDRESS FAOBUF+30+<7*5> .LONG 5 .ADDRESS FAOBUF+30+<8*5> .LONG 5 .ADDRESS FAOBUF+30+<9*5> .LONG 5 .ADDRESS FAOBUF+30+<10*5> .LONG 17 .ADDRESS FAOBUF+30+<11*5> .LONG 5 .ADDRESS FAOBUF+102 .LONG 5 .ADDRESS FAOBUF+102+5 .LONG 5 .ADDRESS FAOBUF+102+<2*5> .LONG 5 .ADDRESS FAOBUF+102+<3*5> .LONG 5 .ADDRESS FAOBUF+102+<4*5> .LONG 5 .ADDRESS FAOBUF+102+<5*5> .LONG 5 .ADDRESS FAOBUF+102+<6*5> .LONG 5 .ADDRESS FAOBUF+102+<7*5> .LONG 5 .ADDRESS FAOBUF+102+<8*5> .LONG 5 .ADDRESS FAOBUF+102+<9*5> .LONG 5 .ADDRESS FAOBUF+102+<10*5> .LONG 5 .ADDRESS FAOBUF+102+<11*5> .LONG 4 .ADDRESS FAOBUF+102+<12*5> TT: .ASCID /TT/ FIFTNSEC:.LONG -10*1000*1000*15,-1 ;15 second delta time quad word ONESEC:.LONG 1*100*1000,0 ;1/100 second time quad word ERRORA: JMP ERROR .ENTRY START,^M<> ;start of program $ASSIGN_S DEVNAM=TT- ,CHAN=CHANTT ;assign my terminal to a chan BLBC R0,ERRORA ;low bit clear error MOVAL BUFF1,R6 ;start with buff1, R6 is ptr MOVAL BUFF2,R7 ;second with buff2, R7 is ptr 1$: $CMEXEC_S PEEK ;change mode to exec to get rest BLBC R0,ERRORA ;low bit clear error PUSHAL BUFFI ;yields difference PUSHAL (R7) ;minus old time PUSHAL (R6) ;new time CALLS #3,LIB$SUBX ;quad word subtract BLBC R0,ERRORA ;low bit clear error DIVL3 ONESEC,BUFFI,R3 ;save time diff in reg in 1/100 secs MOVZBL #2,R0 ;point past time 2$: SUBL3 (R7)[R0],(R6)[R0],R1 ;get difference 'tween new and old MULL2 #10000,R1 ;mul since time is 1/100 sec DIVL3 R3,R1,BUFFI[R0] ;diff div by time gives char/100 sec AOBLSS #NUM,R0,2$ ;do all the long words $FAOL_S CTRSTR=FORSTR,- ;format string OUTBUF=FAODESC,- ;char descript for formatted output OUTLEN=FAOLEN,- ;long word to hold length of output PRMLST=BUFFI-4 ;address of parameter list BLBC R0,ERROR ;low bit clear error $FAOL_S CTRSTR=FO2STR,- ;format string OUTBUF=FA2DESC,- ;char descript for formatted output OUTLEN=FA2LEN,- ;long word to hold length of output PRMLST=PARA2 ;address of parameter list BLBC R0,ERROR ;low bit clear error $OUTPUT CHAN=CHANTT- ,LENGTH=FA2LEN- ,BUFFER=FA2DESC+8 BLBC R0,ERROR ;low bit clear error MOVL R6,R9 ;swap buffer addresses MOVL R7,R6 MOVL R9,R7 $SETIMR_S DAYTIM=FIFTNSEC- ;set timer for passed # of seconds ,EFN=#1 ;event flag to use BLBC R0,ERROR ;low bit clear error $WAITFR_S EFN=#1 ;wait for event flag BRW 1$ ;do it again EXIT: ERROR: $EXIT_S R0 ;exit with error if any .ENTRY PEEK,^M<> ;beginning of exec mode code MOVQ G^EXE$GQ_SYSTIME,(R6) ;get time MOVL G^PMS$GL_READCNT,8(R6) ;get terminal read char count MOVL G^PMS$GL_TREADS,8+4(R6) ;get terminal reads MOVC3 #4*10,G^PMS$AL_READTBL,8+8(R6);get read tables MOVL G^PMS$GL_WRTCNT,8+<4*12>(R6);get terminal write char count MOVL G^PMS$GL_TWRITES,8+4+<4*12>(R6);get terminal writes MOVC3 #4*10,G^PMS$AL_WRITETBL,8+8+<4*12>(R6);get write tables MOVL #SS$_NORMAL,R0 ;set normal exit status EEXIT: RET ;end of exec mode code .END START ;end of program