UNIVERSAL KERMIT Kermit-10 Data and Symbol Definitions SEARCH MACTEN ;++ ; FACILITY: ; ; KERMIT-10 (Protocol Version V) ; ; ; ABSTRACT: ; ; This program is used to implement version 5.0 of the KERMIT protocol ; for the DECsystem-10 (TOPS-10 monitor 6.03). ; ; The KERMIT protocol was developed at the Columbia University Center ; for Computing Activities and is copyrighted by the Trustees of ; Columbia University, New York, NY 10027. Columbia University has ; given permission for any individual or institution to use the proto- ; col, except for explicitly commercial purposes. ; ; For a description of the protocol refer to the file, PROTO.DOC, ; supplied by Columbia University. ; ; ; CALLING SEQUENCE: ; ; .R KERMIT ; ; ; ENVIRONMENT: ; ; TOPS-10 monitor 6.03 ; ; ; AUTHOR: ; ; Charles E. Boyd, Created: 03-Apr-1984 ; Computer Research Center ; University of New Orleans ; Lakefront ; New Orleans, LA 70148 ; ; Phone: (504) 286-6347 ;-- SUBTTL Universal Symbols F== 0 CH== 1 CH2== 4 TTY== 2 CTY== 3 T1== 1 T2== 2 T3== 3 T4== 4 P1== 5 P2== 6 P3== 7 P4== 10 R11== 11 R12== 12 R13== 13 S== 14 R15== 15 AP== 16 P== 17 N== P3 C== P4 ND FT%LNO,1 ;SOS-style linenumber handling ND FT%NAK,0 ;Period NAKs during remote server ;+ ; Flags ;- f.serv== 1 ;Server mode flag f.stri== 2 ;Line-no strip flag f.null== 4 ;Nul char strip flag f.rser== 10 ;Remote server f.help== 20 ;Help wanted f.eofx== 40 ;Discard requested f.eofz== 100 ;Discard "all" requested f.rmt== 200 ;REMOTE command prefix seen f.debu== 400 ;DEBUG flag f.qbin== 1000 ;Eight-bit quoting available f.rept== 2000 ;Repeating available f.auto== 4000 ;Auto file-type selection f.gen== 10000 ;Generic Server mode in effect f.srmt== 20000 ;Set REMOTE specified f.supp== 40000 ;Suppress packet info-data f.nft== 100000 ;Non-file transfer taking place f.not== 200000 ;Notify when finished f.ffs== 400000 ;Send full file-specs in file packets cf.atr== 4 ;Attribute mask (capas mask) ;+ ; Packet Types ;- TY.SND== "S" ;Send_init packet type TY.ACK== "Y" ;Ack packet type TY.NAK== "N" ;Nak packet type TY.FIL== "F" ;File header packet type TY.DAT== "D" ;Data packet type TY.REC== "R" ;Receive packet type TY.EOF== "Z" ;EOF packet type TY.BRK== "B" ;Break packet type TY.ATR== "A" ;Attribute packet type TY.INF== "I" ;Info packet type TY.ERR== "E" ;Error packet TY.TXT== "X" ;Text packet TY.KER== "K" ;Server Kermit TY.HST== "C" ;Server Host TY.GEN== "G" ;Server Generic ;+ ; Generic packet type ;- GT.TYP== "T" ;Generic TYPE command GT.LOG== "L" ;Generic LOGOUT command GT.FIN== "F" ;Generic FINISH command GT.CWD== "C" ;Change working directory GT.DIR== "D" ;Directory GT.DEL== "E" ;Delete GT.REN== "R" ;Rename GT.CPY== "K" ;Copy GT.HLP== "H" ;Help GT.USG== "U" ;Disk usage GT.WHO== "W" ;Who's logged in GT.MSG== "M" ;SEND TTY: equivalent CTL%== 100 ;CTL function char MAXL%== ^D94 ;Max packet length TIME%== ^D60 ;Max time out value SOH%== 1 ;Default sop CHR%== 40 ;CHR function char MXTRY%== 5 ;Maximum no of retrys PARIT%== SIXBIT/NONE/ ;Default parity ESCAP%== 35 ;Default escape character QBIN%== "&" ;Default eight bit char QCTL%== "#" ;Default quote char REPT%== "~" ;Default repeat char DELAY%== 5 ;Default delay ST.SI%== "S" ;Send_init ST.RI%== "R" ;Receive_init ST.F%== "F" ;Send_file ST.D%== "D" ;Send_data ST.Z%== "Z" ;Send_eof ST.B%== "B" ;Send_break ST.A%== "A" ;Abort ST.C%== "C" ;Complete DEFINE ERROR ($prefix,$message,$label<.+1>) < XLIST SKIPA ;;[006] JRST .+4 ;;[006] PUSH P,[[ASCIZ/?KER'$prefix $message/]] IFDEF .ERROR, ;;[006] IFNDEF .ERROR, ;;[006] JRST $label LIST > DEFINE ERROR1 ($label<.POPJ##>) < XLIST SKIPA JRST .+4 PUSH P,T1 IFDEF .ERROR, ;;[006] IFNDEF .ERROR, ;;[006] JRST $label LIST > DEFINE PUTC (str$,chr$,addr$<.POPJ##>) < XLIST MOVEI T1,[ASCIZ/'str$'/] ;Write prompt PUSHJ P,.TSTRG## ;... MOVE T1,chr$ ;Write char PUSHJ P,.TCHAR## ;... PUSHJ P,addr$ ;Execute aux routine LIST > DEFINE PUTS (str$,value$,addr$<.POPJ##>) < XLIST MOVEI T1,[ASCIZ/'str$'/] ;Write prompt PUSHJ P,.TSTRG## ;... MOVE T1,value$ ;Get sixbit string TRNE T1,77 ;Right justify it JRST .+3 ;... LSH T1,-6 ;... JRST .-3 ;... PUSHJ P,.TSIXN## ;... PUSHJ P,addr$ ;Exec aux routine LIST > DEFINE PUTS2 (str$,value$,addr$<.POPJ##>) < XLIST MOVEI T1,[ASCIZ/'str$'/] ;Write prompt PUSHJ P,.TSTRG## ;... DMOVE T1,value$ ;Get sixbit string TRNE T2,77 ;Right justify it JRST .+3 ;... LSHC T1,-6 ;... JRST .-3 ;... PUSH P,T2 ;Save 2nd half SKIPN T1 ;1st half zero? OUTSTR [ASCIZ" "] ;Fake it PUSHJ P,.TSIXN## ;Write first half POP P,T1 ;Write 2nd half PUSHJ P,.TSIXN## ;... PUSHJ P,addr$ ;Exec aux routine LIST > DEFINE PUTN (str$,value$,width$,pad$<" ">,radix$<12>,addr$<.POPJ##>) < XLIST MOVEI T1,[ASCIZ/'str$'/] ;Write prompt PUSHJ P,.TSTRG## ;... MOVE T1,value$ ;Get value MOVEI T2,pad$ ;Pad char MOVEI T3,radix$ ;Radix MOVEI T4,width$ ;Width PUSHJ P,.TFRXW## ;Write value PUSHJ P,addr$ ;Aux routine LIST > PRGEND TITLE KERMIT-10 File transfer program via TTY lines. SEARCH KERMIT,SCNMAC, FILIO, UUOSYM, MACTEN TWOSEG 400000 .TEXT ",/LOCAL COMMND,LOCAL,REMOTE,SET,SHOW,SEND" .TEXT ",/LOCAL RECEIV,SERVER,HELP,UTLITY,FILIO" .REQUEST REL:SCAN .REQUEST REL:WILD .REQUEST REL:HELPER INTERNAL .ERROR SALL ;++ ; MODIFICATIONS: ; ; 001 CEB, 03-Apr-1984 - Original ; 002 CEB, 27-May-1984 - Module KERMIT ; Make sure that the transmission TTY line is opened async, otherwise ; time-outs will never happen and we run the risk on being stuck in ; .IOPIM mode with no way out. ; 003 CEB, 27-May-1984 - Module MACLIB ; 004 Make SET QUOTE branch to the same code as the SET PREFIX QUOTE. ; 005 CEB, 28-May-1984 ; If the 8-bit field of a send-init acknowledgement contains something ; other than a "Y", check to see if its the same character sent before ; turning off eight-bit-quoting. ; 006 CEB, 28-May-1984 ; Make sure the ERROR macro and .ERROR routine preserve registers. ; 007 CEB, 28-May-1984 ; Make filetype default to AUTO on start up. ; 010 CEB, 28-May-1984 - Module MACLIB ; 011 CEB, 28-May-1984 ; Add DDT command to enter DDT if its loaded with the program. ; 012 CEB, 29-May-1984 ; Add code to gather timing information during transfers ; 013 CEB, 29-May-1984 ; Add /Notify switch handling for the SEND and RECEIVE commands ; 014 CEB, 31-May-1984 ; Add ^X, ^Y interception handling ; 015 CEB, 08-Jun-1984 ; Make sure an error return from RPACKT is really a time-out and not ; an abort. ; 016 CEB, 08-Jun-1984 ; Add DAYTIME command to print the date and time. ;******* ; 017 CEB, 15-Jun-1984 - Version 5A(17) ; Convert all the LUUO function calls to PUSHJ routine calls to save ; the expense. ; ; Rewrite the I/O routines to be a little less general and more ; specific to Kermit to hopefully speed things up a bit. The module ; MACLIB that handle I/O and LUUO functions has been replaced by the ; module FILIO. ; ; Rewrite Kermit's command scanning, so that commands look more like ; DECsystem-10 program commands rather than the DECsystem-20 style ; as described in the Kermit manual. ; 020 CEB, 15-Jun-1984 - Add VERSION typeout command ; 021 CEB, 15-Jun-1984 - Module KERMIT ; Allow parameters of the SET command to be entered on the command ; line as switches. For example the commands: ; ; Kermit-10> SET LINE n DEB on ; Kermit-10> /LINE:n/DEB:on ; ; are treated identically. ; 022 CEB, 26-Jun-1984 ; Make "Kermit-10> DIRECT" equivalent to "Kermit-10> DIRECT *.*" ; 023 CEB, 08-July-1984 - Module KERMIT, SET ; Remove Edit 21 and allow switches to be handled by SCAN. ; 024 CEB, 08-July-1984 - Module KERMIT ; Allow command handling to be performed by .VSCAN and restructure ; the low segment to have Pxxx and Fxxx areas for it so that second- ; ary switch handling is possible. ; 025 CEB, 09-July-1984 - All modules ; Move flags from F to memory location FLAGS as a permanent storage ; spot. All routines needing access to the flags must explicitly ; issue a MOVE F,FLAGS. This was done to allow bit value switches ; to be handled by VSCAN. ; 026 CEB, 09-July-1984 - Module Kermit ; OSCAN will not overwrite values if already present, so initialize ; the data area to zero before calling .OSCAN, then afterward init- ; ialize values not filled in by SWITCH.INI from the PAREA. ; 027 CEB, 11-Jul-1984 ; Routine PUTC. wasn't preserving register T2 which was being used ; by calling routines. It caused only the first character of each ; packet to be stored rather than the entire packet. Use register ; P2 instead. ; 030 CEB, 16-July-1984 - Module KERMIT ; Wait for I/O to complete before releasing the terminal line ; and also send a ^Q to it, then flush the buffer. ; 031 CEB, 16-July-1984 - Module SERVER ; 032 CEB, 17-Jul-1984 ; Modification number 17 hurt repeat character processing, fixed it. ; 033 CEB, 17-July-1984 - Module FILIO ; The null stripping and line number stripping switches were being ; ignored. ; 034 CEB, 17-July-1984 - Module KERMIT, SEND, RECEIVE ; Allow file file specifications as a switch option on the command ; line for the send/receive commands. ; 035 CEB, 17-July-1984 - Module KERMIT, COMMND ; Add code to display current path in the STATUS and PATH commands. ; 036 CEB, 18-July-1984 - Module SERVER ; Add a flag to optionally at compile time have code to periodically ; send NAKs down the line when operating in remote server mode. ; 037 CEB, 18-July-1984 - Module KERMIT ; Don't release terminal line after processing an error in remote ; server mode. ; 040 CEB, 26-July-1984 ; Miscellaneous code cleanup and rearrangement ; 041 CEB, 28-July-1984 ; Make the PATH command always typeout the new directory path ; 042 CEB, 30-July-1984 ; Make the USAGE command accept a directory of the form [p,pn] instead ; of having to add the .UFD extension to it. ; 043 Add the local COPY command. ; 044 CEB, 15-AUG-1984 ; Fix problem with the PRINT command calculating the /LIMIT ; for the queue entry. ;-- VER== 5 MIN== 1 EDT== 044 WHO== 7 LOC 137 EXP B2!B11!B17!EDT RELOC SUBTTL Main Program KERMIT::TDZA T1,T1 ;[017]Regular entry MOVEI T1,1 ;[017]CCL entry MOVEM T1,CCL ;[017]... RESET ;Reset everything SETZ F, ;Clear the flags TRO F,F.REPT!F.AUTO!F.HELP ;Repeating is the default MOVEM F,FLAGS ;[025]Save flags permanently MOVE P,[IOWD 1000,STACK] ;Set up the stack MOVE T1,[5,,[IOWD 0,0 ;[017]Initialize XWD CCL,'KER' ;[017] command XWD 0,0 ;[017] scanner XWD 0,0 ;[017] and default XWD .PROMPT,0]];[017] prompting routine PUSHJ P,.ISCAN## ;... MOVEI T1,INTBLK ;Initialize PIINI. T1, ; interrupts JFCL ; ... MOVSI T1,(SIXBIT/TTY/) ;Get default GTNTN. T1, ; line and node JFCL ; ... HLRZM T1,NODENO ;Store away HRRZM T1,LINENO ; for safe MOVEM T1,CTLLIN ; keeping MOVEM T1,TTYLIN ;[040] ... MOVE T1,[XWD FAREA,PAREA] ;[026]Copy default BLT T1,PAREA+FLEN-1 ;[026] values SETOM FAREA ;[026]Clear MOVE T1,[XWD FAREA,FAREA+1] ;[026] parameter BLT T1,FAREA+FLEN-1 ;[026] area MOVE T1,[4,,[IOWD SINIL,SININ;[017]Read XWD SINID,SINIM;[017] switch.ini[,] XWD 0,SINIP ;[017] file to XWD 2,.HELP]] ;[023] set up PUSHJ P,.OSCAN## ;[017] options MOVE T1,[IOWD FLEN,PAREA] ;[026]Get default values addr MOVEI T2,FAREA ;[026]Get addr of current values SKIPL (T2) ;[026]Read from switch.ini? JRST .+3 ;[026] Yes MOVE T3,1(T1) ;[026]Use default MOVEM T3,(T2) ;[026] value MOVEI T2,1(T2) ;[026]Next value to check AOBJN T1,.-5 ;[026]Continue checking MOVE F,FLAGS ;[025]Get copy of flags MOVEI T1,HLPFIL ;Set up online TRNE F,F.HELP ;[023]User wants help? PUSHJ P,.IHELP## ;help information JFCL ;...(none available) MOVE T1,[3,,[XWD 0,CTY ;Open channel XWD 0,0 ;[017] to controlling [SIXBIT/TTY/]]] ;[017] terminal PUSHJ P,FOPEN## ;[017] ... HALT ;[017] ... MOVEI T1,GFCHR## ;Set up default char input routine MOVEM T1,CHARIN ;... ;+ ; Read a command and branch to the appropriate routine to handle it ;- PUSHJ P,VERSIO ;Print introduction SETZ R11, ;[012]Clear counts SETZB R12,R13 ;[012]... CMDLP: HRLS F ;Reset permanent flags MOVE T1,[6,,[IOWD CMDL,CMDN ;[024]Prepare to read command line XWD CMDD,CMDM ;[024]... XWD 0,CMDP ;[024]... XWD 2,.HELP## ;[024]... XWD FLEN,FAREA ;[024]... XWD 0,PAREA]] ;[024]... PUSHJ P,.VSCAN## ;[024]Read a command line MONRT. ;... JRST CMDLP ;else try again SUBTTL INITLN ;++ ; DESCRIPTION: ; ; This routine is used to initialize the terminal line to be used for ; transmitting or receiving. ; ; CALLING SEQUENCE: ; ; PUSHJ P,initln ; error ; success ; ; ; SIDE EFFECTS: ; ; Releases and deassigns any previously initted terminal line. ;-- INITLN::MOVEI T2,TTY ;See if a line previously set up DEVSTS T2, ;... JRST INIT10 ;...(No) SETZ T1, ;Deassign it MOVEI T2,TTY ;... REASSI T1, ;... RELEAS TTY, ;... INIT10: HRL T2,NODENO ;Get terminal name HRR T2,LINENO ;... MOVEM T2,TTYLIN ;...Store line & node first GTXTN. T2, ;... ERROR UTL,,.POPJ## MOVEM T2,TTYFD+.FDDEV ;Store name if tty desc block PJOB T1, ;Assign the line REASSI T1, ;... MOVE T1,[3,,[XWD 0,TTY ;Open a channel EXP UU.AIO ; asynchronously XWD 0,TTYFD]] ; to the terminal PUSHJ P,FOPEN## ; ... ERROR OPN,,.POPJ## SETSTS TTY,.IOPIM ;Use Packed Image Mode MOVEI T2,10 ;... MOVE T1,CH.FCB##+TTY ;[017]Get address of MOVEI T1,F%IBP(T1) ;[017] input byte pointer DPB T2,[POINT 6,(t1),11] ;... MOVE T1,CH.FCB##+TTY ;[017]Get address of the MOVEI T1,F%OBP(T1) ;[017] output byte pointer DPB T2,[POINT 6,(T1),11] ;... INBUF TTY, ;Allocate buffer space OUTBUF TTY, ;... MOVE T1,[3,,T2] ;Use up break character MOVEI T2,.TOSET+.TOPBS ;... MOVE T3,TTYFD ;... IONDX. T3, ;... HALT ; MOVE T4,L.EOL ;...(as my EOL character) TRMOP. T1, ;... HALT ; MOVE T1,[PS.FON!PS.FAC+TTYINT];Turn on tty interrupts PISYS. T1, ;... HALT ;... PJRST .POPJ1## ;Leave SUBTTL .PROMPT ;++ ; DESCRIPTION: ; ; This routine writes a default or user specified Kermit command ; prompt. It also handles output of continuation lines by prefixing ; the command prompt with an "_". ; ; ; CALLING SEQUENCE: ; ; /setz t1,\ ; \hrlz t1,-1/ ; pushj p,.prompt ; return ; ; ; FORMAL PARAMETERS: ; ; T1 - Register containing zero or if a continuation line ; then the LH(T1) equals -1. ;-- .PROMP: PUSH P,T2 ;Save T2 just in case MOVEM F,FLAGS ;[025]Save new flags HRLS FLAGS ;[025]Copy permanent ones MOVE F,FLAGS ;[025]Get new flags MOVE T2,PMTADR ;Get user defined prompt SKIPN (T2) ;Empty string? MOVEI T2,DPRMPT ;...Yes use default prompt OUTSTR (T2) ;Write prompt TLNE T1,-1 ;Continuation? SKIPA T2,["_"] ;...Yes MOVEI T2," " ;...No OUTCHR T2 ;... POP P,T2 ;Restore T2 POPJ P, ;Leave SUBTTL .ERROR ;++ ; DESCRIPTION: ; ; THis routine prints error messages. Depending on the current mode the ; message will either be printed as a text string or as an error packet ; to the controlling terminal. ; ; ; CALLING SEQUENCE: ; ; push p,[ addr ] ; pushj p,.error ; ; addr: asciz /message text/ ; ; ; FORMAL PARAMETERS: ; ; addr - Address of an ASCIZ string containing the message to be ; printed. ; ; ; SIDE EFFECTS: ; ; Sets .SCANS error flag .FLCBF ;-- .ERROR::PUSH P,AP ;[017]Save old arg ptr MOVEI AP,-2(P) ;[017]Get new arglst addr PUSHJ P,.PSH4T## ;[006]Save temporary registers SETZ T1, ;Direct output to the TTY PUSHJ P,.TYOCH## ;... MOVEI T1,TTY ;Is a line active? DEVSTS T1, ;.... JRST ERRO05 ;...(No) use ctrl tty MOVE T1,TTYLIN ;Same as the ctrolling tty? CAMN T1,CTLLIN ;...? JRST ERRO10 ;...(Yes) send error packet ERRO05: MOVE T1,(AP) ;[006]Get message address PUSHJ P,.TSTRG## ;Write message PUSHJ P,.TCRLF## ;Free CRLF JRST ERRO20 ;Finish up ERRO10: MOVEI T1,PTYO ;Get packet TYO routine PUSHJ P,.TYOCH## ;... SETZM DCNT ;Initialize PTYO data areas MOVEI T1,DATA ;... MOVEM T1,DADDR ;... MOVE T1,(AP) ;[006]Get message address PUSHJ P,.TSTRG## ;Write message to packet data area PUSH P,[TY.ERR] ;Send an error packet PUSH P,PACKNO ;... PUSH P,DCNT ;... PUSH P,[DATA] ;... PUSHJ P,SPACKT## ;... ERRO20: SETZ T1, ;Reset to default TYO routine PUSHJ P,.TYOCH## ;... MOVEI S,ST.A% ;Set state to abort SETOM .FLCBF## ;Tell .SCAN about the error TLNN F,F.RSER ;[037]Remote server? PUSHJ P,.RELTT ;Release TTY line PUSHJ P,.POP4T## ;Restore temporary registers POP P,AP ;[017]Restore AP SUB P,[2,,2] ;[017]Remove arg from stack PJRST @2(P) ;[017]Leave SUBTTL PTYO, .RELTT, INCPAK ;++ ; DESCRIPTION: ; ; THis routine writes a character from a .SCAN output routine to the ; packet data area. ; ; ; CALLING SEQUENCE: ; ; movei t1,"c" ; pushj p,ptyo ; return ;-- PTYO:: MOVEM T1,@DADDR ;Store character AOS DADDR ;Increment address AOS DCNT ;Increment count POPJ P, ;Leave PTYI:: MOVE C,@DADDR ;Get character AOS DADDR ;Skip over it SOSGE DCNT ;Decrement coung HRREI C,.CHEOL ;End of string POPJ P, ;LEave ;++ ; DESCRIPTION: ; ; This routine release and deassigns the terminal line. ; ; ; CALLING SEQUENCE: ; ; pushj p,.reltt ;-- .RELTT::MOVEI T1,TTY ;Get channel no DEVSTS T1, ;Is it active? POPJ P, ;Nope WAIT TTY, ;[030]Wait for it to finish MOVSI T1,(PS.FOF) ;Turn PISYS. T1, ; off the JFCL ; interrupts SETSTS TTY,.IOASC ;[030]Back to ascii mode MOVEI T2,TTY ;Get IONDX. T2, ; udx HALT ; number MOVEI T1,.TOOUC ;[030]Send out MOVEI T3,.CHCNQ ;[030] a control-Q MOVEI T4,[3,,T1] ;[030] to the TRMOP. T4, ;[030] line JFCL ;[030] ... MOVEI T1,.TOCIB ;Clear TTY's input buffer MOVE T3,[2,,T1] ;... TRMOP. T3, ;... JFCL ;... SETZ T1, ;Deassign it MOVEI T2,TTY ;... REASSI T1, ;... RELEAS TTY, ;... POPJ P, ;Leave INCPAK::MOVE T1,PACKNO ;Get current packet number MOVEM T1,PREVNO ;Store as the previous packet-no AOS T1 ;Increment packet number ANDI T1,77 ;...Mod 64 MOVEM T1,PACKNO ;... AOS T1 ;Get future packet number ANDI T1,77 ;... MOVEM T1,NEXTNO ;... POPJ P, ;... PTRTYI::ILDB T1,DPTR ;Get a character SKIPE T1 ;NULL? AOS (P) ;...No POPJ P, PTRTYO::IDPB T1,DPTR ;Store a character POPJ P, ;... RDSCNC::PUSHJ P,.SAVE4## ;Save P4 PUSHJ P,.TIAUC## ;Get a command character MOVE T1,C ;Store in return register SKIPLE T1 ;End of line? PJRST .POPJ1## ;...No PUSHJ P,.REEAT## ;...Yes remember POPJ P, ;... SUBTTL DEBUG. routines ;+ ; movei ap,arglst ; pushj p,dispak ;- DISPAK::PUSHJ P,.SAVE4## ;[017]Save some registers PUSHJ P,.PSH4T## ;[017]Save registers PUSH P,AP ;[017]Save old arg list DMOVE P1,(AP) ;[017]Copy arguments DMOVE P3,2(AP) ;[017] from arglst MOVEI AP,P1 ;[017]New arglst ptr SETZ T1, ;Clear typeout routine PUSHJ P,.TYOCH## ;... PUSH P,T1 ;... OUTCHR ["("] ;Start up OUTCHR (AP) ;Write Packet type OUTCHR [","] ;... MOVE T1,1(AP) ;Write packet number PUSHJ P,.TDECW## ;... OUTCHR [","] ;... MOVE T1,2(AP) ;Write packet length PUSHJ P,.TDECW## ;... OUTCHR [")"] ;Close up OUTCHR [" "] ;... MOVN T1,2(AP) ;IOWD datalen,dataddr HRL T1,3(AP) ;... MOVSS T1 ;... SKIPGE T1 ;Write out the data OUTCHR (T1) ;... AOBJN T1,.-1 ;... PUSHJ P,.TCRLF## ;Finish it off POP P,T1 ;Get original typeout routine PUSHJ P,.TYOCH## ;... POP P,AP ;[017]Restore old arg list PUSHJ P,.POP4T## ;[017]Restore registers POPJ P, ;... SUBTTL The TFDSCH and TFDESC routines ;++ ; DESCRIPTION: ; ; These routines writes a file specification on the terminal given a ; file description created via PARSE. ; ; ; CALLING SEQUENCE: ; ; MOVEI T1,desc ; PUSHJ P,TFDESC (TFDSCH) ; return ; ; ;-- TFDSCH::PUSH P,T1 ;Save parse descriptor block MOVEI T1,[ASCIZ"File "] ;Write prefix header POP P,T1 ;Restore descriptor block TFDESC::PUSHJ P,.SAVE1## ;Save a register MOVEI P1,(T1) ;Get block address MOVE T1,(P1) ;Write device PUSHJ P,.TSIXN## ;... PUSHJ P,.TCOLN## ;... MOVE T1,.FDNAM(P1) ;Write name PUSHJ P,.TSIXN## ;... MOVEI T1,"." ;... PUSHJ P,.TCHAR## ;... MOVE T1,.FDEXT(P1) ;Write extension PUSHJ P,.TSIXN## ;... MOVEI T1,.FDDIR(P1) ;Fake a directory block TLO T1,1 ;... PUSHJ P,.TDIRB## ;Let SCAN do the directory PJRST .TCRLF## ;... SUBTTL DISPLAY routine ;+ ; Displays packet and block number ;- DISPNO::TLNN F,F.DEBU ;Debugger on? TLNE F,F.SUPP ;Suppress on? POPJ P, ;...Yes MOVE T1,TTYLIN ;[040]Get transmit line CAMN T1,CTLLIN ;Same an cty line? POPJ P, ;Yes PUSHJ P,.SAVE1## ;Save a register MOVE T1,PACKNO ;Write current packet number MOVEI T2," " ;... MOVEI T3,12 ;... MOVEI T4,2 ;... PUSHJ P,.TFRXW## ;... OUTCHR ["("] ;Set up to type block number MOVE T1,CH.FCB##+CH ;[017]Get FCB address MOVE T1,F%BNUM(T1) ;[017] and get block-number MOVEI T2," " ;... MOVEI T3,12 ;... MOVEI T4,5 ;... PUSHJ P,.TFRXW## ;Write block number OUTCHR [")"] ;Close block number POPJ P, ;Leave ;+ ; Display file specification ;- DISFNM::TLNN F,F.DEBU ;Debugger on? TLNE F,F.SUPP ;Suppression on? POPJ P, ;...Yes MOVE T1,TTYLIN ;[040]Get transmit line CAMN T1,CTLLIN ;Same an cty line? POPJ P, ;Yes PUSHJ P,.SAVE1## ;Save a register MOVE P1,CH.FCB##+CH ;[017]Get FCB starting MOVEI P1,F%FCB(P1) ;[017] address MOVEI T1,F%OBLK(P1) ;Get OPEN block MOVEI T2,F%XBLK(P1) ;Get LOOKUP/ENTER block PUSHJ P,.TOLEB## ;Write file spec POPJ P, ;Leave ;+ ; Display both file spec and packet and block info ;- DISHDR::TLNN F,F.DEBU ;Debugger on? TLNE F,F.SUPP ;Suppression on? POPJ P, ;...Yes MOVE T1,TTYLIN ;[040]Get transmit line CAMN T1,CTLLIN ;Same an cty line? POPJ P, ;Yes OUTSTR [ASCIZ"File"] ;...No PUSHJ P,.TSPAC## ;... PUSHJ P,DISFNM ;... PUSHJ P,.TCRLF## ;... POPJ P, ;Leave ;+ ; Same as DISPNO w/CRLF ;- DISPBN::TLNN F,F.DEBU ;Debugger on? TLNE F,F.SUPP ;Suppression on? POPJ P, ;...Yes PUSHJ P,DISPNO ;...No OUTCHR [.CHCRT] ;Leave POPJ P, ;... TODAY: PUSHJ P,.TDATN## ;[016]Type the date PUSHJ P,.TSPAC## ;[016]and PUSHJ P,.TTIMN## ;[016]the time PJRST .TCRLF## ;[016]Leave w/crlf VERSIO: MOVEI T1,[ASCIZ"[Kermit Ver. "] ;[020]Intro message PUSHJ P,.TSTRG## ;[020]... MOVE T1,.JBVER## ;[020]Write version PUSHJ P,.TVERW## ;[020]number PUSHJ P,.TRBRK## ;[020]Close bracket PJRST .TCRLF ;[020]Leave w/crlf SUBTTL Interrupt routines ITTY: DEBRK. ;Nothing to do HALT ;... HALT ;... SUBTTL CHKXZ ;++ ; DESCRIPTION: ; ; This routine checks for a ^X and ^Z from the terminal in receive ; mode and sets the flags for termination of the file transfer. ; ;-- CHKXZ:: PUSH P,T1 ;[014]Save T1 register MOVE T1,TTYLIN ;[040]Get TTY line CAMN T1,CTLLIN ;[014] Same as CTY line? JRST CHKX10 ;[014]...No forget this SKIPA ;[014]...Yes continue MSCXZ:: PUSH P,T1 ;[014]Different entry point CHKX05: INCHRS T1 ;[014]Get current character JRST CHKX10 ;[014]None CAIN T1,.CHCNZ ;[014]Ctrl-Z? TLO F,F.EOFZ ;[014]...Yes CAIN T1,.CHCNX ;[014]Ctrl-X? TLO F,F.EOFX ;[014]...Yes CAIN T1,.CHCNC ;[014]Ctrl-C? EXIT ;[014]...Yes JRST CHKX05 ;[014]Flush buffer CHKX10: POP P,T1 ;[014]Restore T1 register POPJ P, ;[014]Leave DDT: PUSH P,.JBSA## ;[011]Save starting address MOVEM SAVREG ;[011]Save registers MOVE [XWD 1,SAVREG+1] ;[011]... BLT SAVREG+17 ;[011]... MOVEI T1,DDT10 ;[011]Return from DDT address HRRM T1,.JBSA## ;[011]... HRRZ T1,.JBDDT## ;[011]Get DDT starting addr SKIPE T1 ;[011]Loaded? JRST (T1) ;[011]...Yes ERROR CMD, ;[011]...No DDT10: MOVSI P,SAVREG ;[011]Restore registers BLT P,P ;[011]... POP P,.JBSA## ;[011]Restore starting addr POPJ P, ;[011]Leave SUBTTL DISPTH DISPTH::PUSHJ P,.SAVE4## ;[035]Save register P1 SETOM PTHBLK ;[035]Read MOVE T1,[-1,,PTHBLK] ;[035] path block PATH. T1, ;[035] ... JFCL ;[035] ... MOVE T1,[1,,PTHBLK+.PTPPN] ;[035]Type PUSHJ P,.TDIRB## ;[035] directory MOVE P1,PTHBLK+.PTSWT ;[035]Save switches TRNE P1,.PTSCY ;[035]/SCAN OUTSTR [ASCIZ"/SCAN"] ;[035] ... MOVEI T1,.PTFRL ;[035] ... MOVEM T1,PTHBLK ;[035] ... MOVE T1,[-1,,PTHBLK] ;[035]Read additional PATH. T1, ;[035] search path JFCL ;[035] ... MOVE P1,PTHBLK+.PTSWT ;[035]Save switches TRNE P1,PT.SNW ;[035]/NEW OUTSTR [ASCIZ"/NEW"] ;[035] ... TRNE P1,PT.SSY ;[035]/SYS OUTSTR [ASCIZ"/SYS"] ;[035] ... SKIPN PTHBLK+.PTPPN ;[035]/LIB: JRST PTH10 ;[035] No lib OUTSTR [ASCIZ"/LIB:"] ;[035] Yes SETZM PTHBLK+3 ;[035]Clear SFDs MOVE T1,[1,,PTHBLK+.PTPPN] ;[035]Write PUSHJ P,.TDIRB## ;[035] lib path PTH10: PUSHJ P,.TSPAC## ;[035]Space over SETO P2, ;[035]Start off SKIPA T1,["("] ;[025]Start structures PTH12: MOVEI T1,"," ;[035]Seperator MOVE P1,[3,,P2] ;[035]Get a JOBSTR P1, ;[035] name JRST PTH20 ;[035] ... CAMN P2,[-1] ;[035]Finished? JRST PTH20 ;[035] Yes JUMPE P2,PTH20 ;[035]Fence PUSHJ P,.TCHAR## ;[035]Write seperator MOVE T1,P2 ;[035]Get name PUSHJ P,.TSIXN## ;[035]Type name JRST PTH12 ;[035]Continue PTH20: MOVEI T1,")" ;[035]Finish up PUSHJ P,.TCHAR## ;[035] search list PJRST .TCRLF## ;[035]New line SUBTTL Data Storage RELOC DPRMPT::ASCIZ /Kermit-10>/ ;Default kermit prompt HLPFIL::ASCIZ /HLP:KERMIT.H5/ ;Online help file specification DEFINE SWTCHS < SP BYE, DUMMY, BYE## SP CONNEC, DUMMY, CONNEC## SP COPY, DUMMY, COPY## SP DAYTIM, DUMMY, TODAY SP DDT, DUMMY, DDT SP DELETE, DUMMY, DELETE## SP DIRECT, DUMMY, DIRECT## SP ERASE, DUMMY, DELETE## SP <*EXIT>,DUMMY, EXITER## SP FINISH, DUMMY, FINISH## SP GET, DUMMY, GET## SP <*HELP>,DUMMY, .HELP## SP INITIA, DUMMY, INITIA## SP KERMIT, DUMMY, KERCOM## SP LOCAL, DUMMY, LOCAL## SP LOGOUT, DUMMY, LOGOUT## SP NOSERV, DUMMY, NOSERV## SP PATH, DUMMY, PATHER## SP PRINT, DUMMY, PRINT## SP QUIT, DUMMY, QUITER## SP RECEIV, DUMMY, RECEIV## SP REMOTE, DUMMY, REMOTE## SP RENAME, DUMMY, RENAME## SP SEND, DUMMY, SEND## SP SERVER, DUMMY, SERVER## SP SET, DUMMY, SET## SP SHOW, DUMMY, SHOW## SP <*STATU>,DUMMY, STATUS## SP TYPE, DUMMY, TYPER## SP USAGE, DUMMY, USAGE## SP <*VERSI>,DUMMY, VERSIO SS DEBUG, ,1, FS.OBV SP DELAY, DELAY,.DELAY##,,FS.VRQ SS LONG, ,1, FS.OBV SS NONULL ,, 1 SS NONUMB, , 1 SS NOSHOR, , 1 SS NOTIFY, ,1, FS.OBV SS NULLS, , 0 SS NUMBER, , 0 SS SHORT, , 0 SS SLOCAL, , 0 SS SREMOT, ,1, FS.OBV SS SUPPRE, ,1, FS.OBV > DOSCAN CMD TRIES:: BLOCK 1 ;Number of tries so far PACKNO::BLOCK 1 ;Current packet number PREVNO::BLOCK 1 ;Previous packet number NEXTNO::BLOCK 1 ;Next (future) packet number INTBLK::EXP ITTY ;Transmission interrupt block EXP 0 ;... EXP 0 ;... EXp 0 ;... TTYINT::EXP TTY ;Channel XWD 0,PS.RID ;On input done XWD 0,0 ;Priority TTYFD:: BLOCK .FDMAX ;TTY file-desc TTYLIN::BLOCK 1 ;Trans TTY node,line CTLLIN::BLOCK 1 ;Control TTY node,line DCNT:: BLOCK 1 ;PTYO data count DADDR:: BLOCK 1 ;PTYO data area (indirect) DPTR:: BLOCK 1 ;PTYO data byte pointer CHKSUM::BLOCK 1 ;Current checksum total DUMMY::BLOCK 1 FAREA:: FLAGS:: EXP 0,0 ;Flags MARKER::EXP .CHCNA ;Start of packet marker PARITY::EXP PARIT% ;Default parity MXTRYS::EXP 5 ;Maximum no of retrys NODENO::BLOCK 1 ;Node number LINENO::BLOCK 1 ;Line number DCONFG:: ;Default Send_init data packet D.MAXL::EXP ^d80 ;Def maximum length D.TIME::EXP 5 ;Def time out D.NPAD::EXP 0 ;Def padding required on receives D.PADC::EXP 0 ;Def pad character on receives D.EOL:: EXP 15 ;Def EOL on receives D.QCTL::EXP <"#"> ;Quote char on sends D.QBIN::EXP <"&"> ;Binary quote character D.CHKT::EXP 1 ;Check sum type D.REPT::EXP <"~"> ;Repeat character D.CAPA::EXP 0 ;Capability mask CFLEN%==: .-DCONFG ;Send_init data length LCONFG:: ;Default Send_init data packet L.MAXL::EXP ^d80 ;Local maximum length L.TIME::EXP 5 ;Local time out L.NPAD::EXP 0 ;Local padding required on receives L.PADC::EXP 0 ;Local pad character on receives L.EOL:: EXP 15 ;Local EOL on receives L.QCTL::EXP <"#"> ;Quote char on sends LCLEN%==: .-LCONFG ;Length of local parm area RCONFG:: ;Default Send_init data packet R.MAXL::EXP ^d80 ;Remote maximum length R.TIME::EXP 5 ;Remote time out R.NPAD::EXP 0 ;Remote padding required on receives R.PADC::EXP 0 ;Remote pad character on receives R.EOL:: EXP 15 ;Remote EOL on receives R.QCTL::EXP <"#"> ;Quote char on sends QCONFG:: ;Global config info QBIN:: EXP <"&"> ;Binary quote character CHKT:: EXP 1 ;Check sum type REPT:: EXP <"~"> ;Repeat character CAPAS:: EXP 0 ;Capability mask ESCAPE::EXP 35 ;Escape character DELAY:: EXP 5 ;Delay time FTYPE:: BLOCK 1 ;SET FILE type PROMPT::BLOCK 100 ;Kermit prompt FLEN==.-FAREA ;[024]Length of FAREA PAREA:: BLOCK FLEN ;[024] DATA:: BLOCK 200 ;Data block DATA2:: BLOCK 200 ;Extra data block SAVREG::BLOCK 20 ;[011]Register save block SAVCOR::BLOCK 1 ;Save addr for .JBFF DATLEN::BLOCK 1 ;Length of current buffer CHARIN::BLOCK 1 ;Default char input routine address DAYTIM::BLOCK 1 ;Transfer starting time CCL: BLOCK 1 ;CCl entry point STACK:: BLOCK 1000 ;Stack block PATH:: BLOCK 36 ;FILE TYPE STUFF? DISP:: BLOCK 1 ;... ACCESS::BLOCK 1 ;... PMTADR::EXP PROMPT ;Kermit prompt address PTHBLK: BLOCK 12 ;[035]Path block DOSCAN SWT DEFINE SWTCHS < SN DEBUG, SP DELAY, DELAY,.DELAY##,,FS.VRQ SP EIGHTB, QBIN,SWEIG##,,FS.VRQ SP ESCAPE, ESCAPE,.OCTNW##,,FS.VRQ SN HELP, SP LINE, LINENO,.OCTNW##,,FS.VRQ SP LOCAL,, SWLOC##,,FS.VRQ SP MARKER, MARKER,.MARKE##,,FS.VRQ SS NOEIGH, , 0 SS NONULL, , 1 SS NONUMB, , 1 SS NOREPE, , 0 SN NOTIFY, SS NULLS, , 0 SS NUMBER, , 0 SP PROMPT, PROMPT,.ASCQW##,,FS.VRQ SP REMOTE,,SWRMT##,,FS.VRQ SP REPEAT, REPT,SWREPT##,,FS.VRQ SP RETRY, MXTRYS,.RETRY##,,FS.VRQ SN SUPPRE, > DOSCAN SINI END KERMIT