.title k11sho do the show command in an overlay .ident /2.0.01/ ; 31-Jan-84 08:28:16 Brian Nelson ; ; Remove SHOW code from K11CMD.MAC for placement into an overlay. ; Had not realized how large Kermit was getting. .if ndf, K11INC .ift .include /IN:K11MAC.MAC/ .include /IN:K11CDF.MAC/ .endc .enabl lc .enabl gbl .psect $code .sbttl the show command c$show::$name calls getcm0 , tst r0 bmi 110$ jsr pc ,@r1 return 110$: message ,cr return sho$al: message call sho$at call sho$bl call sho$de call sho$df call sho$dl call sho$es call sho$fi call sho$ha call sho$li call sho$pa call sho$pk call sho$ph call sho$pr call sho$ps call sho$rf call sho$rx call sho$so call sho$ti call sho$ve message return $cmglob = 0 command sholst ,ALL ,3 ,sho$al command sholst ,BINARY-TYPE,3 ,sho$bt command sholst ,BLOCK_CHECK_TYPE,3,sho$bl command sholst ,BLOCK-CHECK-TYPE,3,sho$bl command sholst ,CONSOLE,3 ,sho$co command sholst ,DATE ,3 ,sho$da command sholst ,DEBUG ,3 ,sho$de command sholst ,DEFAULT,3 ,sho$df command sholst ,DELAY ,3 ,sho$dl command sholst ,DIRECTORY,3 ,sho$df command sholst ,ESCAPE ,3 ,sho$es command sholst ,FILETYPE,3 ,sho$fi command sholst ,HANDSHAKE,3 ,sho$ha command sholst ,LINE ,3 ,sho$li command sholst ,PACKET ,3 ,sho$pk command sholst ,PARAMETERS,4 ,sho$pa command sholst ,PARITY ,3 ,sho$pr command sholst ,PAUSE ,3 ,sho$ps command sholst ,PHONE ,3 ,sho$ph command sholst ,RECORD_FORMAT,3,sho$rf command sholst ,RECORD-FORMAT,3,sho$rf command sholst ,RELEASE_NOTES,3,sho$rl command sholst ,RSX ,3 ,sho$rx command sholst ,START-OF-PACKET,3,sho$so command sholst ,START_OF_PACKET,3,sho$so command sholst ,TIME ,3 ,sho$ti command sholst ,VERSION,3 ,sho$ve command sholst ,DIAL ,3 ,sho$dp command sholst sho$dp: tst (sp)+ ; Show DIAL is a special case jmp xxsdia ; where we load an adjacent overlay global .sbttl routines for the show command .enabl lsb sho$de: tst trace ; any debugging turned on now ? bne 10$ ; yes message ,cr br 100$ ; exit 10$: message print #logfil clr r0 ; index := 0 message 20$: tst 200$(r0) ; end of the list yet ? beq 100$ ; yes, bye print 205$(r0) ; print the header bit 200$(r0),trace ; see if a bit is turned on beq 30$ ; no message ,cr ; say so then br 40$ ; next please 30$: message ,cr ; if off then also say so 40$: tst (r0)+ ; next please br 20$ ; all done yet ? 100$: return ; simple .Save .psect $Pdata,d 200$: .word log$co ,log$fi ,log$pa ,log$st ,0 205$: .word 210$ ,220$ ,230$ ,240$ 210$: .asciz /Remote connection logging / 220$: .asciz /File opens and creations / 230$: .asciz /Packet logging to logfile / 240$: .asciz /State logging to logfile / .even .restore sho$li: tstb ttdial ; show the terminal show bne 300$ ; something is there message ,cr return 300$: message print #ttdial ; print it and exit message message calls ttspee ,<#ttdial> sub #20 ,sp ; try to format the response a little mov sp ,r1 ; allocate a buffer and point to it deccvt r0,r1,#4 ; convert to decimal, 4 wide print r1 ,#4 ; print it add #20 ,sp ; pop the buffer message < baud>,cr ; and finish off the message return .dsabl lsb .sbttl show time and version .enabl lsb sho$dy::calls ascdat ,<#errtxt,#0> print #errtxt MESSAGE < > calls asctim ,<#errtxt,#0> print #errtxt message return sho$ti: calls asctim ,<#errtxt,#0> message print #errtxt message return sho$da: calls ascdat ,<#errtxt,#0> message print #errtxt message return sho$df: message tstb defdir beq 10$ print #defdir message return 10$: message ,cr return sho$ve::message sub #40 ,sp ; allocate a buffer mov sp ,r1 ; point to it movb #release,(r1)+ ; is this test or for real deccvt #baselev,r1 ; convert baseline level to ascii add #6 ,r1 ; skip past it movb #'. ,(r1)+ ; a dot deccvt #edit ,r1 ; the edit number now mov sp ,r1 ; point back to the buffer calls cvt$$ , ; drop all the extra spaces out print r1,r0 ; simple print #lasted message ; a crlf add #40 ,sp return .dsabl lsb global .sbttl show filetype and show block-check .enabl lsb sho$fi: cmpb $image ,#text ; text files bne 10$ ; not text message ,cr br 20$ 10$: cmpb $image ,#binary ; binary ? bne 20$ ; really ? message ,cr 20$: tst filprot beq 25$ message ,cr 25$: return sho$bl: movb setrec+p.chkt,r0 ; get the checksum type please bne 30$ ; it's been set already movb #defchk ,r0 ; no, set the default checktype in 30$: sub #'1 ,r0 ; convert to an index for printing asl r0 ; times 2 for word addressing print 100$(r0) ; and say so return .save .psect $Pdata,d 100$: .word 110$,120$,130$ 110$: .asciz /1-Character-Checksum/ 120$: .asciz /2-Character-Checksum/ 130$: .asciz /3-Character-CRC-CCITT/ .even .restore .dsabl lsb .sbttl show parameters and show escape .enabl lsb sho$es::mov conesc ,r1 bne 10$ mov #con$es ,r1 10$: add #100 ,r1 ; echo it back out mov r1 ,-(sp) ; allocate a buffer mov sp ,r1 ; point to it message print r1 ,#1 ; simple message tst (sp)+ ; pop buffer and exit return ; bye sho$pa: message movb conpar+p.eol,r0 octout r0 message < (octal)>,cr message movb conpar+p.spsiz,r0 decout r0 message message movb conpar+p.time,r0 decout r0 message message decout maxtry ; retry count message return global .dsabl lsb .sbttl show packet statistics .enabl lsb c$stat:: sho$pk: sub #120 ,sp ; /43/ Allocate a buffer please print #300$ ; /43/ A header clr r3 ; /43/ Current item to Dump mov #27. ,r4 ; /43/ Number items to dump 10$: mov sp ,r5 ; /43/ And a pointer to it tst pcnt.r+2(r3) ; /43/ Anything there to dump? bne 15$ ; /43/ Yes tst pcnt.s+2(r3) ; /43/ No, what about SENT packets? beq 90$ ; /43/ No, skip the whole thing 15$: mov r5 ,r1 ; /43/ Fill the buffer with spaces mov #110 ,r2 ; /43/ Count for the fill 20$: movb #40 ,(r1)+ ; /43/ Stuff a space sob r2 ,20$ ; /43/ And go back for more mov r3 ,r1 ; /43/ Current TYPE beq 30$ ; /43/ So skip TYPE field asr r1 ; /43/ Divide by two asr r1 ; /43/ Again add #100 ,r1 ; /43/ Get the letter type now movb r1 ,(r5)+ ; /43/ Insert into the buffer br 40$ ; /43/ Insert data now 30$: tstb (r5)+ ; /43/ First entry is NULL 40$: add #5 ,r5 ; /43/ Skip over a couple spaces mov #pcnt.s ,r1 ; /43/ SENT packet count call 200$ ; /43/ Convert double quantity mov #pcnt.r ,r1 ; /43/ RECEIVED packet count call 200$ ; /43/ Convert double quantity mov totp.s ,r1 ; /43/ Total SENT packet count call 200$ ; /43/ Convert double quantity mov totp.r ,r1 ; /43/ Total RECEIVED packet count call 200$ ; /43/ Convert double quantity movb #CR ,(r0)+ ; /43/ Insert carriage control movb #LF ,(r0)+ ; /43/ Insert carriage control clrb @r0 ; /43/ All done, .asciz mov sp ,r0 ; /43/ Now DUMP it print r0 ; /43/ Simple 90$: add #4 ,r3 ; /43/ Move up to next entry sob r4 ,10$ ; /43/ More to do ? ; /43/ No, dump character counts print #310$ ; /43/ A header message ; /43/ mov sp ,r4 ; /43/ Buffer address mov #charout,r1 ; /43/ Data characters in call 190$ ; /43/ Print it message < Received: > ; /43/ Data characters in mov #charin ,r1 ; /43/ Point to it call 190$ ; /43/ And dump message ; /43/ CRLF mov #times+2,r1 ; /43/ tst (r1)+ ; /43/ A real clock going ? beq 100$ ; /43/ No, may be rt11 today message