.TITLE KERXFR - KERMIT - TRANSFER ROUTINES .SBTTL D Stevens/S Hecht/RCM ; ; Kerxfr are the transfer routines for Pro/Kermit ; ; Created on Febuary 1,1984. ; ; Written by David Stevens ; Version number .IDENT /1.0.10/ ; Directives .LIBRARY /KERMLB/ ; Kermit macro library .ENABLE LC ; Allow lower case in .ASCIx .NLIST BEX ; Don't list binary expansions .SBTTL Revision History ;++ ; 1.0.00 By: Many On: Long time ; Create this module. ; ; 1.0.01 By: Robert C. McQueen On: 16-Feb-1984 ; Create XFRINI routine to initialize the transfer module. ; ; 1.0.02 By: David Stevens On: 22-Feb-1984 ; Allow use of MAIN SCREEN and EXIT function keys during ; generic commands. ; ; 1.0.03 By: Robert C. McQueen On: 6-March-1984 ; Fix problem with GETAST always posting a QIO even if we ; were attempting to kill the QIO. ; ; 1.0.04 By: David Stevens On: 7-March-1984 ; Change I/O routine used in generic commands to be the ; same I/O routine as used by KERFIL( inikey, and kilkey ). ; ; 1.0.05 By: Robert C. McQueen On: 12-March-1984 ; Make $PLIT$ become $TEXT$ psect and make it an even number of ; bytes. ; ; 1.0.06 By: Robert C. McQueen On: 14-March-1984 ; Redo the inter task communications between KERFIL and KERMIT ; ; 1.0.07 By: David Stevens On: 19-March-1984 ; Implement the remaining generic commands. ; ; 1.0.08 By: Robert C. McQueen On: 20-March-1984 ; Wait until the user presses RESUME after some of the ; generic commands. Make $OWN$ be word aligned again. ; Other random fix ups for generic command processing. ; ; 1.0.09 By: Robert C. McQueen On: 23-March-1984 ; Always wait for RESUME even if the function failed. This ; way the error message can be read by the user. ; ; 1.0.10 By: Robert C. McQueen On: 12-April-1984 ; Move SY.GENERIC to this module. ;-- .SBTTL Kermit symbol definitions ; ; THe following will cause the Pro/Kermit symbol definitions to be included ; in this module. ; .MCALL KERDEF ; Get the macro KERDEF ; Cause the symbols to be defined .MCALL CHRDEF ; Character definition macro CHRDEF ; Define the special characters .MCALL BITS ; Bit definitions BITS ; Define bit definitions .MCALL MSG ; Text message macro .MCALL BLSRTN ; Allow use of BLISS macros from .MCALL BLSCAL ; library .MCALL IOSBDF ; IOSB definitions IOSBDF ; Define the symbols .SBTTL Data section - ASCII strings ;++ ; Data for generic commands ;-- .PSECT $TEXT$, RO, D MSG FINE, MSG LOGO, M$GERR: .ASCIZ <.CHBEL>/Operation unsuccessful/ GERR$L=.-M$GERR .EVEN .SBTTL Data for exit from generic commands .PSECT $OWN$, D GENFLG::.BYTE 0 ; Flag to indicate a generic read is queued. .EVEN ; Back to Even addressing .SBTTL Initialization ;++ ; This routine will initialize the KERXFR module. It will set the type ; out routines in KERMSG to be off. ; ; Usage: ; JSR PC,XFRINI ; (Return) ; ;-- .PSECT $CODE$, RO, I XFRINI:: MOV #FALSE,TY.FIL ; Turn off the file tye out MOV #FALSE,TY.PKT ; And the packet type out RTS PC ; Return to the caller .SBTTL Operating system interface -- SY.GENERIC ;++ ; This routine is called by KERMSG to handle a generic command ;that needs operating system specific processing. ; ; Usage: ; ; Bliss: ; ; STATUS = SY_GENERIC (GTYPE, STRADR, STRSIZ, RTNADR) ; ; Where GTYPE is the GC.xxx value to indicate the type of generic ;command, STRADR is the place to store the address of a resulting ;string (if any), STRSIZ is the place to store the length of the ;resulting string. RTNADR is the place to return the address of a get-char ;routine. ;Note that if both STRSIZ and RTNADR are returned set to zero, ;KERMSG will expect FILE.NAME and FILE.SIZE to be set up with the ;file specification for a file to be sent in response to the packet. ; ; The status value returned should be NORMAL if the command is ;processed, UNIMPLGEN if the command is not implemented, or ;some other error specific to an error processing the command. ;-- BLSRTN SY.GENERIC, 5, MOV #UNIMPLGEN,R0 ; We don't do any yet RTS PC ; Just give up .SBTTL Commands -- SERVER ;++ ; This routine will handle the server command processing. It will set up ; the various information and then call the server routine in KERMSG. ; ; Usage: ; JSR PC,X$SERV ; (Return) ; ;-- .PSECT $CODE$, RO, I X$SERV::JSR PC,STARTRANS ; Set initial parameters. . . MOV #FALSE,NOSCRN ; Stop screen update BLSCAL SERVER ; Enter server mode for KERFIL JSR PC,S$RXFR ; Reset screen JSR PC,XK.SHT ; Shut down and reset XK parameters. JSR PC,KILKEY ; Kill all pending I/O RTS PC ; Return to caller. .SBTTL Generic commands ;++ ; This routine will handle the processing of generic commands. It assumes ; that the type of generic command has been stored in GENCMD in the common. ; ; Usage: ; JSR PC,X$GEN ; (Return) ; ;-- .PSECT $CODE$, RO, I X$GEN:: JSR PC,S$CLEAR ; Clear the screen JSR PC,INIKEY ; Queue up a terminal read. MOV #TRUE,GENFLG ; Stop screen painting. JSR PC,XK.INT ; Open and set the XK parameters BLSCAL DO.GENERIC, ; Do the generic command ; ; Now shut down the XK and the keyboard input ; MOV R0,-(SP) ; Save the status JSR PC,XK.SHT ; Shut down and reset XK parameters JSR PC,KILKEY ; Kill any pending terminal I/O. CLR GENFLG ; Clear the generic flag. MOV (SP)+,R0 ; Restore the status BIT #TRUE,R0 ; Check for an error in DO.GENERIC BNE 10$ ; If none then branch ; ; If here we got an error in DO.GENERIC ; MOV #GERR$L,R1 ; Get the error message length MOV #M$GERR,R2 ; Get the error message BLSCAL BL$MOV, ; Put Status of operation in menu MOV #FALSE,R0 ; Restore the error code ; ; If here then we got no error in DO.GENERIC ; 10$: MOV GENCMD,R1 ; Put index into R1. ; ; Make sure that value is within range ; CMP #GC.MIN,R1 ; Is GC.MIN greater than R1 ? BEQ 20$ ; If equal then branch. BPL 30$ ; Yes, branch for error. CMP #GC.MAX,R1 ; Is GC.MAX less than R1 ? BMI 30$ ; No; value out of range, branch. ; ; If here then the value is within the range. ; 20$: SUB #GC.MIN,R1 ; Correct the index value. ASL R1 ; Multiply value by 2. JSR PC,@GENDSP(R1) ; Go to routine pointed to. ; ; Exit from X$GEN ; 30$: RTS PC ; Return to sender .SBTTL Support for X$GEN - Dispatch table ; ; Generic command dispatch table ; .PSECT $PLIT$, RO, D GENDSP: .WORD GC$EXT ; Exit. .WORD GC$DIR ; Directory. .WORD GC$DSK ; Disk Usage. .WORD GC$DEL ; Delete. .WORD GC$TYP ; Type. .WORD GC$HLP ; Help. .WORD GC$LO ; Logout. .WORD GC$LIN ; Login. .WORD GC$CON ; Connect. .WORD GC$REN ; Rename. .WORD GC$CPY ; Copy. .WORD GC$JIP ; Show Users. .WORD GC$SND ; Send Message. .WORD GC$STA ; Status of Server. .WORD GC$COM ; Command. .SBTTL Support for X$GEN - GC$EXT and GC$LO ;++ ; These take care of the generic commands FINISH and LOGOUT ; ; Usage: ; JSR PC,@GENDSP(R0) ; (Return) ;-- .PSECT $CODE$, RO, I GC$EXT: BIT #TRUE,R0 ; Did this work? BEQ 99$ ; No, Skip this MOV #FINE$L,R1 ; Get length of message MOV #M$FINE,R2 ; Get address of message BLSCAL BL$MOV, ; Put Status of operation in menu 99$: RTS PC ; Return to caller ; This code is for LOGOUT GC$LO: BIT #TRUE,R0 ; Did this work? BEQ 99$ ; No, Skip this MOV #LOGO$L,R1 ; Get length of message MOV #M$LOGO,R2 ; Get address of message BLSCAL BL$MOV, ; Put Status of operation in menu 99$: RTS PC ; Return to caller .SBTTL Remainder of the various remote commands ;++ ; Currently the only thing that these routines will do is to ask for ; the user to press the RESUME key. ;-- .PSECT $CODE$, RO, I GC$DIR: GC$DSK: GC$DEL: GC$TYP: GC$HLP: GC$LIN: GC$CON: GC$REN: GC$CPY: GC$JIP: GC$SND: GC$STA: GC$COM: BIT #TRUE,NOSCRN ; Check to see if we are watching BNE 99$ ; transfer, If not then branch BLSCALL TT.TEXT,#M$RES ; Output the message BLSCALL TT.OUTPUT ; Force it out CALL WTRES ; Do a regular wait for resume 99$: RTS PC ; Return to the caller .SBTTL End of KERXFR .END