home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / decpro300 / proxfr.mac < prev    next >
Text File  |  2020-01-01  |  8KB  |  322 lines

  1.     .TITLE    KERXFR - KERMIT - TRANSFER ROUTINES
  2.     .SBTTL    D Stevens/S Hecht/RCM
  3.  
  4. ;
  5. ; Kerxfr are the transfer routines for Pro/Kermit
  6. ;
  7. ;   Created on Febuary 1,1984.
  8. ;
  9. ;   Written by David Stevens
  10.  
  11. ; Version number
  12.  
  13.     .IDENT    /1.0.10/
  14.  
  15. ; Directives
  16.  
  17.     .LIBRARY /KERMLB/        ; Kermit macro library
  18.     .ENABLE    LC            ; Allow lower case in .ASCIx
  19.     .NLIST    BEX            ; Don't list binary expansions
  20.  
  21.     .SBTTL    Revision History
  22.  
  23. ;++
  24. ; 1.0.00    By: Many            On: Long time
  25. ;        Create this module.
  26. ;
  27. ; 1.0.01    By: Robert C. McQueen        On: 16-Feb-1984
  28. ;        Create XFRINI routine to initialize the transfer module.
  29. ;
  30. ; 1.0.02    By: David Stevens        On: 22-Feb-1984
  31. ;        Allow use of MAIN SCREEN and EXIT function keys during
  32. ;        generic commands.
  33. ;
  34. ; 1.0.03    By: Robert C. McQueen        On: 6-March-1984
  35. ;        Fix problem with GETAST always posting a QIO even if we
  36. ;        were attempting to kill the QIO.
  37. ;
  38. ; 1.0.04    By: David Stevens        On: 7-March-1984
  39. ;        Change I/O routine used in generic commands to be the
  40. ;        same I/O routine as used by KERFIL( inikey, and kilkey ).
  41. ;
  42. ; 1.0.05    By: Robert C. McQueen        On: 12-March-1984
  43. ;        Make $PLIT$ become $TEXT$ psect and make it an even number of
  44. ;        bytes.
  45. ;
  46. ; 1.0.06    By: Robert C. McQueen        On: 14-March-1984
  47. ;        Redo the inter task communications between KERFIL and KERMIT
  48. ;
  49. ; 1.0.07    By: David Stevens        On: 19-March-1984
  50. ;        Implement the remaining generic commands.
  51. ;
  52. ; 1.0.08    By: Robert C. McQueen        On: 20-March-1984
  53. ;        Wait until the user presses RESUME after some of the
  54. ;        generic commands.  Make $OWN$ be word aligned again.
  55. ;        Other random fix ups for generic command processing.
  56. ;
  57. ; 1.0.09    By: Robert C. McQueen        On: 23-March-1984
  58. ;        Always wait for RESUME even if the function failed.  This
  59. ;        way the error message can be read by the user.
  60. ;
  61. ; 1.0.10    By: Robert C. McQueen        On: 12-April-1984
  62. ;        Move SY.GENERIC to this module.
  63. ;--
  64.  
  65.     .SBTTL    Kermit symbol definitions
  66. ;
  67. ; THe following will cause the Pro/Kermit symbol definitions to be included
  68. ; in this module.
  69. ;
  70.  
  71.     .MCALL    KERDEF            ; Get the macro
  72.     KERDEF                ; Cause the symbols to be defined
  73.  
  74.     .MCALL    CHRDEF            ; Character definition macro
  75.     CHRDEF                ; Define the special characters
  76.  
  77.     .MCALL    BITS            ; Bit definitions
  78.     BITS                ; Define bit definitions
  79.  
  80.     .MCALL    MSG            ; Text message macro
  81.     .MCALL    BLSRTN            ; Allow use of BLISS macros from
  82.     .MCALL    BLSCAL            ;   library
  83.     .MCALL    IOSBDF            ; IOSB definitions
  84.     IOSBDF                ;  Define the symbols
  85.  
  86.     .SBTTL    Data section - ASCII strings
  87.  
  88. ;++
  89. ; Data for generic commands
  90. ;--
  91.  
  92.     .PSECT    $TEXT$, RO, D
  93.  
  94.     MSG    FINE,<Remote Kermit exited>
  95.     MSG    LOGO,<Remote Kermit logged out>
  96. M$GERR:    .ASCIZ    <.CHBEL>/Operation unsuccessful/
  97. GERR$L=.-M$GERR
  98.     .EVEN
  99.  
  100.  
  101.     .SBTTL    Data for exit from generic commands
  102.  
  103.     .PSECT    $OWN$,    D
  104.  
  105. GENFLG::.BYTE    0            ; Flag to indicate a generic read is queued.
  106.     .EVEN                ; Back to Even addressing
  107.  
  108.     .SBTTL    Initialization
  109.  
  110. ;++
  111. ; This routine will initialize the KERXFR module.  It will set the type
  112. ; out routines in KERMSG to be off.
  113. ;
  114. ; Usage:
  115. ;    JSR    PC,XFRINI
  116. ;    (Return)
  117. ;
  118. ;--
  119.  
  120.     .PSECT    $CODE$, RO, I
  121.  
  122. XFRINI::
  123.     MOV    #FALSE,TY.FIL        ; Turn off the file tye out
  124.     MOV    #FALSE,TY.PKT        ; And the packet type out
  125.     RTS    PC            ; Return to the caller
  126.  
  127.     .SBTTL    Operating system interface -- SY.GENERIC
  128.  
  129. ;++
  130. ; This routine is called by KERMSG to handle a generic command
  131. ;that needs operating system specific processing.
  132. ;
  133. ; Usage:
  134. ;
  135. ; Bliss:
  136. ;
  137. ;    STATUS = SY_GENERIC (GTYPE, STRADR, STRSIZ, RTNADR)
  138. ;
  139. ; Where GTYPE is the GC.xxx value to indicate the type of generic
  140. ;command, STRADR is the place to store the address of a resulting
  141. ;string (if any), STRSIZ is the place to store the length of the
  142. ;resulting string. RTNADR is the place to return the address of a get-char
  143. ;routine.
  144. ;Note that if both STRSIZ and RTNADR are returned set to zero,
  145. ;KERMSG will expect FILE.NAME and FILE.SIZE to be set up with the
  146. ;file specification for a file to be sent in response to the packet.
  147. ;
  148. ; The status value returned should be NORMAL if the command is
  149. ;processed, UNIMPLGEN if the command is not implemented, or
  150. ;some other error specific to an error processing the command.
  151. ;--
  152.     BLSRTN    SY.GENERIC, 5, <GTYPE, STRADR, STRSIZ, RTNADR>
  153.     MOV    #UNIMPLGEN,R0        ; We don't do any yet
  154.     RTS    PC            ; Just give up
  155.  
  156.     .SBTTL    Commands -- SERVER
  157.  
  158. ;++
  159. ; This routine will handle the server command processing.  It will set up
  160. ; the various information and then call the server routine in KERMSG.
  161. ;
  162. ; Usage:
  163. ;    JSR    PC,X$SERV
  164. ;    (Return)
  165. ;
  166. ;--
  167.     .PSECT    $CODE$,    RO, I
  168.  
  169. X$SERV::JSR    PC,STARTRANS        ; Set initial parameters. . .
  170.     MOV    #FALSE,NOSCRN        ; Stop screen update
  171.     BLSCAL    SERVER            ; Enter server mode for KERFIL
  172.     JSR    PC,S$RXFR        ; Reset screen
  173.     JSR    PC,XK.SHT        ; Shut down and reset XK parameters.
  174.     JSR    PC,KILKEY        ; Kill all pending I/O
  175.     RTS    PC            ; Return to caller.
  176.  
  177.     .SBTTL    Generic commands
  178.  
  179. ;++
  180. ; This routine will handle the processing of generic commands.  It assumes
  181. ; that the type of generic command has been stored in GENCMD in the common.
  182. ;
  183. ; Usage:
  184. ;    JSR    PC,X$GEN
  185. ;    (Return)
  186. ;
  187. ;--
  188.  
  189.     .PSECT    $CODE$,  RO, I
  190.  
  191. X$GEN::    JSR    PC,S$CLEAR        ; Clear the screen
  192.     JSR    PC,INIKEY        ; Queue up a terminal read.
  193.     MOV    #TRUE,GENFLG        ; Stop screen painting.
  194.     JSR    PC,XK.INT        ; Open and set the XK parameters
  195.     BLSCAL    DO.GENERIC,<GENCMD>    ; Do the generic command
  196. ;
  197. ; Now shut down the XK and the keyboard input
  198. ;
  199.     MOV    R0,-(SP)        ; Save the status
  200.     JSR    PC,XK.SHT        ; Shut down and reset XK parameters
  201.     JSR    PC,KILKEY        ; Kill any pending terminal I/O.
  202.     CLR    GENFLG            ; Clear the generic flag.
  203.     MOV    (SP)+,R0        ; Restore the status
  204.  
  205.     BIT    #TRUE,R0        ; Check for an error in DO.GENERIC
  206.     BNE    10$            ; If none then branch
  207. ;
  208. ; If here we got an error in DO.GENERIC
  209. ;
  210.     MOV    #GERR$L,R1        ; Get the error message length
  211.     MOV    #M$GERR,R2        ; Get the error message
  212.     BLSCAL    BL$MOV,<R1,R2,#MSG1>     ; Put Status of operation in menu
  213.     MOV    #FALSE,R0        ; Restore the error code
  214. ;
  215. ; If here then we got no error in DO.GENERIC
  216. ;
  217. 10$:    MOV    GENCMD,R1        ; Put index into R1.
  218. ;
  219. ; Make sure that value is within range
  220. ;
  221.     CMP    #GC.MIN,R1        ; Is GC.MIN greater than R1 ?
  222.     BEQ    20$            ; If equal then branch.
  223.     BPL    30$            ; Yes, branch for error.
  224.     CMP    #GC.MAX,R1        ; Is GC.MAX less than R1 ?
  225.     BMI    30$            ; No; value out of range, branch.
  226. ;
  227. ; If here then the value is within the range.
  228. ;
  229. 20$:    SUB    #GC.MIN,R1        ; Correct the index value.
  230.     ASL    R1            ; Multiply value by 2.
  231.     JSR    PC,@GENDSP(R1)        ; Go to routine pointed to.
  232. ;
  233. ; Exit from X$GEN
  234. ;
  235. 30$:    RTS    PC            ; Return to sender
  236.  
  237.     .SBTTL    Support for X$GEN - Dispatch table
  238.  
  239. ;
  240. ; Generic command dispatch table
  241. ;
  242.  
  243.     .PSECT    $PLIT$,    RO,    D
  244.  
  245. GENDSP:    .WORD    GC$EXT            ; Exit.
  246.     .WORD    GC$DIR            ; Directory.
  247.     .WORD    GC$DSK            ; Disk Usage.
  248.     .WORD    GC$DEL            ; Delete.
  249.     .WORD    GC$TYP            ; Type.
  250.     .WORD    GC$HLP            ; Help.
  251.     .WORD    GC$LO            ; Logout.
  252.     .WORD    GC$LIN            ; Login.
  253.     .WORD    GC$CON            ; Connect.
  254.     .WORD    GC$REN            ; Rename.
  255.     .WORD    GC$CPY            ; Copy.
  256.     .WORD    GC$JIP            ; Show Users.
  257.     .WORD    GC$SND            ; Send Message.
  258.     .WORD    GC$STA            ; Status of Server.
  259.     .WORD    GC$COM            ; Command.
  260.  
  261.     .SBTTL    Support for X$GEN - GC$EXT and GC$LO
  262.  
  263. ;++
  264. ; These take care of the generic commands FINISH and LOGOUT
  265. ;
  266. ; Usage:
  267. ;    JSR    PC,@GENDSP(R0)
  268. ;    (Return)
  269. ;--
  270.  
  271.     .PSECT    $CODE$,    RO, I
  272.  
  273. GC$EXT:    BIT    #TRUE,R0        ; Did this work?
  274.     BEQ    99$            ; No, Skip this
  275.     MOV    #FINE$L,R1        ; Get length of message
  276.     MOV    #M$FINE,R2        ; Get address of message
  277.     BLSCAL    BL$MOV,<R1,R2,#MSG1>     ; Put Status of operation in menu
  278. 99$:    RTS    PC            ; Return to caller
  279.  
  280.  
  281. ; This code is for LOGOUT
  282.  
  283. GC$LO:    BIT    #TRUE,R0        ; Did this work?
  284.     BEQ    99$            ; No, Skip this
  285.     MOV    #LOGO$L,R1        ; Get length of message
  286.     MOV    #M$LOGO,R2        ; Get address of message
  287.     BLSCAL    BL$MOV,<R1,R2,#MSG1>     ; Put Status of operation in menu
  288. 99$:    RTS    PC            ; Return to caller
  289.  
  290.     .SBTTL    Remainder of the various remote commands
  291.  
  292. ;++
  293. ; Currently the only thing that these routines will do is to ask for 
  294. ; the user to press the RESUME key.
  295. ;--
  296.  
  297.     .PSECT    $CODE$, RO, I
  298.  
  299. GC$DIR:
  300. GC$DSK:
  301. GC$DEL:
  302. GC$TYP:
  303. GC$HLP:
  304. GC$LIN:    
  305. GC$CON:    
  306. GC$REN:    
  307. GC$CPY:    
  308. GC$JIP:    
  309. GC$SND:    
  310. GC$STA:    
  311. GC$COM:
  312.     BIT    #TRUE,NOSCRN        ; Check to see if we are watching
  313.     BNE    99$            ;   transfer, If not then branch
  314.     BLSCALL    TT.TEXT,#M$RES        ; Output the message
  315.     BLSCALL    TT.OUTPUT        ; Force it out
  316.     CALL    WTRES            ; Do a regular wait for resume
  317. 99$:    RTS    PC            ; Return to the caller
  318.  
  319.     .SBTTL    End of KERXFR
  320.  
  321.     .END
  322.