; SHOW .LOG file display - pauses after each clear screen, ; clear to end of line and clear to end of screen ; command. (SOROC or similar CRT) ; Author: Irwin M. Goldstein, London House Incorporated ; Written on: I don't remember! (Pre 1985?) ; Usage: ; ===== ; .SHOW filespec ; Where "filespec" is the name of the file you want shown. The ; default extension is ".LOG". ; Edit history: ; ============ ; 3/88 Made terminal independent by Andrew V. Osman. ; Still requires SOROC driver on task manager slave ; jobs, but converts SOROC commands into TCRTs ; when displaying the log file. AVO ; NOTES: ; ===== ; The task manager slave job(s) should be set up with the SOROC ; terminal driver in the TRMDEF statement(s) in the system ; initialization command file. The task manager will then write SOROC ; screen commands to .LOG files. SHOW will then convert these SOROC ; commands into TCRT calls, thus cleanly displaying a .LOG file on ; any terminal! ; SHOW will pause for a key to be pressed whenever ; something is about to be erased from the screen. While SHOW is not ; in a paused state, ^S and ^Q will work to pause and restart ; output as well. When SHOW is in the paused state, a "+" will be ; displayed in the cursor. At this point you may press ESCAPE to ; abort the SHOW or press any other key to continue. SEARCH SYS ; system macros SEARCH SYSSYM ; system symbols SEARCH TRM ; terminal symbols VMAJOR = 1. VMINOR = 0. VEDIT = 101. PHDR -1,0,PH$REE!PH$REU GETIMP D.DDB,A3 ; get free memory area FSPEC @A3,LOG ; process input filename INIT @A3 ; initialize input file LOOKUP @A3 ; lookup input file JNE INERR ; input file error OPENI @A3 ; open file for input CMPB D.OPN(A3),#D$OPNI ; check error codes BEQ ALLOK ; no error, continue TYPECR JMP DONE ALLOK: JOBIDX A0 ; get address of JCB MOV JOBTRM(A0),A0 ; get address of terminal status ORW #T$IMI!T$ECS,@A0 ; set image mode with echo off LOOP: CTRLC FINISH ; abort on ^C TCKI ; character typed? JEQ CTLS ; yes - check for pause control-S FILINB @A3 ; input one byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up ANDB #127.,D1 ; clear high bit CMPB D1,#27. ; is this an escape? BEQ ESC ; yes - special processing may be needed ;C129 MOV #129.,D2 CMPB D1,#177 ; end of all status line ? JEQ DOCRT ; yep, do it ;c1 MOV #1.,D2 CMPB D1,#36 ; cursor home JEQ DOCRT ;c2 MOV #2.,D2 CMPB D1,#215 ; cursor return JEQ DOCRT ;c3 MOV #3.,D2 CMPB D1,#13 ; cursor up JEQ DOCRT ;c4 MOV #4.,D2 CMPB D1,#12 ; cursor down JEQ DOCRT ;c5 MOV #5.,D2 CMPB D1,#10 ; cursor left JEQ DOCRT ;c6 MOV #6.,D2 CMPB D1,#14 ; cursor right JEQ DOCRT TTY ; display a byte JMP LOOP ; go through file ESC: FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up CLR D2 ; clear command variable CMPB D1,#'= ; cursor positioning command? BNE C0 FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up SUB #31.,D1 ; adjust row for decimal MOV D1,D2 ; get row MUL D2,#256. ; move to high byte FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up SUB #31.,D1 ; adjust column for decimal ADD D2,D1 ; get column, move to register D1 TCRT ; perform cursor position command JMP LOOP ; do more C0: CMPB D1,#'* ; clear screen command? JEQ PAUSE ; yes - pause a sec. ;C7 MOV #7.,D2 CMPB D1,#43 ; lock keyboard JEQ DOCRT ;C8 MOV #8.,D2 CMPB D1,#42 ; unlock keyboard JEQ DOCRT ;C9 MOV #9.,D2 CMPB D1,#124 ; clear to end of line command? JEQ PAUSE ; yes - pause a sec. ;C10 MOV #10.,D2 CMPB D1,#131 ; clear to end of screen command? JEQ PAUSE ; yes - pause a sec. ;C11 MOV #11.,D2 CMPB D1,#51 ; protect field JEQ DOCRT ;C12 MOV #12.,D2 CMPB D1,#50 ; unprotect field JEQ DOCRT ;C13 MOV #13.,D2 CMPB D1,#46 ; enable protected fields JEQ DOCRT ;C14 MOV #14.,D2 CMPB D1,#47 ; disable protected fields JEQ DOCRT ;C100-105 CMPB D1,#'G ; underscore variations? BNE C128 ; no - skip other checks FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up ;C100 MOV #100.,D2 CMPB D1,#': ; start underscore/blink JEQ DOCRT ;C101 MOV #101.,D2 CMPB D1,#'0 ; end underscore/blink JEQ DOCRT ;C102 MOV #102.,D2 CMPB D1,#'< ; start underscore/reverse JEQ DOCRT ;C103 MOV #103.,D2 CMPB D1,#'0 ; end underscore/reverse JEQ DOCRT ;C104 MOV #104.,D2 CMPB D1,#'> ; start underscore/reverse/blink JEQ DOCRT ;C105 MOV #105.,D2 CMPB D1,#'0 ; end underscore/reverse/blink JEQ DOCRT C128: MOV #128.,D2 CMPB D1,#'F ; select top status line + ! BNE C130 FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up CMPB D1,#'! ; select top status line JEQ DOCRT C130: MOV #130.,D2 CMPB D1,#'z ; select unshifted status line BNE C131 FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up CMPB D1,#40 ; select unshifted status line JEQ DOCRT C131: MOV #131.,D2 CMPB D1,#'Z ; select shifted status line BNE NOTCMD FILINB @A3 ; input next byte TST D.SIZ(A3) ; test for end of file JEQ FINISH ; yes, finish up CMPB D1,#40 ; select shifted status line JEQ DOCRT NOTCMD: MOVB D1,D2 ; save this character MOVB #27.,D1 ; put escape back TTY MOVB D2,D1 ; put next character back TTY JMP LOOP ; go back to normal ; Pause, waiting for any key to be pressed - abort on ESC or ^C PAUSE: TTYI BYTE 53,10,0,0 ; display a "+" in the cursor KBD FINISH ; wait for any key, ctrlc aborts CMPB D1,#27. ; ESC pressed? JEQ FINISH ; yes - abort ; Do a crt screen function (TCRT call) DOCRT: ADD #177400,D2 ; access TCRT function MOV D2,D1 ; move it to TCRT variable (D1) TCRT ; do it JMP LOOP ; get more ; A character was typed, pause if it was a ^S CTLS: KBD FINISH ; get the character CMPB D1,#19. ; ^S? JNE LOOP ; no - continue KBD FINISH ; yes - pause CMPB D1,#27. ; ESC typed? JNE LOOP ; no - go back for more ; Close file & exit: FINISH: CLOSE @A3 ; close the input file BR DONE ; exit INERR: TYPE DONE: CRLF EXIT END .