home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / decpro300 / promnu.mac < prev    next >
Text File  |  2020-01-01  |  101KB  |  3,899 lines

  1.     .TITLE    KERMNU - Kermit menu routines
  2.     .SBTTL    S Hecht/D Stevens/R McQueen        14-July-1983
  3.  
  4. ;++
  5. ; This module contains the command parser for the menu driven
  6. ; commands.  It is assumed that this version of KERMIT is installed in
  7. ; a menu and run from there.
  8. ;--
  9.  
  10. ; Version number
  11.  
  12.     .IDENT    /1.0.20/        ; For the loader
  13.  
  14. ; Directives
  15.  
  16.     .ENABL    LC            ; Enable lower case characters
  17.     .NLIST    BEX            ; Don't list binary expansions
  18.     .LIBRARY /KERMLB/        ; Kermit library
  19.  
  20.     .SBTTL    Revision History
  21.  
  22. ;++
  23. ;
  24. ; 1.0.00    By: Robert C. McQueen        On: 27-Dec-1983
  25. ;        Create this module
  26. ;
  27. ; 1.0.01    By: Robert C. McQueen        On: 15-Feb-1984
  28. ;        Move a few routines to this module from KERMIT.
  29. ;
  30. ; 1.0.02    By: Robert C. McQueen        On: 17-Feb-1984
  31. ;        Add a new routine to handle the fatal errors from the
  32. ;        menu processing.  This routine will give a better
  33. ;        error message.
  34. ;
  35. ; 1.0.03    By: Stuart Hecht        On: 24-Feb-1984
  36. ;        Add code to make help available from the baud rate menus.
  37. ;
  38. ; 1.0.04    By: Stuart Hecht        On: 24-Feb-1984
  39. ;        Adjust length values since KERMLB was changed to not include
  40. ;        the null byte.
  41. ;
  42. ; 1.0.05    By: Robert C. McQueen        On: 29-Feb-1984
  43. ;        Reduce the KERMSG module size by adding the capability
  44. ;        of not calling an action routine, but making the "routine"
  45. ;        an address to store the value in.  This runs off of FT.STORE
  46. ;        in the frame block.
  47. ;
  48. ; 1.0.06    By: Robert C. McQueen        On: 29-Feb-1984
  49. ;        Add validity checks for the values that are set.
  50. ;
  51. ; 1.0.07    By: Robert C. McQueen        On: 5-March-1984
  52. ;        No need to attach to the terminal, so don't do it.
  53. ;
  54. ; 1.0.08    By: Robert C. McQueen        On: 5-March-1984
  55. ;        Support P/OS services.
  56. ;
  57. ; 1.0.09    By: Robert C. McQueen        On: 8-March-1984
  58. ;        Disallow setting parameters when KERFIL is active.
  59. ;
  60. ; 1.0.10    By: Robert C. McQueen        On: 14-March-1984
  61. ;        Redo inter-task communications.  Allow the user to abort
  62. ;        KERFIL if it is running.
  63. ;
  64. ; 1.0.11    By: Robert C. McQueen        On: 15-March-1984
  65. ;        Initial work for the remote commands.
  66. ;
  67. ; 1.0.12    By: Robert C. McQueen        On: 19-March-1984
  68. ;        Add addition remote command support.
  69. ;
  70. ; 1.0.13    By: Robert C. McQueen        On: 20-March-1984
  71. ;        Change WAIT to be SNDPKT to avoid a global symbol conflict.
  72. ;
  73. ; 1.0.14    By: David Stevens        On: 21-March-1984
  74. ;        Change Blscal to INPUT to pass along the length of the 
  75. ;        input prompt.  Also allow R$DISK to accept a null input.
  76. ;
  77. ; 1.0.15    By: Robert C. McQueen        On: 23-March-1984
  78. ;        Add additional remote Kermit commands.
  79. ;
  80. ; 1.0.16    By: Robert C. McQueen        On: 26-March-1984
  81. ;        Add support for the ADDTNL OPTIONS key in menus.
  82. ;        Use it for chaining the remote commands off of the main menu.
  83. ;        Remove the REMOTE, LOGOUT and FINISH entries in the main menu.
  84. ;
  85. ; 1.0.17    By: Robert C. McQueen        On: 27-March-1984
  86. ;        Append the positioning string to the prompts in KERMIT,
  87. ;        don't hardwire them in here.
  88. ;
  89. ; 1.0.18    By: Robert C. McQueen        On: 28-March-1984
  90. ;        Fix some minor problems with the main menu not handling
  91. ;        MAIN SCREEN and EXIT returns correctly.
  92. ;
  93. ; 1.0.19    By: Robert C. McQueen        On: 6-April-1984
  94. ;        Fix problem with GETINP from the addtion of the SETESC
  95. ;        routine.
  96. ;
  97. ; 1.0.20    By: Robert C. McQueen        On: 16-April-1984
  98. ;        KERCON (terminal emulation) is now a seperate task.  Handle it
  99. ;        that way.
  100. ;--
  101.  
  102.     .SBTTL    Macro library calls
  103.  
  104. ;++
  105. ; The following are the various macros that are found in the KERMLB
  106. ; macro library.  This will cause the macros to be processed in this
  107. ; module.
  108. ;--
  109.  
  110.     .MCALL    BLSCAL            ; Macro to call BLISS routines
  111.     .MCALL    BLSRTN            ; Macro to define BLISS callable rtns
  112.     .MCALL    CHRDEF            ; Character name definitions
  113.     .MCALL    KERDEF            ; Kermit symbol definitions
  114.     .MCALL    BLOCK            ; Define data structures macro
  115.     .MCALL    SETBLK            ; Macro to store into the block
  116.     .MCALL    BITS            ; Bit definitions
  117.     .MCALL    TABLE            ; Table building macro for text
  118.     .MCALL    MSG            ; For ASCII text definition
  119.     .MCALL    PJMP            ; Jump to a routine that "popjs"
  120.  
  121. ; Now expand the calls required for the symbol definitions
  122.  
  123.     CHRDEF                ; Character definitions
  124.     KERDEF                ; Kermit symbol definitions
  125.     BITS                ; Define the bit definitions
  126. ;++
  127. ; The following are for system directives
  128. ;--
  129.  
  130.     .MCALL    STSE$S            ; Stop and wait for a single event
  131.     .MCALL    SPWN$S            ; Spawn a task
  132.     .MCALL    DIR$            ; Issue a system directive
  133.  
  134.     .SBTTL    Key values
  135.  
  136. ;++
  137. ; The following are the various key values that can be returned
  138. ; by the MENU processing.
  139. ;--
  140.  
  141.     ST.KEY==    -14.        ; Other than DO key pressed
  142.  
  143. ;    KY.RSV=    1.        ; Reserved
  144. ;    KY.RSV=    2.        ; Reserved
  145.     KY.BRK=    3.        ; Break key
  146.     KY.STP=    4.        ; SETUP key
  147.     KY.F5=    5.        ; F5 key
  148. ;    KY.RSV=    6.        ; Reserved
  149.     KY.RSM=    7.        ; RESUME key
  150.     KY.CAN=    8.        ; CANCEL key
  151.     KY.MAI==    9.        ; MAIN SCREEN key
  152.     KY.EXI==    10.        ; EXIT key
  153.     KY.F11=    11.        ; F11 key
  154.     KY.F12=    12.        ; F12 key
  155.     KY.F13=    13.        ; F13 key
  156.     KY.AOP=    14.        ; Additional options
  157.     KY.HLP=    15.        ; HELP key
  158.     KY.DO=    16.        ; DO key
  159.     KY.F17=    17.        ; F17 key
  160.     KY.F18=    18.        ; F18 key
  161.     KY.F19=    19.        ; F19 key
  162.     KY.F20=    20.        ; F20 key
  163.  
  164.     .SBTTL    Macro definitions -- KEYS and KEY macros
  165.  
  166. ;++
  167. ; The following defines the KEYS and KEY macros.  These are used to
  168. ; build the function key dispatch tables.  These tables are used to
  169. ; call DOMENU.
  170. ;--
  171.  
  172. .MACRO    KEYS    LABEL,MCRNAM
  173. ;;
  174. ;; First define the label for the keyword table.
  175. ;;
  176. K$'LABEL:
  177. ;;
  178. ;; The format of the table is that the first word contains the length
  179. ;; of the table and the following words contain the information.
  180. ;;
  181.     .WORD    LABEL'$L
  182. ;;
  183. ;; The following macro will define the key values that are acceptable for
  184. ;; this frame.
  185. ;;
  186.     .MACRO KEY    KEYVAL,RTN
  187.     .WORD    KEYVAL
  188.     .ENDM
  189.     MCRNAM
  190. LABEL'$L=<<.-K$'LABEL>/2>-1
  191. ;;
  192. ;; Now expand the macro so that we will have the routines that get called
  193. ;; directly after the values.
  194. ;;
  195.     .MACRO KEY    KEYVAL,RTN
  196.     .WORD    RTN
  197.     .ENDM
  198.     MCRNAM
  199. .ENDM    ; End of KEYS macro definition
  200.  
  201.     .SBTTL    Frame block definition
  202.  
  203. ;++
  204. ; The following is the offset definitions for the frame blocks.  The frame
  205. ; blocks are generated by the FRAMES/FRAME and DOFRAM macros.  These macros
  206. ; can be found on the next page.
  207. ;--
  208.  
  209.     BLOCK    FR        ; Frame block
  210.     .X    ID        ; Frame id block
  211.     .XX    ILN        ; Frame id length
  212.     .XX    TYP        ; Frame type
  213.       FT.STATIC=B0        ;  Static menu
  214.       FT.DYNAMIC=B1        ;  Dynamic menu
  215.       FT.STORE=B2        ;  Store directly instead of calling SET routine
  216.       FT.ADDO=B3        ;  Additional options allowed
  217.     .X    MNU        ; Address of menu dispatch processing block
  218.     .X    MLN        ; Length of the menu dispatch table
  219.     .X    LEN,0        ; Length of a frame block
  220.  
  221.     .SBTTL    Macro definitions -- FRAMES - Various FRAMES and attributes
  222.  
  223. ;++
  224. ; The following macro will define the names of the various possible frames that
  225. ; can be found in PRO/Kermit.  These are used to call the various routines
  226. ; to display the information on the screen.
  227. ;
  228. ; Usage:
  229. ;    .macro    FRAMES
  230. ;    FRAME    4-Char-name,Frame-id,Type,Menu-dispatch-table
  231. ;    .endm
  232. ;
  233. ;--
  234.  
  235. .MACRO    FRAMES
  236. FRAME    MAIN,MAIN,FT.STATIC!FT.ADDO,MAINMN
  237. FRAME    REMT,REMOTE,FT.STATIC!FT.ADDO,REMMNU
  238. FRAME    REM2,REMOTE2,FT.STATIC!FT.ADDO,RM2MNU
  239. FRAME    ACTV,ACTIVE,FT.STATIC,ACTMNU
  240. FRAME    POS,POS,FT.STATIC,POSMNU
  241. FRAME    SET,SET,FT.STATIC,SETMNU
  242. FRAME    LINE,LINE,FT.STATIC,LINMNU
  243. FRAME    PAR,PARITY,FT.STATIC,PARMNU
  244. FRAME    SEND,SEND,FT.DYNAMIC!FT.STORE,SNDMNU
  245. FRAME    RECV,RECEIVE,FT.DYNAMIC!FT.STORE,RCVMNU
  246. FRAME    FILE,FILE,FT.DYNAMIC!FT.STORE,FILMNU
  247. FRAME    FSPC,FILESPEC,FT.STATIC,FSPMNU
  248. FRAME    FMOD,FILEMODE,FT.STATIC,FMDMNU
  249. FRAME    FDSP,FILEDISP,FT.STATIC,FDSMNU
  250. FRAME    LCHR,LINECHAR,FT.DYNAMIC,LCHMNU
  251. FRAME    MODM,MODEM,FT.STATIC,MDMMNU
  252. FRAME    TCHR,TERMCHAR,FT.DYNAMIC!FT.STORE,TCHMNU
  253. FRAME    GEN,GENERAL,FT.DYNAMIC!FT.STORE,GENMNU
  254. FRAME    BCHK,BLOCKCHK,FT.STATUS,BLKMNU
  255. ;FRAME    DATA,DATABITS,FT.STATIC
  256. .ENDM
  257.  
  258. .MACRO    DOFRAM
  259. ;;
  260. ;; First expand the frame names
  261. ;;
  262.     .MACRO FRAME NAME,FRAMEID,TYPE,DSPTBL    ;; Define the FRAME macro
  263.     MSG    NAME,<FRAMEID>            ;;  to expand the FRAMEID as
  264.     .ENDM                    ;; text
  265.     FRAMES                    ;; Generate the text
  266. ;;
  267. ;; Now expand the frame information blocks
  268. ;;
  269.     .MACRO FRAME NAME,FRAMID,TYPE,DSPTBL    ;; Define the FRAME macro
  270. F$'NAME:                    ;; to build the frame info blks
  271.     .WORD    M$'NAME                ;; Generate the addr of the id
  272.     .BYTE    NAME'$L                ;;[04] Generate the length
  273.     .BYTE    TYPE                ;; Generate the menu type
  274.     .IF B <DSPTBL>
  275.         .WORD 0,0                ;; Zero denotes no table
  276.     .IFF
  277.         .WORD NAME'$M            ;; Point to the action table
  278.         .WORD NAME'$C            ;; Count of the number of items
  279.     .ENDC
  280.     .ENDM
  281.  
  282.     FRAMES                    ;; Generate the frame blocks
  283. ;;
  284. ;; Now generate the menu action tables if they are needed.
  285. ;;
  286.     .MACRO FRAME NAME,FRAMID,TYPE,DSPTBL    ;; Define the FRAME macro
  287.     .IF NB <DSPTBL>
  288.         BLDMNU NAME,DSPTBL
  289.     .ENDC
  290.     .ENDM
  291.  
  292.     FRAMES                    ;; Generate menu blocks
  293. .ENDM    ; End of DOFRAM macro definition
  294.  
  295.     .SBTTL    Macro definitions -- BLDMNU - Build menu dispatches
  296.  
  297. ;++
  298. ; This macro will build the dispatch tables for the menu processing.
  299. ;
  300. ; This macro will expand the various other macros
  301. ;
  302. ; Usage:
  303. ;    BLDMNU    XXXX,Macro.name
  304. ;
  305. ; Each entry in the 'Macro.name' has the following format:
  306. ;
  307. ;    MN    <2-chars>,Action.routine,Input.routine,Dynamic.menu.routine
  308. ;
  309. ;--
  310.  
  311. .MACRO    BLDMNU NAME,MCRNAM
  312. ;;++
  313. ;; First build the offset table
  314. ;;--
  315.     .MACRO MN    CHARS,ACTRTN,INPRTN,DYNRTN
  316.     .ASCII    ^CHARS^            ;; Characters to find routine
  317.     .ENDM
  318. NAME'$M:                ;; Define the dispatch table
  319.     MCRNAM                ;; Expand the macro
  320. NAME'$C==<.-NAME'$M>            ;; Define the length
  321. ;;++
  322. ;; Now build the set routines
  323. ;;--
  324.     .MACRO MN    CHARS,ACTRTN,INPRTN,DYNRTN
  325.     .IF B <ACTRTN>
  326.         .WORD 0            ;; If no routine, gen a zero
  327.     .IFF
  328.         .WORD ACTRTN        ;; Generate the routine address
  329.     .ENDC
  330.     .ENDM
  331.     MCRNAM                ;; Define the set routines
  332. ;;++
  333. ;; Now build the input routines
  334. ;;--
  335.     .MACRO MN    CHARS,ACTRTN,INPRTN,DYNRTN
  336.     .IF B <INPRTN>
  337.         .WORD 0            ;; If no routine, gen a zero
  338.     .IFF
  339.         .WORD INPRTN        ;; Generate the routine address
  340.     .ENDC
  341.     .ENDM
  342.     MCRNAM                ;; Define the input routine
  343. ;;++
  344. ;; Now build the dynamic set routines
  345. ;;--
  346.     .MACRO MN    CHARS,ACTRTN,INPRTN,DYNRTN
  347.     .IF B <DYNRTN>
  348.         .WORD 0            ;; If no routine, gen a zero
  349.     .IFF
  350.         .WORD DYNRTN        ;; Generate the routine address
  351.     .ENDC
  352.     .ENDM                ;; End MN macro definition
  353.     MCRNAM                ;; Define the dynamic routines
  354.  
  355. .ENDM
  356.  
  357.     .SBTTL    Macro definitions -- MAINMN - Main menu
  358.  
  359. ;++
  360. ; The following macro definition defines the MAIN MENU definitions and
  361. ; command names.
  362. ;--
  363.  
  364. .MACRO    MAINMN
  365.     MN    BE,C$BYE,,            ;; BYE command
  366.     MN    ST,C$SET,,            ;; SET command
  367.     MN    SS,STATE,,            ;; STATUS command
  368.     MN    GE,C$GET,,            ;; GET file from remote command
  369.     MN    SD,C$SEND,,            ;; SEND command
  370.     MN    RE,C$RECV,,            ;; RECEIVE command
  371.     MN    CT,C$CONN,,            ;; CONNECT command
  372.     MN    SR,C$SERV,,            ;; Enter SERVER mode command
  373.     MN    PS,C$POS,,            ;; P/OS services
  374. .ENDM
  375.  
  376.     .SBTTL    Macro definitions -- ACTMNU - KERFIL Active menu
  377.  
  378. ;++
  379. ; This menu will be displayed anytime the user attempts to do a
  380. ; function and KERFIL is currently running.
  381. ;--
  382.  
  383. .MACRO    ACTMNU
  384.     MN    AB,CHKABT,,        ;; Abort KERFIL
  385.     MN    RS,CHKRES,,        ;; Resume KERFIL status type out
  386. .ENDM
  387.  
  388.     .SBTTL    Macro definitions -- REMMNU - Remote Kermit commands
  389.  
  390. ;++
  391. ; This frame definition defines the remote Kermit commands.
  392. ;--
  393.  
  394. .MACRO    REMMNU
  395.     MN    TY,R$TYPE,,        ;; Remote Type
  396.     MN    DR,R$DIR,,        ;; Remote Directory
  397.     MN    DS,R$DISK,,        ;; Remote Disk Usage
  398.     MN    DL,R$DEL,,        ;; Remote Delete
  399.     MN    CH,R$CWD,,        ;; Remote Change Working Directory
  400.     MN    ST,R$STAT,,        ;; Remote Status
  401.     MN    HL,R$HELP,,        ;; Remote Help
  402.     MN    LG,C$LOGO,,        ;; Remote LOGOUT
  403.     MN    FN,C$FINI,,        ;; Remote FINISH
  404.     MN    HS,R$HOST,,        ;; Remote HOST command
  405. .ENDM
  406.  
  407.     .SBTTL    Macro definitions -- RM2MNU - Second remote menu
  408.  
  409. ;++
  410. ; This menu describes the actions that can take place under the second
  411. ; remote commands menu.
  412. ;--
  413.  
  414. .MACRO    RM2MNU
  415.     MN    WH,R$WHO,,        ;; Remote FINGER
  416.     MN    CO,R$COPY,,        ;; Remote COPY
  417.     MN    RN,R$RENM,,        ;; Remote RENAME
  418. .ENDM
  419.  
  420.     .SBTTL    Macro definitions -- POSMNU - P/OS menu
  421.  
  422. ;++
  423. ; This macro will define the various P/OS utilities that can be called
  424. ; from Kermit.
  425. ;--
  426.  
  427. .MACRO    POSMNU
  428.     MN    FI,P$FILE,,        ;; File services
  429.     MN    DI,P$DISK,,        ;; Disk services
  430.     MN    VW,P$VIEW,,        ;; View messages/status
  431.     MN    PR,P$PRIN,,        ;; Print services
  432.     MN    SE,P$STUP,,        ;; P/OS setup
  433. .ENDM
  434.  
  435.     .SBTTL    Macro definitions -- SETMNU - Set menu
  436.  
  437. ;++
  438. ; This macro will define the various set parameters dispatches.
  439. ; This menu just dispatches to other menus or resets parameters.
  440. ;--
  441.  
  442. .MACRO    SETMNU
  443.     MN    FI,SETFIL,,        ;; Set file parameters
  444.     MN  GN,SETGEN,,        ;; Set general parameters
  445.     MN    SN,SETSND,,        ;; Set send parameters
  446.     MN    RC,SETRCV,,        ;; Set receive parameters
  447.     MN    LN,SETLIN,,        ;; Set line parameters
  448.     MN  TE,SETTRM,,        ;; Set terminal emulation
  449. .ENDM
  450.  
  451.     .SBTTL    Macro definitions -- File menu
  452.  
  453. ;++
  454. ; This will define the file parameters menu that is a sub-menu of
  455. ; the SET menu.
  456. ;--
  457.  
  458. .MACRO    FILMNU
  459.     MN    TY,FILFLG,INPFTY,DYNFTY            ;; File type
  460.     MN    SP,FIL.NORMAL.FORM,INPFSP,DYNFSP    ;; File specification
  461.     MN    DS,ABT.FLAG,INPFDS,DYNFDS        ;; File disposition
  462. .ENDM
  463.  
  464.     .SBTTL    Macro definitions -- File mode
  465.  
  466. ;++
  467. ; This menu will set the mode that the file is written in.
  468. ;--
  469.  
  470. .MACRO    FMDMNU
  471.     MN    AS,RTFASC,,            ;; ASCII file type
  472.     MN    BI,RTFBIN,,            ;; BINARY file type
  473.     MN    BK,RTFBLK,,            ;; BLOCK file type
  474.     MN    FD,RTFFIX,,            ;; FIXED file type
  475. .ENDM
  476.  
  477.  
  478.     .SBTTL    Macro definitions -- File specification
  479.  
  480. ;++
  481. ; This menu will specify the type of file specification processing that
  482. ; is to be done.
  483. ;--
  484.  
  485. .MACRO    FSPMNU
  486.     MN    NM,RTFNRM,,            ;; Normal form
  487.     MN    FL,RTFULL,,            ;; Full file specification
  488.     MN    UN,RTFUNT,,            ;; Untranslated
  489. .ENDM
  490.  
  491.  
  492.  
  493.     .SBTTL    Macro definitions -- File disposition
  494.  
  495. ;++
  496. ; This menu will specify the disposition of the file on an incomplete
  497. ; transfer.
  498. ;--
  499.  
  500. .MACRO    FDSMNU
  501.     MN    KP,RTFKEP,,            ;; Keep
  502.     MN    DL,RTFDEL,,            ;; Delete
  503. .ENDM
  504.  
  505.     .SBTTL    Macro definitions -- Set line characteristics
  506.  
  507. ;++
  508. ; This macro will determine if we are setting the current, default
  509. ; or resetting the line parameters.
  510. ;--
  511.  
  512. .MACRO    LINMNU
  513.     MN    DF,SETLDF,,        ;; Set the line defaults
  514.     MN    CR,SETLCR,,        ;; Set the line current parameters
  515.     MN    RS,SETLRS,,        ;; Reset the current parameters to defaults
  516. .ENDM
  517.  
  518.     .SBTTL    Macro definitions -- SNDMNU - Send parameter menu
  519.  
  520. ;++
  521. ; This menu is for the dynamic menu for the SEND processing.  It will
  522. ; use all of the possible routines for the menu processing.
  523. ;--
  524.  
  525. .MACRO    SNDMNU
  526.     MN    EL,SND.EOL,INPEOL,DYSEOL        ;; End of line character
  527.     MN    PL,SND.PKT.SIZE,INPPKL,DYSPKL        ;; Packet length
  528.     MN    PC,SND.PADCHAR,INPPDC,DYSPDC        ;; Pad character
  529.     MN    NP,SND.NPAD,INPNPD,DYSNPD        ;; Number of padding characters
  530.     MN    TT,SND.TIMEOUT,INPTIM,DYSTIM        ;; Timeout
  531.     MN    SP,SND.SOH,INPSOP,DYSSOP        ;; Start of packet processing
  532.     MN    QU,SND.QUOTE,INPQUO,DYSQUO        ;; Quote character
  533. .ENDM
  534.  
  535.     .SBTTL    Macro definitions -- RCVMNU - Receive parameter menu
  536.  
  537. ;++
  538. ; This menu is for the dynamic menu for the receive processing.  It will
  539. ; use all of the possible routines for the menu processing.
  540. ;--
  541.  
  542. .MACRO    RCVMNU
  543.     MN    EL,RCV.EOL,INPEOL,DYREOL        ;; End of line character
  544.     MN    PL,RCV.PKT.SIZE,INPPKL,DYRPKL        ;; Packet length
  545.     MN    PC,RCV.PADCHAR,INPPDC,DYRPDC        ;; Pad character
  546.     MN    NP,RCV.NPAD,INPNPD,DYSNPD        ;; Number of padding characters
  547.     MN    TT,RCV.TIMEOUT,INPTIM,DYRTIM        ;; Timeout
  548.     MN    SP,RCV.SOH,INPSOP,DYRSOP        ;; Start of packet processing
  549.     MN    QU,RCV.QUOTE,INPQUO,DYRQUO        ;; Quote character
  550. .ENDM
  551.  
  552.     .SBTTL    Macro definitions -- PARMNU - Parity settings
  553.  
  554. ;++
  555. ; The following is the dispatch menu for the PARITY values.
  556. ;--
  557.  
  558. .MACRO    PARMNU
  559.     MN    NO,RTNOPR,,        ;; Return no parity
  560.     MN    EV,RTEVPR,,        ;; Return even parity
  561.     MN    OD,RTODPR,,        ;; Return odd parity
  562.     MN    MK,RTMKPR,,        ;; Return mark parity
  563.     MN    SP,RTSPPR,,        ;; Return space parity
  564. .ENDM
  565.  
  566.     .SBTTL    Macro definitions -- LCHMNU - Line characteristics
  567.  
  568. ;++
  569. ;
  570. ; The following macros contains the following items
  571. ;
  572. ;    Macro    XX,Set.routine,Input.routine,Dynamic routine
  573. ;
  574. ;--
  575.  
  576. .MACRO    LCHMNU
  577.     MN    RS,SETRSP,INPSPD,DYNRSP        ;; Receive speed
  578.     MN    XS,SETXSP,INPSPD,DYNXSP        ;; Transmit speed
  579.     MN    PR,SETPAR,INPPAR,DYNPAR        ;; Parity routines
  580. ;    MN    DA,SETSDB,INPDAB,DYNDAB
  581. ;    MN    SP,SETSTB,INPSTB,DYNSTB
  582. ;    MN    PY,SETPRT,INPPRT,DYNPRT
  583.     MN    FC,SETFC ,INPFC ,DYNFC        ;; Flow control (XON/XOFF)
  584. ;    MN    7T,SET7BC,INP7BC,DYN7BC
  585.     MN    MM,SETMDM,INPMDM,DYNMDM        ;; Modem control
  586. ;    MN    RG,SETRNG,INPRNG,DYNRNG
  587. .ENDM
  588.  
  589.     .SBTTL    Modem types menu
  590.  
  591. ;++
  592. ; This menu is for the setting of the various modem types that can be found
  593. ; in PRO/Kermit.
  594. ;--
  595.  
  596. .MACRO    MDMMNU
  597.     MN    NO,RTNOMD,,            ;; No modem
  598.     MN    FS,RTUSFS,,            ;; USFSK 103J
  599.     MN    21,RTCC21,,            ;; CCITTV.21 0..300
  600.     MN    M1,RTCCM1,,            ;; CCITTV.23 Mode 1
  601.     MN    M2,RTCCM2,,            ;; CCITTV.23 Mode 2
  602.     MN    PS,RTDPSK,,            ;; DPSK Bell 212
  603. .ENDM
  604.  
  605.     .SBTTL    Frames -- Terminal characteristics
  606.  
  607. ;++
  608. ; The following macro will define the various terminal emulation
  609. ; characteristics that can be set by the user.
  610. ;--
  611.  
  612. .MACRO    TCHMNU
  613.     MN    LE,LCLECH,INPLCE,DYNLCE            ;; Local echo
  614. ;    MN    DP,DUPLEX,INPDPX,DYNDPX            ;; Duplex routine
  615.     MN    IC,IBM.CHAR,INPICH,DYNICH        ;; IBM turn around character
  616.     MN    EC,ESCCHR,INPECH,DYNECH            ;; Escape character
  617.     MN    IB,IBM.FLAG,INPIMD,DYNIMD        ;; IBM mode (Same as duplex?)
  618.     MN    TR,TRMTRN,INPTRN,DYNTRN            ;; Transparent terminal emulation
  619.     MN    7B,TRM7BT,INP7BT,DYN7BT            ;; 7-bit character codes
  620. .ENDM
  621.  
  622.     .SBTTL    General parameter menu
  623.  
  624. ;++
  625. ; This menu is used to set the various general parameters that can
  626. ; be found in Kermit.  These range from the 8th-bit quoting to the
  627. ; debugging type out.
  628. ;--
  629.  
  630. .MACRO    GENMNU
  631.     MN    8Q,RCV.8QUOTE.CHAR,INP8QU,DYN8QU    ;; 8th bit quoting
  632.     MN    BL,CHKTYPE,INPBLK,DYNBLK        ;; Block check processing
  633.     MN    RQ,SET.REPT.CHAR,INPRPT,DYNRPT        ;; Repeat quote character
  634.     MN    DB,DEBUG.FLAG,INPDEB,DYNDEB        ;; Debugging
  635.     MN    RI,SI.RETRIES,INPSIR,DYNSIR        ;; SI retries
  636.     MN    RP,PKT.RETRIES,INPPKR,DYNPKR        ;; Packet retries
  637. .ENDM
  638.  
  639.  
  640. .MACRO    BLKMNU
  641.     MN    1C,RTBK1C,,            ;; One character checksum
  642.     MN    2C,RTBK2C,,            ;; Two character checksum
  643.     MN    3C,RTBK3C,,            ;; Three character checksum
  644. .ENDM
  645.  
  646.     .SBTTL    Frame and menu macro expansion
  647.  
  648. ;++
  649. ; The following defines all of the frame and menus from the macros
  650. ; on the previous pages.
  651. ;--
  652.  
  653.     .PSECT    $PLIT$, RO, D
  654.  
  655.     DOFRAM            ; Generate the world
  656.  
  657.     .SBTTL    File specifications and help frame-ids
  658.  
  659. ;++
  660. ; The following are the file specifications for the various menu
  661. ; and help files.
  662. ;--
  663.  
  664.     .PSECT    $PLIT$,    RO, D
  665.  
  666. MSG    MNUF,<LB:[ZZKERMIT]KERMIT.MNU>
  667. MSG    HLPF,<LB:[ZZKERMIT]KERMIT.HLP>
  668. MSG    HFRM,<MAIN>
  669.  
  670. ; The following are the lengths of the above information
  671.  
  672. L$MNUF:    .WORD    MNUF$L        ;[04] Length of the menu file specification
  673. L$HLPF:    .WORD    HLPF$L        ;[04] Length of the help file specification
  674. L$HFRM:    .WORD    HFRM$L        ;[04] Length of the default help frame
  675.  
  676.     .SBTTL    Argument blocks -- MFILE
  677.  
  678. ;++
  679. ; The following is the argument block for the MFILE routine call.  This
  680. ; is used to open the menu file.
  681. ;--
  682.  
  683. A$MFIL:    .BYTE    MFIL$L,0    ; Length of the argument block
  684.     .WORD    STATUS        ; Status returned by the routine
  685.     .WORD    M$MNUF        ; Menu file specification
  686.     .WORD    L$MNUF        ; Length of the menu file specification
  687. MFIL$L==<<.-A$MFIL>/2>-1
  688.  
  689. MSG    MOER,<MFILE open failure>
  690.  
  691.     .SBTTL    Argument blocks -- HFILE
  692.  
  693. ;++
  694. ; The following is the argument block for the HFILE routine call.  This
  695. ; routine will cause the help file to be opened.
  696. ;--
  697.  
  698.     .PSECT    $PLIT$, RO, D
  699.  
  700. A$HFIL:    .BYTE    HFIL$L,0    ; Length of the argument block
  701.     .WORD    STATUS        ; Status returned by the routine
  702.     .WORD    M$HLPF        ; Help file specification
  703.     .WORD    L$HLPF        ; Length of the file specification
  704.     .WORD    M$HFRM        ; Default help file frame
  705.     .WORD    L$HFRM        ; Length of the default frame
  706. HFIL$L=<<.-A$HFIL>/2>-1
  707.  
  708. MSG    HOER,<HFILE open failure>
  709.  
  710.     .SBTTL    Argument blocks -- MFRAME - Get a frame
  711.  
  712. ;++
  713. ; This argument block is used to cause a frame to be read into
  714. ; the static menu buffer.
  715. ;--
  716.  
  717.     .PSECT    $PLIT$,    RO, D
  718.  
  719. A$MFRA:    .BYTE    MFRA$L,0    ; Length of the frame
  720.     .WORD    STATUS        ; Status returned by the call
  721.     .WORD    MFRMID        ; MFRAME - Frame id
  722.     .WORD    MFRMLN        ; MFRAME - Frame length
  723. MFRA$L=<<.-A$MFRA>/2>-1
  724.  
  725. MSG    FRER,<MFRAME failure>
  726.  
  727.     .SBTTL    Argument blocks -- MUNPK and DPACK information
  728.  
  729. ;++
  730. ; The following are the various names that are used for the text items
  731. ; in the menu processing routines.
  732. ;--
  733.  
  734.     .PSECT    $PLIT$, RO, D
  735.  
  736. MSG    CLRB,CLRB
  737. MSG    TITL,TITL
  738. MSG    TXT1,TEXT01
  739. MSG    TXT2,TEXT02
  740. MSG    TXT3,TEXT03
  741. MSG    GHLP,GHLP
  742. MSG    PRMT,PRMT
  743.  
  744. L$CLRB:    .WORD    CLRB$L            ;[04] DPACK clear the buffer flag
  745. L$TITL:    .WORD    TITL$L            ;[04] Length of the text
  746. L$TXT1:    .WORD    TXT1$L            ;[04] Length of the text
  747. L$TXT2:    .WORD    TXT2$L            ;[04] Length of the text
  748. L$TXT3:    .WORD    TXT3$L            ;[04] Length of the text
  749. L$GHLP:    .WORD    GHLP$L            ;[04] Length of the global help text
  750. L$PRMT:    .WORD    PRMT$L            ;[04] Length of the prompt text
  751.  
  752. .MACRO    ARGS
  753. UP    TITL
  754. UP    PRMT
  755. UP    TXT1
  756. UP    TXT2
  757. UP    TXT3
  758. UP    GHLP
  759. .ENDM
  760. .MACRO    UP    NAME
  761.     .WORD M$'NAME
  762. .ENDM
  763. UNPARG:    ARGS
  764.  UNPAGL=.-UNPARG
  765. .MACRO    UP    NAME
  766.     .WORD L$'NAME
  767. .ENDM
  768.     ARGS
  769.  
  770.     .SBTTL    Argument blocks -- MUNPK and DPACK (options)
  771.  
  772. ;++
  773. ; The following are the argument blocks for unpacking and packing of
  774. ; the options that are listed on the screen.
  775. ;--
  776.  
  777. L$KEYW:    .WORD    6            ; Length of keyword code
  778. L$OPTN:    .WORD    6            ; Length of option code
  779. L$ACTN:    .WORD    6            ; Length of action code
  780. L$OHLP:    .WORD    6            ; Length of the option help code
  781. L$BUF1:    .WORD    120            ; Length of the buffer
  782. L$BUF3:    .WORD    120
  783.  
  784. ; Table of the nn characters that are appended to things link OHLPnn
  785.  
  786. NUMTAB:    .ASCII    '01'
  787.     .ASCII    '02'
  788.     .ASCII    '03'
  789.     .ASCII    '04'
  790.     .ASCII    '05'
  791.     .ASCII    '06'
  792.     .ASCII    '07'
  793.     .ASCII    '08'
  794.     .ASCII    '09'
  795.     .ASCII    '10'
  796.     .ASCII    '11'
  797.     .ASCII    '12'
  798.  
  799. A$UNPO:    .BYTE    UNPO$L,0        ; Table for unpacking options and
  800.     .WORD    STATUS            ;   related information from static buf
  801.     .WORD    M$OPTN            ; Unpack option
  802.     .WORD    L$OPTN
  803.     .WORD    BUFF1
  804.     .WORD    L$BUF1
  805.     .WORD    BUFF1L
  806.     .WORD    M$ACTN            ; Unpack action
  807.     .WORD    L$ACTN
  808.     .WORD    MUNPBF            ; Unpacking buffer
  809.     .WORD    MUNPBL            ; Unpacking buffer length
  810.     .WORD    MUNPRL            ; Unpacking return length
  811.     .WORD    M$OHLP            ; Unpack option help
  812.     .WORD    L$OHLP
  813.     .WORD    BUFF3
  814.     .WORD    L$BUF3
  815.     .WORD    BUFF3L
  816.     .WORD    M$KEYW            ; Unpack keyword
  817.     .WORD    L$KEYW
  818.     .WORD    OFKEYW
  819.     .WORD    KEYWLN
  820. UNPO$L=<<.-A$UNPO>/2>-1        ; Length of unpacking table - 1
  821.  
  822. A$PACO:    .BYTE    PACO$L,0        ; Table for packing options and related
  823.     .WORD    STATUS            ;   information into dynamic buffer
  824.     .WORD    M$OPTN            ; Pack option
  825.     .WORD    L$OPTN
  826.     .WORD    BUFF1
  827.     .WORD    BUFF1L
  828.     .WORD    M$ACTN            ; Pack action
  829.     .WORD    L$ACTN
  830.     .WORD    MUNPBF            ; Unpacking buffer
  831.     .WORD    MUNPRL            ; Unpacking buffer length
  832.     .WORD    M$OHLP            ; Pack option help
  833.     .WORD    L$OHLP
  834.     .WORD    BUFF3
  835.     .WORD    BUFF3L
  836.     .WORD    M$KEYW            ; Pack keyword
  837.     .WORD    L$KEYW
  838.     .WORD    OFKEYW
  839.     .WORD    KEYWLN
  840. PACO$L=<<.-A$PACO>/2>-1        ; Length of packing table - 1
  841.  
  842.     .SBTTL    Argument blocks -- FATLER args
  843.  
  844. ;++
  845. ; The following are the argument blocks for calling FATLER from DPACK and
  846. ; MUNPK failures.
  847. ;--
  848.  
  849. A$FATL:    .BYTE    FATL$L,0        ; Lenth of the argument block
  850.     .WORD    IOBUFF            ; Message to output
  851.     .WORD    IOBLEN            ; Length of the message to output
  852. FATL$L=<<.-A$FATL>/2>-1
  853.  
  854. MSG    UPER,<MUNPK failure>
  855. MSG    PKER,<DPACK failure>
  856.  
  857.     .SBTTL    Argument blocks -- MENU argument block
  858.  
  859. ;++
  860. ; The following is the argument block for calling the static menu processing
  861. ; routine.
  862. ;--
  863.  
  864.     .PSECT    $PLIT$, RO, D
  865.  
  866. A$DMEN:
  867. A$MENU:    .BYTE    MENU$L,0        ; Length of the argument block
  868.     .WORD    STATUS            ; Status returned by the routine
  869.     .WORD    ACTION            ; Action string returned by the routine
  870.     .WORD    ACTNLN            ; Length of the action string (max)
  871.     .WORD    R$ACTN            ; Returned length
  872.     .WORD    0            ; DISPLAY - Reserved
  873.     .WORD    ADDOPT            ; ADDOPTFLAG - Addtnl options
  874.     .WORD    MSG1            ; Line 23 message
  875.     .WORD    L$MSG1            ; Length of line 23 message
  876.     .WORD    MSG2            ; Line 24 message
  877.     .WORD    L$MSG2            ; Length of line 24 message
  878. MENU$L=<<.-A$MENU>/2>-1
  879.  
  880. ACTNLN:    .WORD    2            ; Number of characters in action array
  881.  
  882.     .SBTTL    Argument blocks -- MPACK - Pack multiple-choice menu
  883.  
  884. ;++
  885. ; The following is the argument block for the initial MPACK routine call.
  886. ; This call will clear the multi-choice menu buffer
  887. ;--
  888.  
  889. ;
  890. ; MPACK - with clearing argument block
  891. ;
  892. A$MPAC:    .BYTE    MPAC$L,0        ; Length of the arugment block
  893.     .WORD    STATUS            ; Status information returned
  894.     .WORD    M$CLRB            ; Clear buffer directive
  895.     .WORD    L$CLRB            ; Text length
  896.     .WORD    M$TITL            ; Field id
  897.     .WORD    L$TITL            ; Length of the field id
  898.     .WORD    M$BTTL            ; Title area
  899.     .WORD    L$BTTL            ; And the length of it
  900. MPAC$L=<<.-A$MPAC>/2>-1
  901.  
  902.     .SBTTL    Argument blocks -- MMENU - Multiple-choice menu
  903.  
  904. ;++
  905. ; The following is the argument block for the dynamic multiple-choice
  906. ; menu processing.
  907. ;--
  908.  
  909. A$MMEN:    .BYTE    MMEN$L,0        ; Length of the argument block
  910.     .WORD    STATUS            ; Status returned by the caller
  911.     .WORD    OPTSTR            ; Option string
  912.     .WORD    L$OPTS            ; Length of the option string
  913.     .WORD    C$OPTS            ; Number of options in the option string
  914.     .WORD    LIMIT            ; Limit on the number of selections
  915.     .WORD    RESPON            ; Number of options selected
  916.     .WORD    RSPARY            ; Action strings
  917.     .WORD    ADDOPT            ; ADDOPTFLAG - Addtnl options
  918.     .WORD    MSG1            ; Line 23 message
  919.     .WORD    L$MSG1            ; Length of line 23 message
  920.     .WORD    MSG2            ; Line 24 message
  921.     .WORD    L$MSG2            ; Length of line 24 message
  922. MMEN$L=<<.-A$MMEN>/2>-1
  923.  
  924. LIMIT:    .WORD    1            ; Select only one
  925.  
  926.     .SBTTL    General error messages
  927.  
  928. ;++
  929. ; The following are error messages that are displayed on the user's
  930. ; screen.
  931. ;--
  932.  
  933.     .PSECT    $PLIT$, RO, D
  934.  
  935. MSG    BADK,<You have pressed the wrong key - please try again>
  936. M$BADI:    .ASCII    <.CHCR><.CHBEL>/Please check your input./
  937.     .ASCIZ    /  Press RESUME to continue/
  938. ;
  939. ; String to position to accept input
  940. ;
  941. M$PPRM:    .ASCIZ    <.CHCSI>/21;1H/<.CHCSI>/J/
  942.  
  943.     .SBTTL    Data areas
  944.  
  945.     .PSECT    $OWN$,    D
  946. ;
  947. ; Flags that are used in this module
  948. ;
  949. BADINP:    .BLKW    1            ; Bad input flag
  950. XITFLG:    .BLKW    1            ; Must exit
  951. MAIFLG::.BLKW    1            ; Main screen flag
  952. AOPFLG:    .BLKW    1            ; Additional options flag
  953. ;
  954. ; MENU, DMENU and MMENU arguments
  955. ;
  956. ADDOPT:    .BLKW    1            ; Additional options flag
  957. L$MSG1:    .BLKW    1            ; Lenght of text in MSG1 (always 80.)
  958. L$MSG2:    .BLKW    1            ; Ditto for MSG2 (always 80.)
  959. ;
  960. ; MFRAME arguments
  961. ;
  962. MFRMID:    .BLKB    8.            ; Frame id
  963. MFRMLN:    .BLKW    1            ; Frame id length
  964. ;
  965. ; MUNPK argument block - built on the fly
  966. ;
  967. A$MUNP:    .BYTE    MUNP$L,0        ; Length
  968.     .WORD    STATUS            ; Status returned
  969. UN$AG1=.-A$MUNP
  970.     .WORD    0            ; Fieldid
  971. UN$AG2=.-A$MUNP
  972.     .WORD    0            ; Maxlen of fieldid
  973.     .WORD    MUNPBF            ; UNPACK buffer
  974.     .WORD    MUNPBL            ; UNPACK buffer length
  975.     .WORD    MUNPRL            ; UNPACK buffer return length
  976. MUNP$L=<<.-A$MUNP>/2>-1
  977.  
  978. MUNPBF:    .BLKB    80.            ; Buffer text is stored in
  979. MUNPBL:    .WORD    80.            ; Length of the buffer
  980. MUNPRL:    .BLKW    1            ; Amount stored in MUNPBF
  981. ;
  982. ; DPACK - with clearing argument block
  983. ;
  984. A$DPAC:    .BYTE    DPAC$L,0        ; Length of the arugment block
  985.     .WORD    STATUS            ; Status information returned
  986.     .WORD    M$CLRB            ; Clear buffer directive
  987.     .WORD    L$CLRB            ; Text length
  988. DP$AG1=.-A$DPAC
  989.     .WORD    0            ; Field id
  990. DP$AG2=.-A$DPAC
  991.     .WORD    0            ; Length of the field id
  992.     .WORD    MUNPBF            ; Buffer returned by unpacking
  993.     .WORD    MUNPRL            ; And the returned length
  994. DPAC$L=<<.-A$DPAC>/2>-1
  995. ;
  996. ; DPACK - without clearing argument block
  997. ;
  998. A$DPAK:    .BYTE    DPAK$L,0        ; Length of the arugment block
  999.     .WORD    STATUS            ; Status information returned
  1000. DK$AG1=.-A$DPAK
  1001.     .WORD    0            ; Field id
  1002. DK$AG2=.-A$DPAK
  1003.     .WORD    0            ; Length of the field id
  1004.     .WORD    MUNPBF            ; Buffer returned by unpacking
  1005.     .WORD    MUNPRL            ; And the returned length
  1006. DPAK$L=<<.-A$DPAK>/2>-1
  1007. ;
  1008. ; MUNPK and DPACK option names.  These names are built on the fly so that
  1009. ; we can unpack every possible option.  All names have '01' to '12' appended
  1010. ; on the end.
  1011. ;
  1012. M$KEYW:    .ascii    'KEYW'            ; Code for keyword
  1013. KEYWNM:    .blkw    1            ; Space for ascii '01' - '12'
  1014. OFKEYW:    .blkw    1            ; Offset of keyword (returned)
  1015. KEYWLN:    .blkw    1            ; Keyword length
  1016. M$OPTN:    .ascii    'OPTN'            ; Code for option
  1017. OPTNNM:    .blkw    1            ; Space for numbers
  1018. M$ACTN:    .ascii    'ACTN'            ; code for action
  1019. ACTNNM:    .blkw    1            ; Space for numbers
  1020. M$OHLP:    .ascii    'OHLP'            ; Code for option help
  1021. OHLPNM:    .blkw    1            ; Space for numbers
  1022. BUFF1L:    .blkw    1            ;   (returned from MUNPK)
  1023. BUFF3L:    .blkw    1
  1024. ;
  1025. ; MENU and DMENU information
  1026. ;
  1027. ACTION:    .BLKB    2            ; Action string selected
  1028. R$ACTN:    .BLKW                ; Returned action string length
  1029. ;
  1030. ; Line characteristics information
  1031. ;
  1032. XKBLK:    .BLKW                ; XK block to read information from 
  1033. ;
  1034. ; Location used to return values to the upper levels
  1035. ;
  1036. VALUE:    .BLKW                ; Location to return values
  1037. ;
  1038. ; MPACK - without clearing argument block
  1039. ;
  1040.  
  1041. MPKLEN:    .BLKW    1            ; Length of strings for MPACK
  1042.  
  1043. A$MPAK:    .BYTE    MPAK$L,0        ; Length of the arugment block
  1044.     .WORD    STATUS            ; Status information returned
  1045. MK$AG1=.-A$MPAK
  1046.     .WORD    0            ; Field id
  1047. MK$AG2=.-A$MPAK
  1048.     .WORD    0            ; Length of the field id
  1049. MK$AG3=.-A$MPAK
  1050.     .WORD    0            ; Buffer returned by unpacking
  1051.     .WORD    MPKLEN            ; And the returned length
  1052. MPAK$L=<<.-A$MPAK>/2>-1
  1053. ;
  1054. ; MMENU items
  1055. ;
  1056. C$OPTS:    .BLKW    1            ; Number of options in the option string
  1057. L$OPTS:    .BLKW    1            ; Length of option string
  1058. RESPON:    .BLKW    1            ; Number of items selected
  1059. RSPARY:    .BLKW    1            ; Number of responses selected
  1060. OPTSTR:    .BLKB    300.            ; Option string
  1061.  
  1062.     .SBTTL    Initialization of the command processing
  1063.  
  1064. ;++
  1065. ; This routine will initialize the command processor.  It will
  1066. ; store various pieces of information and clear the MSG1 and MSG2
  1067. ; areas in the common
  1068. ;
  1069. ; Usage:
  1070. ;
  1071. ;    JSR    PC,INICMD
  1072. ;    (Return)
  1073. ;
  1074. ;--
  1075.  
  1076.     .PSECT    $CODE$,    RO
  1077.  
  1078.     .GLOBL    INICMD
  1079.  
  1080. INICMD:    JSR    R1,$SAVE5        ; Save registers R1 to R5
  1081.     MOV    #A$MFIL,R5        ; Point to the argument block
  1082.     CALL    MFILE            ; Call the routine
  1083.     TST    STATUS            ; Get a good return
  1084.     BGE    10$            ; Jump if ok
  1085. ;
  1086. ; Here if we failed to open the menu file.
  1087. ;
  1088.     MOV    #M$MOER,R0        ; Get the error block
  1089.     JSR    PC,MERROR        ; Issue the error
  1090. ;
  1091. ; Now to open the HELP file
  1092. ;
  1093. 10$:    MOV    #A$HFIL,R5        ; Point to the argument block
  1094.     CALL    HFILE            ; Open the help file
  1095.     TST    STATUS            ; Get a good return?
  1096.     BGE    20$            ; Branch if ok
  1097. ;
  1098. ; Issue the error message for open failures for the HELP file.
  1099. ;
  1100.     MOV    #M$HOER,R0        ; Get the argument block
  1101.     JSR    PC,MERROR        ; Output the error message
  1102. ;
  1103. ; Now reset the message areas of the menus
  1104. ;
  1105. 20$:    MOV    #80.,L$MSG1        ; Store the length
  1106.     MOV    #80.,L$MSG2        ; Store the other length
  1107.     PJMP    RSTMSG            ; Restore the MSG areas
  1108.  
  1109.     .SBTTL    COMMAN - Process the commands
  1110.  
  1111. ;++
  1112. ; This routine is called from the KERMIT.MAC module to process the KERMIT
  1113. ; commands.
  1114. ;
  1115. ; Usage:
  1116. ;    JSR    PC,COMMAN
  1117. ;    (Return - When we are exiting)
  1118. ;
  1119. ;--
  1120.  
  1121.     .PSECT    $CODE$, RO
  1122.     .GLOBL    COMMAN
  1123.  
  1124. COMMAN:    CLR    XITFLG            ; Clear the exit flag
  1125. 10$:    CLR    MAIFLG            ; Clear the main screen flag
  1126.     BLSCAL    DOMENU,<#F$MAIN,#K$MKEY,#FALSE> ; Call the menu processing
  1127.     TST    AOPFLG            ; Additional options?
  1128.     BNE    20$            ; Yes, handle it
  1129.     TST    XITFLG            ; Are we to just exit?
  1130.     BEQ    10$            ; No, continue with this menu
  1131.     RTS    PC            ; Just return if we got a function key
  1132. ;
  1133. ; Here when additional options have been pressed
  1134. ;
  1135. 20$:    CLR    MAIFLG            ; Clear the MAIN SCREEN flag
  1136.     BLSCAL    DOMENU,<#F$REMT,#K$ANRM,#FALSE> ; Call the menu processing
  1137.     TST    AOPFLG            ; Additional options?
  1138.     BEQ    10$            ; Yes, just loop around
  1139.  
  1140.     CLR    MAIFLG            ; Clear this flag again
  1141.     BLSCAL    DOMENU,<#F$REM2,#K$ANRM,#FALSE> ; Call the menu processing
  1142.     TST    MAIFLG            ; User type an exit?
  1143.     BNE    20$            ; Yes, handle it
  1144.     BR    COMMAN            ; Go back to the top
  1145. ;
  1146. ; Here when the EXIT key is pressed.  This routine will set the exit flag
  1147. ; and return to the calling routine.;
  1148. ;
  1149. SETXIT:    COM    XITFLG            ; Make this -1
  1150.     RTS    PC            ; And return to the caller
  1151. ;
  1152. ; Define the function keys that are valid in this state.
  1153. ;
  1154.     .PSECT    $PLIT$, RO, D
  1155.  
  1156. .MACRO    MKEY
  1157. KEY    KY.AOP,SETAOP
  1158. KEY    KY.EXI,SETXIT
  1159. KEY    KY.MAI,SETXIT
  1160. .ENDM
  1161.     KEYS    MKEY,MKEY
  1162.  
  1163. ;
  1164. ; The following routine will be called because the MAIN screen key
  1165. ; was pressed.
  1166. ;
  1167.  
  1168.     .PSECT    $CODE$, RO, I
  1169.  
  1170. SETMAI:    COM    MAIFLG            ; Flag to return to the main screen
  1171. RET:    RTS    PC            ; And return
  1172. ;
  1173. ; The following are the function keys that are allowed in this screen.
  1174. ;
  1175.  
  1176.     .PSECT    $PLIT$, RO, D
  1177.  
  1178. .MACRO    KYNORM
  1179. KEY    KY.EXI,    RET
  1180. KEY    KY.MAI,    SETMAI
  1181. .ENDM
  1182.     KEYS    NORM,KYNORM
  1183.  
  1184. .MACRO    KYCRUN
  1185. KEY    KY.EXI,    SETMAI
  1186. KEY    KY.MAI,    SETMAI
  1187. .ENDM
  1188.     KEYS    CRUN,KYCRUN
  1189.  
  1190. .MACRO    KYANRM
  1191. KEY    KY.EXI,    RET
  1192. KEY    KY.MAI,    SETMAI
  1193. KEY    KY.AOP,    SETAOP
  1194. .ENDM
  1195.     KEYS    ANRM,KYANRM
  1196.  
  1197.     .PSECT    $CODE$, RO, I
  1198.  
  1199. ; Return routines
  1200.  
  1201. SETAOP:    COM    AOPFLG            ; Set the value
  1202.     RTS    PC            ; Return to the caller
  1203.  
  1204. CCMAI:    COM    MAIFLG            ; Set the main screen flag
  1205. CCRET:    COM    BADINP            ; Set the bad input flag
  1206.     RTS    PC            ; Return to the caller
  1207.  
  1208. ;
  1209. ; The following are the function keys that are allowed in this screen.
  1210. ;
  1211.  
  1212. .MACRO    KYINRM
  1213. KEY    KY.EXI,    CCRET
  1214. KEY    KY.MAI,    CCMAI
  1215. .ENDM
  1216.  
  1217.     .PSECT    $PLIT$, RO, D
  1218.  
  1219.     KEYS    INRM,KYINRM
  1220.  
  1221.     .SBTTL    CMDRUN - Command processing for a running KERFIL
  1222.  
  1223. ;++
  1224. ; This routine will handle the command processing for a KERFIL that is running.
  1225. ; It will prompt the user and call the routines that have to be called.
  1226. ;
  1227. ;--
  1228.  
  1229.     .PSECT    $CODE$, RO, I
  1230.  
  1231.     .GLOBL    CMDRUN            ; Global routine
  1232.  
  1233. CMDRUN:    BLSCAL    DOMENU,<#F$ACTV,#K$CRUN,#TRUE> ; Call the menu processor
  1234.     RTS    PC            ; Return to the caller for now
  1235.  
  1236.     .SBTTL    C$CONN - Connect processing
  1237.  
  1238. ;++
  1239. ; This routine will cause the connect task to be spawned.
  1240. ;--
  1241.  
  1242.     .PSECT    $PLIT$, RO, D
  1243.  
  1244. T$CON:    .RAD50    /KERCON/
  1245.     .EVEN
  1246.  
  1247.     .PSECT    $CODE$, RO, I
  1248.  
  1249. C$CONN:    JSR    PC,CHKACT        ; Make sure KERFIL doesn't have the port
  1250.     MOV    #T$CON,R0        ; Get the addrses of the task
  1251.     PJMP    DOSPWN            ; Spawn the task
  1252.  
  1253.     .SBTTL    C$POS - Process a P/OS function
  1254.  
  1255. ;++
  1256. ; This routine will handle the processing of the various P/OS commands.
  1257. ; All of these commands are handled by spawning off a task that will do
  1258. ; the correct function.
  1259. ;--
  1260.  
  1261.     .PSECT    $CODE$, RO, I
  1262.  
  1263. C$POS:    BLSCAL    DOMENU,<#F$POS,#K$NORM,#FALSE> ; Call the menu processor
  1264.     RTS    PC
  1265.  
  1266.     .SBTTL    P$FILE - Process P/OS File services
  1267.  
  1268. ;++
  1269. ; This routine will handle the processing of the P/OS File Services
  1270. ;--
  1271.  
  1272.     .PSECT    $TEXT$, RO, D
  1273.  
  1274. FTSK:    .RAD50    /C$FUTL/
  1275.     .EVEN
  1276.  
  1277.     .PSECT    $CODE$, RO, I
  1278.  
  1279. P$FILE:    MOV    #FTSK,R0        ; Get the address of the name
  1280.     PJMP    DOSPWN            ; Spawn off the task
  1281.  
  1282.     .SBTTL    P$DISK - Spawn off the Disk/Diskette services
  1283.  
  1284. ;++
  1285. ; This routine will handle the spawning of the Disk and Diskette services.
  1286. ; It will return to the caller when it is finished.
  1287. ;--
  1288.  
  1289.     .PSECT    $TEXT$, RO, D
  1290.  
  1291. DTSK:    .RAD50    /C$DUTL/
  1292.     .EVEN
  1293.  
  1294.     .PSECT    $CODE$, RO, I
  1295.  
  1296. P$DISK:    MOV    #DTSK,R0        ; Get the task name
  1297.     PJMP    DOSPWN            ; Spawn the task
  1298.  
  1299.     .SBTTL    P$PRINT - P/OS Print services
  1300.  
  1301. ;++
  1302. ; This routine will call the P/OS Print services tasks.
  1303. ;--
  1304.  
  1305.     .PSECT    $TEXT$, RO, D
  1306.  
  1307. PTSK:    .RAD50    /C$PUTL/
  1308.     .EVEN
  1309.  
  1310.     .PSECT    $CODE$, RO, I
  1311.  
  1312. P$PRIN:    MOV    #PTSK,R0        ; Point to the information
  1313.     PJMP    DOSPWN            ; Spawn the task
  1314.  
  1315.     .SBTTL    P$VIEW - View status/messages
  1316.  
  1317. ;++
  1318. ; This routine will cause the C$VUTL task to be spawned off.
  1319. ;--
  1320.  
  1321.     .PSECT    $TEXT$, RO, D
  1322.  
  1323. VTSK:    .RAD50    /C$VUTL/
  1324.     .EVEN
  1325.  
  1326.     .PSECT    $CODE$, RO, I
  1327.  
  1328. P$VIEW:    MOV    #VTSK,R0        ; Point to the name
  1329.     PJMP    DOSPWN            ; Spawn the task
  1330.  
  1331.     .SBTTL    P$STUP - Handle P/OS set up
  1332.  
  1333. ;++
  1334. ; THis routine will cause C$SUTL to be spawned.
  1335. ;--
  1336.  
  1337.     .PSECT    $TEXT$, RO, D
  1338.  
  1339. STSK:    .RAD50    /C$SUTL/
  1340.     .EVEN
  1341.  
  1342.     .PSECT    $CODE$, RO, I
  1343.  
  1344. P$STUP:    MOV    #STSK,R0        ; Get the address of the task
  1345.     PJMP    DOSPWN            ; Spawn the task
  1346.  
  1347.     .SBTTL    R$TYPE - Remote type command
  1348.  
  1349. ;++
  1350. ; This routine will handle the generic type command.  It will scan the file
  1351. ; specification that is to  be sent to the remote and then call KERFIL to
  1352. ; do the dirty work.
  1353. ;
  1354. ; Usage:
  1355. ;    JSR    PC,R$TYPE
  1356. ;    (RETURN)
  1357. ;
  1358. ;--
  1359.  
  1360.     .PSECT    $TYPE$, RO, D
  1361.  
  1362. MSG    RTYP,<Remote Type>
  1363. RTYTXT:    .ASCIZ    /Enter remote file specification to type/
  1364.  
  1365.     .PSECT    $CODE$, RO, I
  1366.  
  1367. R$TYPE:    JSR    PC,CHKACT        ; Is KERFIL active?
  1368.     MOV    #GC.TYPE,GENCMD        ; Store the command type
  1369.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1370.     BLSCAL    INPUT,<#TRUE,#M$RTYP,#RTYP$L,#RTYTXT,#FILPMT>
  1371.     TST    R0            ; Finished?
  1372.     BEQ    10$            ; No, process the command
  1373.     RTS    PC            ; Return to the caller
  1374. ;
  1375. ; Here if we really have to do something
  1376. ;
  1377. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1378.     PJMP    SNDPKT            ; Call the common routine
  1379.  
  1380.     .SBTTL    R$DIR - Remote directory command
  1381.  
  1382. ;++
  1383. ; This routine will handle the scanning of the remote directory that we
  1384. ; are to list for the user.  We will then call KERFIL to do all the dirty
  1385. ; work.
  1386. ;
  1387. ; Usage:
  1388. ;    JSR    PC,R$DIR
  1389. ;    (Return)
  1390. ;
  1391. ;--
  1392.  
  1393.     .PSECT    $TEXT$, RO, D
  1394.  
  1395. MSG    RDIR,<Remote Directory>
  1396. RDITXT:    .ASCIZ    /Enter remote directory specification/
  1397. RDIPMT:    .ASCIZ    /Remote Directory: /
  1398.  
  1399.     .PSECT    $CODE$, RO, I
  1400.  
  1401. R$DIR:    JSR    PC,CHKACT        ; Is KERFIL active?
  1402.     MOV    #GC.DIRECT,GENCMD    ; Store the command to do
  1403.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1404.     BLSCAL    INPUT,<#FALSE,#M$RDIR,#RDIR$L,#RDITXT,#RDIPMT>
  1405.     TST    R0            ; Finished?
  1406.     BEQ    10$            ; No, process the command
  1407.     RTS    PC            ; Return to the caller
  1408. ;
  1409. ; Here if we really have to do something
  1410. ;
  1411. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1412.     PJMP    SNDPKT            ; Call the common routine
  1413.  
  1414.     .SBTTL    R$DEL - Remote delete command
  1415.  
  1416. ;++
  1417. ; This routine will scan the file specifications that are to be deleted
  1418. ; by the remote Kermit and then call KERFIL to do the dirty work of
  1419. ; sending the information to the remote Kermit.
  1420. ;
  1421. ;
  1422. ; Usage:
  1423. ;    JSR    PC,R$DEL
  1424. ;    (Return)
  1425. ;
  1426. ;--
  1427.  
  1428.     .PSECT    $TEXT$, RO, D
  1429.  
  1430. MSG    RDEL,<Remote Delete>
  1431. RDETXT:    .ASCIZ    /Enter remote files to be deleted/
  1432.  
  1433.     .PSECT    $CODE$, RO, I
  1434.  
  1435. R$DEL:    JSR    PC,CHKACT        ; Is KERFIL active?
  1436.     MOV    #GC.DELETE,GENCMD    ; Store the command
  1437.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1438.     BLSCAL    INPUT,<#TRUE,#M$RDEL,#RDEL$L,#RDETXT,#FILPMT>
  1439.     TST    R0            ; Finished?
  1440.     BEQ    10$            ; No, process the command
  1441.     RTS    PC            ; Return to the caller
  1442. ;
  1443. ; Here if we really have to do something
  1444. ;
  1445. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1446.     PJMP    SNDPKT            ; Call the common routine
  1447.  
  1448.     .SBTTL    R$HOST - Send a remote host command
  1449.  
  1450. ;++
  1451. ; This command will prompt for a string from the user terminal.  It will
  1452. ; then use this string to send it to the remote to be processed as a host
  1453. ; command.
  1454. ;
  1455. ; Usage:
  1456. ;    JSR    PC,R$HOST
  1457. ;    (Return)
  1458. ;
  1459. ;--
  1460.  
  1461.     .PSECT    $TEXT$, RO, D
  1462.  
  1463. MSG    RHST,<Remote Host Command>
  1464. RHSTXT:    .ASCIZ    /Enter command to be executed by the remote system/
  1465. M$HSTP:    .ASCIZ    /Host command: /
  1466.  
  1467.     .PSECT    $CODE$, RO, I
  1468.  
  1469. R$HOST:    JSR    PC,CHKACT        ; Is KERFIL active?
  1470.     MOV    #GC.COMMAND,GENCMD    ; Store the command
  1471.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1472.     BLSCAL    INPUT,<#TRUE,#M$RHST,#RHST$L,#RHSTXT,#M$HSTP>
  1473.     TST    R0            ; Finished?
  1474.     BEQ    10$            ; No, process the command
  1475.     RTS    PC            ; Return to the caller
  1476. ;
  1477. ; Here if we really have to do something
  1478. ;
  1479. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1480.     PJMP    SNDPKT            ; Call the common routine
  1481.  
  1482.     .SBTTL    R$CWD - Remote Change Working Directory
  1483.  
  1484. ;++
  1485. ; This routine will scan the directory that we are to change to.  It will
  1486. ; then send to KERFIL to do the protocol between us and the remote to do
  1487. ; the function.
  1488. ;
  1489. ;
  1490. ; Usage:
  1491. ;    JSR    PC,R$CWD
  1492. ;    (Return)
  1493. ;
  1494. ;--
  1495.  
  1496.     .PSECT    $TEXT$, RO, D
  1497.  
  1498. MSG    RCWD,<Remote Change Working Directory>
  1499. RCWTXT:    .ASCIZ    /Enter directory to work in and password if required/
  1500. RCWPMT:    .ASCIZ    /Password: /
  1501.     PPMT$L    =.-RCWPMT
  1502.  
  1503.     .PSECT    $CODE$, RO, I
  1504.  
  1505. R$CWD:    JSR    PC,CHKACT        ; Is KERFIL active?
  1506.     MOV    #GC.CONNECT,GENCMD    ; Get the command
  1507.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1508.     BLSCAL    INPUT2,<#FALSE,#M$RCWD,#RCWD$L,#RCWTXT,#RDIPMT,#RCWPMT>
  1509.     TST    R0            ; Finished?
  1510.     BEQ    10$            ; No, process the command
  1511.     RTS    PC            ; Return to the caller
  1512. ;
  1513. ; Here if we really have to do something
  1514. ;
  1515. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1516.     PJMP    SNDPKT            ; Call the common routine
  1517.  
  1518.     .SBTTL    R$COPY - Remote COPY command
  1519.  
  1520. ;++
  1521. ; This command will cause a remote COPY command to be issued.  All of the
  1522. ; coping gets done on the remote system.
  1523. ;
  1524. ; Usage:
  1525. ;    JSR    PC,R$COPY
  1526. ;    (Return)
  1527. ;
  1528. ;--
  1529.  
  1530.     .PSECT    $TEXT$, RO, D
  1531.  
  1532. MSG    RCOP,<Remote Copy>
  1533. RCPTXT:    .ASCIZ    /Enter remote files specifications to copy/
  1534. RC1PMT:    .ASCIZ    /From Remote file: /
  1535. RC2PMT:    .ASCIZ    /To Remote file: /
  1536.  
  1537.     .PSECT    $CODE$, RO, I
  1538.  
  1539. R$COPY:    JSR    PC,CHKACT        ; Is KERFIL active?
  1540.     MOV    #GC.COPY,GENCMD        ; Get the command
  1541.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1542.     BLSCAL    INPUT2,<#3,#M$RCOP,#RCOP$L,#RCPTXT,#RC1PMT,#RC2PMT>
  1543.     TST    R0            ; Finished?
  1544.     BEQ    10$            ; No, process the command
  1545.     RTS    PC            ; Return to the caller
  1546. ;
  1547. ; Here if we really have to do something
  1548. ;
  1549. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1550.     PJMP    SNDPKT            ; Call the common routine
  1551.  
  1552.     .SBTTL    R$WHO - Who is logged in on the remote
  1553.  
  1554. ;++
  1555. ; This routine will send the pack to determine who is logged into the remote
  1556. ; system.
  1557. ;
  1558. ; Usage:
  1559. ;    JSR    PC,R$WHO
  1560. ;    (Return)
  1561. ;
  1562. ;--
  1563.  
  1564.     .PSECT    $TEXT$, RO, D
  1565.  
  1566. MSG    RWHO,<Remote Who is logged in>
  1567. RWHTXT:    .ASCIZ    /Enter remote user specification/
  1568. RW1PMT:    .ASCIZ    /User: /
  1569. RW2PMT:    .ASCIZ    /Options: /
  1570.  
  1571.     .PSECT    $CODE$, RO, I
  1572.  
  1573. R$WHO:    JSR    PC,CHKACT        ; Is KERFIL active?
  1574.     MOV    #GC.WHO,GENCMD        ; Get the command
  1575.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1576.     BLSCAL    INPUT2,<#FALSE,#M$RWHO,#RWHO$L,#RWHTXT,#RW1PMT,#RW2PMT>
  1577.     TST    R0            ; Finished?
  1578.     BEQ    10$            ; No, process the command
  1579.     RTS    PC            ; Return to the caller
  1580. ;
  1581. ; Here if we really have to do something
  1582. ;
  1583. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1584.     PJMP    SNDPKT            ; Call the common routine
  1585.  
  1586.     .SBTTL    R$RENM - Remote RENAME command
  1587.  
  1588. ;++
  1589. ; This command will cause a remote RENAME command to be issued.  All of the
  1590. ; renaming gets done on the remote system.
  1591. ;
  1592. ; Usage:
  1593. ;    JSR    PC,R$RENM
  1594. ;    (Return)
  1595. ;
  1596. ;--
  1597.  
  1598.     .PSECT    $TEXT$, RO, D
  1599.  
  1600. MSG    RRNM,<Remote Rename>
  1601. RRNTXT:    .ASCIZ    /Enter remote files specifications to rename/
  1602.  
  1603.     .PSECT    $CODE$, RO, I
  1604.  
  1605. R$RENM:    JSR    PC,CHKACT        ; Is KERFIL active?
  1606.     MOV    #GC.RENAME,GENCMD    ; Get the command
  1607.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1608.     BLSCAL    INPUT2,<#3,#M$RRNM,#RRNM$L,#RRNTXT,#RC1PMT,#RC2PMT>
  1609.     TST    R0            ; Finished?
  1610.     BEQ    10$            ; No, process the command
  1611.     RTS    PC            ; Return to the caller
  1612. ;
  1613. ; Here if we really have to do something
  1614. ;
  1615. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1616.     PJMP    SNDPKT            ; Call the common routine
  1617.  
  1618.     .SBTTL    R$STAT - Remote STATUS command
  1619.  
  1620. ;++
  1621. ; This routine will handle the remote STATUS command.  It will send the
  1622. ; generic command to the remote and then print the information.
  1623. ;
  1624. ;
  1625. ; Usage:
  1626. ;    JSR    PC,R$STAT
  1627. ;    (Return)
  1628. ;
  1629. ;--
  1630.  
  1631.     .PSECT    $CODE$, RO, I
  1632.  
  1633. R$STAT:    JSR    PC,CHKACT        ; Is KERFIL active?
  1634.     MOV    #GC.STATUS,GENCMD    ; Store the generic command to do
  1635.     JSR    PC,CLRGEN        ; Clear generic commands arguments
  1636.     MOV    #$TKGEN,R0        ; Store the type
  1637.     PJMP    SNDPKT            ; Call the remote task
  1638.  
  1639.     .SBTTL    R$HELP - Remote HELP command
  1640.  
  1641. ;++
  1642. ; This routine will handle the remote HELP command.  It will send
  1643. ; the generic command to the remote and then wait for the information
  1644. ; back from the remote.
  1645. ;
  1646. ;
  1647. ; Usage:
  1648. ;    JSR    PC,R$HELP
  1649. ;    (Return)
  1650. ;
  1651. ;--
  1652.  
  1653.     .PSECT    $CODE$, RO, I
  1654.  
  1655. R$HELP:    JSR    PC,CHKACT        ; Is KERFIL active?
  1656.     MOV    #GC.HELP,GENCMD        ; Store the command
  1657.     JSR    PC,CLRGEN        ; Clear generic arguments
  1658.     MOV    #$TKGEN,R0        ; Get the command to do
  1659.     PJMP    SNDPKT            ; Call the routine
  1660.  
  1661.     .SBTTL    R$DISK - Remote disk usage command
  1662.  
  1663. ;++
  1664. ; This routine will handle the inquire to the remote Kermit about the
  1665. ; disk usage.
  1666. ;
  1667. ;
  1668. ; Usage:
  1669. ;    JSR    PC,R$DISK
  1670. ;    (Return)
  1671. ;
  1672. ;--
  1673.  
  1674.     .PSECT    $TEXT$, RO, D
  1675.  
  1676. MSG    RDSK,<Remote Disk Usage>
  1677. RDSTXT:    .ASCIZ    /Enter remote directory/
  1678.  
  1679.     .PSECT    $CODE$, RO, I
  1680.  
  1681. R$DISK:    MOV    #GC.DISK.USAGE,GENCMD    ; Store the command to send
  1682.     JSR    PC,CLRGEN        ; Clear the generic arguments
  1683.     BLSCAL    INPUT,<#FALSE,#M$RDSK,#RDSK$L,#RDSTXT,#RDIPMT>
  1684.     TST    R0            ; Finished?
  1685.     BEQ    10$            ; No, process the command
  1686.     RTS    PC            ; Return to the caller
  1687. ;
  1688. ; Here if we really have to do something
  1689. ;
  1690. 10$:    MOV    #$TKGEN,R0        ; Get the function
  1691.     PJMP    SNDPKT            ; Call the common routine
  1692.  
  1693.     .SBTTL    C$SET - Process the set command
  1694.  
  1695. ;++
  1696. ; This routine will handle the processing of the set command.  It will
  1697. ; call the menu processor with the SET menu.  It will return on the
  1698. ; to the previous screen on an EXIT key and to the main screen on a
  1699. ; MAIN SCREEN key.
  1700. ;--
  1701.  
  1702.     .PSECT    $TEXT$, RO, D
  1703.  
  1704. MSG    NSET,<Set parameters not allowed while transfer task is active>
  1705.  
  1706.     .PSECT    $CODE$, RO
  1707.  
  1708. C$SET:    BIT    #TRUE,RUN        ; Is the remote running?
  1709.     BEQ    10$            ; No, just get the processing
  1710.     BLSCAL    BL$MOV,<#NSET$L,M$NSET,#MSG1> ; Tell the user
  1711.     RTS    PC            ; Return to the caller
  1712. ;
  1713. ; Here to get the type of sets to do
  1714. ;
  1715. 10$:    BLSCAL    DOMENU,<#F$SET,#K$NORM,#FALSE> ; Call the menu processor
  1716.     RTS    PC
  1717.  
  1718.     .SBTTL    SETFIL - Set file parameters
  1719.  
  1720. ;++
  1721. ; This routine will cause file parameters to be set.  These include
  1722. ; file disposition, file mode, ...
  1723. ;--
  1724.  
  1725. SETFIL:    BLSCAL    DOMENU,<#F$FILE,#K$NORM,#FALSE> ; Set file parameters
  1726.     RTS    PC            ; Return to the caller
  1727.  
  1728.     .SBTTL    SETFIL - File specification type
  1729.  
  1730. ;++
  1731. ; The following will handle the setting of the file specification normalization
  1732. ; processing.
  1733. ;--
  1734.  
  1735. ; Table of possible values
  1736.  
  1737. .MACRO    $FSPC
  1738.  $TAB    FNM.NORMAL,<Normal>
  1739.  $TAB    FNM.FULL,<Full>
  1740.  $TAB    FNM.UNTRAN,<Untranslated>
  1741. .ENDM
  1742.  
  1743.     TABLE    FSP,$FSPC
  1744. ;
  1745. ; dynamic menu routine
  1746. ;
  1747. DYNFSP:    MOV    #FSP$L,R1        ; Get the table length
  1748.     MOV    #T$FSP,R0        ; And the address of the table
  1749.     MOV    FIL.NORMAL.FORM,R2    ; Get the type of processing
  1750.     PJMP    DYNFIS            ; Find and insert the string into menu
  1751. ;
  1752. ; Input routine
  1753. ;
  1754. INPFSP:    BLSCAL    DOMENU,<#F$FSPC,#K$INRM,#TRUE> ; Input the item
  1755.     RTS    PC            ; Return to the caller
  1756.  
  1757.     .SBTTL    SETFIL - File specification normalization types
  1758.  
  1759. ;++
  1760. ; Here to return the various file specification normalization types
  1761. ;--
  1762.  
  1763. RTFNRM:    MOV    #FNM.NORMAL,VALUE    ; Store the value
  1764.     RTS    PC            ; Return to the caller
  1765.  
  1766. RTFULL:    MOV    #FNM.FULL,VALUE        ; Store the value
  1767.     RTS    PC            ; Return to the caller
  1768.  
  1769. RTFUNT:    MOV    #FNM.UNTRAN,VALUE    ; Store the file specification
  1770.     RTS    PC            ; Return to the caller
  1771.  
  1772.     .SBTTL    SETFIL - File dispositions
  1773.  
  1774. ;++
  1775. ; The following routines  will handle the setting of the file disposition
  1776. ; for incomplete transfers.  These are transfers that have aborted for some
  1777. ; reason or another.
  1778. ;--
  1779.  
  1780. ; Generate the text for the different type of dispositions
  1781.  
  1782. .MACRO    $FDISP
  1783.  $TAB    TRUE,<Delete>
  1784.  $TAB    FALSE,<Keep>
  1785. .ENDM
  1786.  
  1787.     TABLE    FDS, $FDISP
  1788. ;
  1789. ; Dynamic menu processing routine
  1790. ;
  1791.     .PSECT    $CODE$, RO, I
  1792.  
  1793. DYNFDS:    MOV    #FDS$L,R1        ; Get the length
  1794.     MOV    #T$FDS,R0        ; Get the table address
  1795.     MOV    ABT.FLAG,R2        ; Get the flag value
  1796.     PJMP    DYNFIS            ; Find and insert the string
  1797.  
  1798. ;
  1799. ; Set routine for file disposition
  1800. ;
  1801.  
  1802. INPFDS:    BLSCAL    DOMENU,<#F$FDSP,#K$INRM,#TRUE> ; Call the menu processor
  1803.     RTS    PC            ; Return to the caller
  1804.  
  1805.     .SBTTL    SETFIL - File disposition - Return value routines
  1806.  
  1807. ;++
  1808. ; The followingroutines will be called from the menu processing to set the
  1809. ;value to be returned for the file disposition.
  1810. ;--
  1811.  
  1812. RTFKEP:    MOV    #FALSE,VALUE        ; Store the value
  1813.     RTS    PC            ; Return to the caller
  1814.  
  1815. RTFDEL:    MOV    #TRUE,VALUE        ; Store the value
  1816.     RTS    PC            ; Return to the caller
  1817.  
  1818.     .SBTTL    SETFIL - File type routines
  1819.  
  1820. ;++
  1821. ; The following routines will handle the various file types that can
  1822. ; be found in PRO/Kermit.  This will translate the file types into something
  1823. ; that can be typed and set.
  1824. ;--
  1825.  
  1826. .MACRO    FTYPS
  1827.  $TAB    MODASC,<Ascii>
  1828.  $TAB    MODBIN,<Binary>
  1829.  $TAB    MODBLK,<Block>
  1830.  $TAB    MODFIX,<Fixed>
  1831. .ENDM
  1832.  
  1833. TABLE    FTY, FTYPS
  1834. ;
  1835. ; Input the file type
  1836. ;
  1837. INPFTY:    BLSCAL    DOMENU,<#F$FMOD,#K$INRM,#TRUE> ; Call the menu processing
  1838.     RTS    PC            ; Return to the caller
  1839. ;
  1840. ; Dynamic menu routine
  1841. ;
  1842. DYNFTY:    MOV    #T$FTY,R0        ; Get the table address
  1843.     MOV    #FTY$L,R1        ; And the length
  1844.     MOV    FILFLG,R2        ; And the item to find
  1845.     PJMP    DYNFIS            ; Find and insert the string
  1846.  
  1847.     .SBTTL    SET FILE TYPES - Return value routines
  1848.  
  1849. ;++
  1850. ; The following group of routines will return the values associated with
  1851. ; the different file types
  1852. ;--
  1853.  
  1854. RTFASC:    MOV    #MODASC,VALUE        ; Store the value
  1855.     RTS    PC            ; Return
  1856.  
  1857. RTFBIN:    MOV    #MODBIN,VALUE        ; Store the value
  1858.     RTS    PC            ; Return
  1859.  
  1860. RTFBLK:    MOV    #MODBLK,VALUE        ; Store the value
  1861.     RTS    PC            ; Return
  1862.  
  1863. RTFFIX:    MOV    #MODFIX,VALUE        ; Store the value
  1864.     RTS    PC            ; Return
  1865.  
  1866.     .SBTTL    SETGEN - Set general parameters
  1867.  
  1868. ;++
  1869. ; This routine will set various general parameters that can be found in
  1870. ; PRO/Kermit.
  1871. ;--
  1872.  
  1873. SETGEN:    BLSCAL    DOMENU,<#F$GEN,#K$INRM,#FALSE>    ; Set timing parameters
  1874.     RTS    PC            ; Return to the caller
  1875.  
  1876.     .SBTTL    SETGEN - Set general - Set block check types
  1877.  
  1878. ;++
  1879. ; This routine will set the block check types.
  1880. ;--
  1881.  
  1882. .MACRO    BLK
  1883.  $TAB    CHK.1CHAR,<1>
  1884.  $TAB    CHK.2CHAR,<2>
  1885.  $TAB    CHK.CRC,<3>
  1886. .ENDM
  1887. ;
  1888. ; Now generate the text table
  1889. ;
  1890.     .PSECT    $PLIT$, RO, D
  1891.  
  1892.     TABLE    BLK,BLK
  1893. ;
  1894. ; Block checksum processing
  1895. ;
  1896.     .PSECT    $CODE$, RO, I
  1897.  
  1898. INPBLK:    BLSCAL    DOMENU,<#F$BCHK,#K$INRM,#TRUE> ; Get the input
  1899.     RTS    PC            ; Return to the caller
  1900. ;
  1901. ; This routine will handle the dynamic menu processing for the
  1902. ; block check types.
  1903. ;
  1904. DYNBLK:    MOV    #T$BLK,R0        ; Get the address of the table
  1905.     MOV    #BLK$L,R1        ; And the length of the table
  1906.     MOV    CHKTYPE,R2        ; And the value
  1907.     PJMP    DYNFIS            ; Find and insert the string
  1908.  
  1909.     .SBTTL    SETGEN - Set general - Block check values
  1910.  
  1911. ;++
  1912. ; The following routines will return the value for the item.
  1913. ; selected.
  1914. ;--
  1915.  
  1916. RTBK1C:    MOV    #CHK.1CHAR,VALUE    ; One character checksums
  1917.     RTS    PC            ; Return to the caller
  1918.  
  1919. RTBK2C:    MOV    #CHK.2CHAR,VALUE    ; Two character checksums
  1920.     RTS    PC            ; Return to the caller
  1921.  
  1922. RTBK3C:    MOV    #CHK.CRC,VALUE        ; Three chraracter checksums
  1923.     RTS    PC            ; Return to the caller
  1924.  
  1925.  
  1926.     .SBTTL    SETGEN - Set general - Send init retries
  1927.  
  1928. ;++
  1929. ; This will set the number of retries to attempt for the send-init
  1930. ; packet.
  1931. ;--
  1932.  
  1933.     .PSECT    $PLIT$, RO, D
  1934.  
  1935. MSG    SIR,<Enter the send-init packet count and then press DO:>
  1936.  
  1937.     .PSECT    $CODE$, RO, I
  1938.  
  1939. INPSIR:    BLSCAL    GETINP,<#FALSE,#M$SIR,#10.,#0> ; Get the input
  1940.     MOV    R0,VALUE        ; Store the value
  1941.     RTS    PC            ; Return to the caller
  1942.  
  1943. DYNSIR:    MOV    SI.RETRIES,R0        ; Get the value
  1944.     PJMP    DYNDEC            ; Call the routine
  1945.  
  1946.     .SBTTL    SETGEN - Set general - Set repeat quoting character
  1947.  
  1948. ;++
  1949. ; This routine will set the repeat count quoting character.
  1950. ;--
  1951.  
  1952.     .PSECT    $CODE$, RO, I
  1953. ;
  1954. ; Dynamic menu routines
  1955. ;
  1956. DYNRPT:    MOV    SET.REPT.CHAR,R0    ; Get the repeat character to work on
  1957.     PJMP    DYNCOC            ; Call the routine to process it
  1958. ;
  1959. ; Set the repeat character routine
  1960. ;
  1961.  
  1962.     .PSECT    $PLIT$, RO, D
  1963.  
  1964. MSG    RPT,<Enter repeat character and then press DO:>
  1965.  
  1966.     .PSECT    $CODE$, RO, I
  1967.  
  1968. INPRPT:    BLSCAL    GETINP,<#TRUE,#M$RPT,#10.,#CHKQUO> ; Get the input
  1969.     MOV    R0,VALUE        ; Store the value
  1970.     RTS    PC            ; Return to the caller
  1971.  
  1972.     .SBTTL    SETGEN - Set General - 8th bit quoting
  1973.  
  1974. ;++
  1975. ; This routine will set the 8th-bit quoting.
  1976. ;--
  1977.  
  1978.     .PSECT    $PLIT$, RO, D
  1979.  
  1980. MSG    EQU,<Enter the 8th bit quoting character and then press DO:>
  1981.  
  1982.     .PSECT    $CODE$, RW, I
  1983.  
  1984. ; Input routine
  1985.  
  1986. INP8QU:    BLSCAL    GETINP,<#TRUE,#M$EQU,#10.,#CHKQUO> ; Get the input
  1987.     MOV    R0,VALUE        ; Store the value
  1988.     RTS    PC            ; Return to the caller
  1989. ;
  1990. ; Dynamic menu routines
  1991. ;
  1992. ; Receive quoting
  1993. ;
  1994. DYN8QU:    MOVB    RCV.8QUOTE.CHAR,R1    ; Get the receive quoting
  1995.     BLSCAL    BL$ABS,R1        ; Make sure this is positive
  1996.     PJMP    DYNCOC            ; Convert to octal and store
  1997.  
  1998.     .SBTTL    SETGEN - Set general - Set packet retries
  1999.  
  2000. ;++
  2001. ; This routine will set the number of retries to attempt for sending a packet
  2002. ; to the remote system.
  2003. ;--
  2004.  
  2005.     .PSECT    $PLIT$, RO, D
  2006.  
  2007. MSG    PKR,<Enter the packet retry count and the press DO:>
  2008.  
  2009.     .PSECT    $CODE$, RO, I
  2010.  
  2011. ;
  2012. ; Input routine for the packet retry count
  2013. ;
  2014. INPPKR:    BLSCAL    GETINP,<#FALSE,#M$PKR,#10.,#0> ; Get the input
  2015.     MOV    R0,VALUE        ; Store the value
  2016.     RTS    PC            ; Return to the caller
  2017.  
  2018. ;
  2019. ; Dynamic menu routine for the packet retry count
  2020. ;
  2021. DYNPKR:    MOV    PKT.RETRIES,R0        ; Get the number of retries
  2022.     PJMP    DYNDEC            ; Store the information
  2023.  
  2024.     .SBTTL    SETGEN - Set general - Set debugging parameter
  2025.  
  2026. ;++
  2027. ; This routine will set the debugging parameter to be either on or off.
  2028. ;--
  2029.  
  2030.     .PSECT    $CODE$, RO, I
  2031. ;
  2032. ; Dynamic menu processing routine for debugging parameter
  2033. ;
  2034. DYNDEB:    CLR    R0            ; Clear the offset
  2035.     BIT    #1,DEBUG.FLAG        ; Is this on or off
  2036.     BNE    10$            ; Off, so make it the second
  2037.     INC    R0            ; Increment to the second
  2038. 10$:    PJMP    DYNBLD            ; Bold the correct field
  2039. ;
  2040. ; Set routine for the debugging flag
  2041. ;
  2042. INPDEB:    MOV    #1,R0            ; Get the bit to toggle
  2043.     MOV    DEBUG.FLAG,VALUE    ; Move the value
  2044.     XOR    R0,VALUE        ; Xor the value
  2045.     RTS    PC            ; Return to the caller
  2046.  
  2047.     .SBTTL    SETSND - Set the send packet parameters
  2048.  
  2049. ;++
  2050. ; This routine will set the send packet parameters.  
  2051. ;--
  2052.  
  2053. SETSND:    BLSCAL    DOMENU,<#F$SEND,#K$NORM,#FALSE> ; Set send parameters
  2054.     RTS    PC            ; Return to the caller
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.     .SBTTL    SETRCV - Set the receive packet parameters
  2064.  
  2065. ;++
  2066. ; This routine will set the receive packet parameters
  2067. ;--
  2068.  
  2069.  
  2070. SETRCV:    BLSCAL    DOMENU,<#F$RECV,#K$NORM,#FALSE> ; Set receive parameters
  2071.     RTS    PC            ; Return to the caller
  2072.  
  2073.     .SBTTL    SET SEND/RECEIVE - Packet length
  2074.  
  2075. ;++
  2076. ; The following routines are the set send/receive routines for the
  2077. ; packet length.
  2078. ;--
  2079.  
  2080.     .PSECT    $PLIT$, RO, D
  2081.  
  2082. MSG    PKTL,<Enter the packet length and then press DO:>
  2083.  
  2084.     .PSECT    $CODE$, RO, I
  2085. ;++
  2086. ; Dynamic menu routine
  2087. ;--
  2088.  
  2089. DYRPKL:    MOV    RCV.PKT.SIZE,R1        ; Get the value
  2090.     BR    DYNPKL            ; Process the packet length
  2091.  
  2092. DYSPKL:    MOV    SND.PKT.SIZE,R1        ; Get the value
  2093. ;
  2094. ; Common code to set the dynamic menu up for PACKET LENGTH
  2095. ;
  2096. DYNPKL:    BLSCAL    BL$ABS,R1        ; Get the real value
  2097.     PJMP    DYNDEC        ; Insert the value into the menu
  2098.  
  2099. ;++
  2100. ; Here to input the packet length
  2101. ;--
  2102.  
  2103. INPPKL:    BLSCAL    GETINP,<#FALSE,#M$PKTL,#10.,#CHKPKL> ; Get the input
  2104.     MOV    R0,VALUE        ; Store the value
  2105.     RTS    PC            ; Return to the caller
  2106.  
  2107.  
  2108.     .SBTTL    SET SEND/RECEIVE - End of line
  2109.  
  2110. ;++
  2111. ; The following routines are the set send/receive routines for the end of line
  2112. ; character.
  2113. ;--
  2114.  
  2115.     .PSECT    $PLIT$, RO, D
  2116.  
  2117. MSG    EOL,<Enter the end of line value and then press DO:>
  2118.  
  2119.     .PSECT    $CODE$, RW, I
  2120.  
  2121. ; Input routine
  2122.  
  2123. INPEOL:    BLSCAL    GETINP,<#FALSE,#M$EOL,#8.,#CHKCTL> ; Get the input
  2124.     MOV    R0,VALUE        ; Store the value
  2125.     RTS    PC            ; Return to the caller
  2126.  
  2127. ; Dynamic menu routines
  2128. ;
  2129. ; Send EOL
  2130. ;
  2131. DYSEOL:    MOVB    SND.EOL,R1        ; Get the send eol character
  2132.     BR    DYNEOL            ; Join the common code
  2133. ;
  2134. ; Receive EOL
  2135. ;
  2136. DYREOL:    MOVB    RCV.EOL,R1        ; Get the receive eol character
  2137. ;
  2138. ; Common routine for the processing of the EOL character into the menu.
  2139. ;
  2140. DYNEOL:    BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2141.     PJMP    DYNCOC            ; Convert to octal and store
  2142.  
  2143.     .SBTTL    SET SEND/RECEIVE - Time out
  2144.  
  2145. ;++
  2146. ; This routine will set the timeout parameter for the sending and receiving
  2147. ; of packets.
  2148. ;--
  2149.  
  2150.     .PSECT    $PLIT$, RO, D
  2151.  
  2152. MSG    TIM,<Enter the timeout value and then press DO:>
  2153.  
  2154.     .PSECT    $CODE$, RW, I
  2155.  
  2156. ; Input routine
  2157.  
  2158. INPTIM:    BLSCAL    GETINP,<#FALSE,#M$TIM,#10.,#CHKTIM> ; Get the input
  2159.     MOV    R0,VALUE        ; Store the value
  2160.     RTS    PC            ; Return to the caller
  2161. ;
  2162. ; Dynamic menu routines
  2163. ;
  2164. ; Send timeout
  2165. ;
  2166. DYSTIM:    MOVB    SND.TIMEOUT,R1        ; Get the send timeout
  2167.     BR    DYNTIM            ; Join the common code
  2168. ;
  2169. ; Receive timeout
  2170. ;
  2171. DYRTIM:    MOVB    RCV.TIMEOUT,R1        ; Get the receive timeout
  2172. ;
  2173. ; Common routine for the processing of the timeout and storing into the menu
  2174. ;
  2175. DYNTIM:    BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2176.     PJMP    DYNDEC            ; Convert to octal and store
  2177.  
  2178.     .SBTTL    SET SEND/RECEIVE - Start of packet
  2179.  
  2180. ;++
  2181. ; This routine will set the start of packet characterfor the sending and
  2182. ; receiving of packets.
  2183. ;--
  2184.  
  2185.     .PSECT    $PLIT$, RO, D
  2186.  
  2187. MSG    SOP,<Enter the start of packet character and then press DO:>
  2188.  
  2189.     .PSECT    $CODE$, RW, I
  2190.  
  2191. ; Input routine
  2192.  
  2193. INPSOP:    BLSCAL    GETINP,<#TRUE,#M$SOP,#10.,#CHKCTL> ; Get the input
  2194.     MOV    R0,VALUE        ; Store the value
  2195.     RTS    PC            ; Return to the caller
  2196. ;
  2197. ; Dynamic menu routines
  2198. ;
  2199. ; Send start of packet
  2200. ;
  2201. DYSSOP:    MOVB    SND.SOH,R1        ; Get the send start of packet
  2202.     BR    DYNSOP            ; Join the common code
  2203. ;
  2204. ; Receive start of packet
  2205. ;
  2206. DYRSOP:    MOVB    RCV.SOH,R1        ; Get the receive start of packet
  2207. ;
  2208. ; Common routine for the processing of the start of packet and storing
  2209. ; into the menu
  2210. ;
  2211. DYNSOP:    BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2212.     PJMP    DYNCOC            ; Convert to octal and store
  2213.  
  2214.     .SBTTL    SET SEND/RECEIVE - Padding character
  2215.  
  2216. ;++
  2217. ; This routine will set the padding character for the sending and
  2218. ; receiving of packets.
  2219. ;--
  2220.  
  2221.     .PSECT    $PLIT$, RO, D
  2222.  
  2223. MSG    PDC,<Enter the padding character and then press DO:>
  2224.  
  2225.     .PSECT    $CODE$, RW, I
  2226.  
  2227. ; Input routine
  2228.  
  2229. INPPDC:    BLSCAL    GETINP,<#TRUE,#M$PDC,#10.,#CHKPDC> ; Get the input
  2230.     MOV    R0,VALUE        ; Store the value
  2231.     RTS    PC            ; Return to the caller
  2232. ;
  2233. ; Dynamic menu routines
  2234. ;
  2235. ; Send padding
  2236. ;
  2237. DYSPDC:    MOVB    SND.PADCHAR,R1        ; Get the send padding
  2238.     BR    DYNPDC            ; Join the common code
  2239. ;
  2240. ; Receive padding
  2241. ;
  2242. DYRPDC:    MOVB    RCV.PADCHAR,R1        ; Get the receive padding
  2243. ;
  2244. ; Common routine for the processing of the padding and storing
  2245. ; into the menu
  2246. ;
  2247. DYNPDC:    BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2248.     PJMP    DYNCOC            ; Convert to octal and store
  2249.  
  2250.     .SBTTL    SET SEND/RECEIVE - Number of padding character
  2251.  
  2252. ;++
  2253. ; This routine will set the number of padding characters for the sending and
  2254. ; receiving of packets.
  2255. ;--
  2256.  
  2257.     .PSECT    $PLIT$, RO, D
  2258.  
  2259. MSG    NPD,<Enter the number of padding characters and then press DO:>
  2260.  
  2261.     .PSECT    $CODE$, RW, I
  2262.  
  2263. ; Input routine
  2264.  
  2265. INPNPD:    BLSCAL    GETINP,<#FALSE,#M$NPD,#10.,#0> ; Get the input
  2266.     MOV    R0,VALUE        ; Store the value
  2267.     RTS    PC            ; Return to the caller
  2268. ;
  2269. ; Dynamic menu routines
  2270. ;
  2271. ; Send number of padding characters
  2272. ;
  2273. DYSNPD:    MOVB    SND.NPAD,R1        ; Get the send number of padding characters
  2274.     BR    DYNNPD            ; Join the common code
  2275. ;
  2276. ; Receive number of padding characters
  2277. ;
  2278. DYRNPD:    MOVB    RCV.NPAD,R1        ; Get the receive number of padding characters
  2279. ;
  2280. ; Common routine for the processing of the number of padding characters
  2281. ; and storing into the menu
  2282. ;
  2283. DYNNPD:    BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2284.     PJMP    DYNDEC            ; Convert to octal and store
  2285.  
  2286.     .SBTTL    SET SEND/RECEIVE - Quoting
  2287.  
  2288. ;++
  2289. ; This routine will set the quoting characterfor the sending and
  2290. ; receiving of packets.
  2291. ;--
  2292.  
  2293.     .PSECT    $PLIT$, RO, D
  2294.  
  2295. MSG    QUO,<Enter the quoting character and then press DO:>
  2296.  
  2297.     .PSECT    $CODE$, RW, I
  2298.  
  2299. ; Input routine
  2300.  
  2301. INPQUO:    BLSCAL    GETINP,<#TRUE,#M$QUO,#10.,#CHKQUO> ; Get the input
  2302.     MOV    R0,VALUE        ; Store the value
  2303.     RTS    PC            ; Return to the caller
  2304. ;
  2305. ; Dynamic menu routines
  2306. ;
  2307. ; Send quoting
  2308. ;
  2309. DYSQUO:    MOVB    SND.QUOTE,R1        ; Get the send quoting
  2310.     BR    DYNQUO            ; Join the common code
  2311. ;
  2312. ; Receive quoting
  2313. ;
  2314. DYRQUO:    MOVB    RCV.QUOTE,R1        ; Get the receive quoting
  2315. ;
  2316. ; Common routine for the processing of the quoting and storing
  2317. ; into the menu
  2318. ;
  2319. DYNQUO:    BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2320.     PJMP    DYNCOC            ; Convert to octal and store
  2321.  
  2322.     .SBTTL    SETLIN - Set line characteristics
  2323.  
  2324. ;++
  2325. ; This routine will cause the line characteristics to be set.  These could be
  2326. ; the default parameters, the current parameters or the resetting of the
  2327. ; parameters.
  2328. ;--
  2329.  
  2330.  
  2331. SETLIN:    BLSCAL    DOMENU,<#F$LINE,#K$NORM,#FALSE> ; Set line characteristics
  2332.     RTS    PC            ; Return to the caller
  2333.  
  2334.     .SBTTL    SETLDF - Set the default line characteristics
  2335.  
  2336. ;++
  2337. ; This routine will set the default line characteristics
  2338. ;--
  2339.  
  2340. SETLDF:    MOV    #DEFXKP,XKBLK        ; Set the line defaults
  2341.     BLSCAL    DOMENU,<#F$LCHR,#K$NORM,#FALSE> ; Get the information
  2342.     JSR    PC,DF.INI        ; Initialize the default file processing
  2343.     MOV    #XK.IDX,R0        ; Index for the file
  2344.     MOV    #DEFXKP,R1        ; Address of the parameters
  2345.     MOV    #CURXKL,R2        ; Length of the block
  2346.     JSR    PC,DF.WT        ; Write the parameters
  2347.     PJMP    DF.FIN            ; Close the default file
  2348.  
  2349.     .SBTTL    SETLCR - Set the current line characteristics
  2350.  
  2351. ;++
  2352. ; This routine will set the current line characteristics
  2353. ;--
  2354.  
  2355. SETLCR:    MOV    #CURXKP,XKBLK        ; Set the line current parameters
  2356.     BLSCAL    DOMENU,<#F$LCHR,#K$NORM,#FALSE> ; Get the input
  2357.     RTS    PC            ; Return to the caller
  2358.  
  2359.     .SBTTL    SET LINE -- Terminal speeds
  2360.  
  2361. ;++
  2362. ; These routines will handle the setting of the recieve and the transmit
  2363. ; baud rates.  The only differences between the routines are just where the
  2364. ; information is stored and the line that is modified for the dynamic
  2365. ; menu processing.
  2366. ;--
  2367.  
  2368. .MACRO    SPD
  2369.  $TAB    S.50,<50>
  2370.  $TAB    S.75,<75>
  2371.  $TAB    S.100,<100>
  2372.  $TAB    S.110,<110>
  2373.  $TAB    S.134,<134>
  2374.  $TAB    S.150,<150>
  2375.  $TAB    S.200,<200>
  2376.  $TAB    S.300,<300>
  2377.  $TAB    S.600,<600>
  2378.  $TAB    S.1200,<1200>
  2379.  $TAB    S.1800,<1800>
  2380.  $TAB    S.2000,<2000>
  2381.  $TAB    S.2400,<2400>
  2382.  $TAB    S.3600,<3600>
  2383.  $TAB    S.4800,<4800>
  2384.  $TAB    S.7200,<7200>
  2385.  $TAB    S.9600,<9600>
  2386.  $TAB    S.19.2,<19200>
  2387. ; $TAB    S.38.4,<38400>
  2388. .ENDM
  2389.  
  2390. ; Now define the item in the table
  2391.  
  2392.     .PSECT    $PLIT$, RO, D
  2393.  
  2394.     TABLE    SPD,SPD            ; Define the speed table
  2395.     .GLOBL    T$SPD, SPD$L
  2396.     .PSECT    $CODE$, RO, I
  2397.  
  2398. ;
  2399. ; Dynamic menu routines
  2400. ;
  2401. ; Transmit speed
  2402. ;
  2403. DYNXSP:    MOV    #TC.XSP,R0        ; Get the transmit speed
  2404.     BR    DYNSPD            ; Join the common routine
  2405. ;
  2406. ; Receive speed
  2407. ;
  2408. DYNRSP:    MOV    #TC.RSP,R0        ; Get the receive speed
  2409. ;
  2410. ; Common routine
  2411. ;
  2412. DYNSPD:    MOV    XKBLK,R1        ; Get the block address
  2413.     JSR    PC,FNDXKP        ; Find the XK parameter
  2414.     TST    R0            ; Get one
  2415.     BEQ    99$            ; No, just exit
  2416.  
  2417.     MOVB    (R0),R2            ; Get the information
  2418.     MOV    #T$SPD,R0        ; Get the table address
  2419.     MOV    #SPD$L,R1        ; And the length
  2420.     JSR    PC,DYNFIS        ; Find and insert the string
  2421. 99$:    RTS    PC            ; And return
  2422. ;
  2423. ; Set routines
  2424. ;
  2425. SETXSP:
  2426.     MOV    #TC.XSP,R0        ; Get the parameter we need
  2427.     BR    SETSPD            ; Set the speed
  2428. ;
  2429. ; Receive speed routine
  2430. ;
  2431. SETRSP:    MOV    #TC.RSP,R0        ; Get the parameter
  2432. ;
  2433. ; Common routine
  2434. ;
  2435. SETSPD:    MOV    XKBLK,R1        ; Point to the parameter block
  2436.     JSR    PC,FNDXKP        ; Find the parameter
  2437.     TST    R0            ; Find it?
  2438.     BEQ    99$            ; No, just return
  2439.     MOVB    VALUE,(R0)        ; Yes, store the value
  2440. 99$:    RTS    PC            ; Return to the caller
  2441.  
  2442. ;
  2443. ; Input routine
  2444. ;
  2445. ; This routine will build the multi-choice menu and call the menu processing
  2446. ; with it.  The frame block will be in the data area.
  2447. ;
  2448.     .PSECT    $PLIT$, RO, D
  2449.  
  2450. MSG    BTXT,<50   75   100  110  134  150  200  300  600  1200 1800 2000 2400 3600 4800 7200 9600 19200>
  2451. MSG    BTTL,<Baud rate>
  2452. L$BTTL:    .WORD    BTTL$L            ; Length of the baud rate menu
  2453. MSG    BTX1,<Press EXIT to return to the previous menu>
  2454. MSG    BTX2,<Press MAIN SCREEN to return to the PRO/Kermit main menu>
  2455. MSG    BPRM,<Make a choice and press DO:>
  2456. MSG    BHLP,<BAUDRATE>            ;[03]
  2457.  
  2458.     .PSECT    $CODE$, RO, I
  2459.  
  2460. INPSPD:    MOV    #A$MPAC,R5        ; Get the argument block address
  2461.     CALL    MPACK            ; Pack the information into the menu
  2462.     TST    STATUS            ; Get the status returned by the routine
  2463.     BMI    90$            ; Failed, see why
  2464.  
  2465.     MOV    #M$TXT1,A$MPAK+MK$AG1    ; Store for TEXT01 line
  2466.     MOV    #L$TXT1,A$MPAK+MK$AG2    ; And the length
  2467.     MOV    #M$BTX1,A$MPAK+MK$AG3    ; Store the TEXT01 line
  2468.     MOV    #BTX1$L,MPKLEN        ; Store the length
  2469.     MOV    #A$MPAK,R5        ; Point to the arguments
  2470.     CALL    MPACK            ; Pack the information in
  2471.     BMI    90$            ; Branch if it failed
  2472.  
  2473.     MOV    #M$TXT2,A$MPAK+MK$AG1    ; Store for TEXT02 line
  2474.     MOV    #L$TXT2,A$MPAK+MK$AG2    ; And the length
  2475.     MOV    #M$BTX2,A$MPAK+MK$AG3    ; Store the TEXT02 line
  2476.     MOV    #BTX2$L,MPKLEN        ; Store the length
  2477.     MOV    #A$MPAK,R5        ; Point to the arguments
  2478.     CALL    MPACK            ; Pack the information in
  2479.     BMI    90$            ; Branch if it failed
  2480.  
  2481.     MOV    #M$PRMT,A$MPAK+MK$AG1    ; Store for PRMT line
  2482.     MOV    #L$PRMT,A$MPAK+MK$AG2    ; And the length
  2483.     MOV    #M$BPRM,A$MPAK+MK$AG3    ; Store the PRMT line
  2484.     MOV    #BPRM$L,MPKLEN        ; Store the length
  2485.     MOV    #A$MPAK,R5        ; Point to the arguments
  2486.     CALL    MPACK            ; Pack the information in
  2487.     BMI    90$            ; Branch if it failed
  2488.  
  2489.     MOV    #M$GHLP,A$MPAK+MK$AG1    ;[03] Store for GHLP line
  2490.     MOV    #L$GHLP,A$MPAK+MK$AG2    ;[03] And the length
  2491.     MOV    #M$BHLP,A$MPAK+MK$AG3    ;[03] Store the GHLP line
  2492.     MOV    #BHLP$L,MPKLEN        ;[03] Store the length
  2493.     MOV    #A$MPAK,R5        ;[03] Point to the arguments
  2494.     CALL    MPACK            ;[03] Pack the information in
  2495.     BMI    90$            ;[03] Branch if it failed
  2496. ;
  2497. ; Here to display the multi-choice menu
  2498. ;
  2499.     BLSCAL    BL$MOV,<#BTXT$L,#M$BTXT,#OPTSTR> ; Copy the string
  2500.     MOV    #5,L$OPTS        ; Store the string length
  2501.     MOV    #<BTXT$L/5>,C$OPTS    ; Number of options
  2502.     MOV    #A$MMEN,R5        ; Get the argument block address
  2503.     CALL    MMENU            ; Display the multi-choice menu
  2504.     CMP    #ST.KEY,STATUS        ; Key typed?
  2505.     BEQ    90$            ; Yes, just return
  2506.     TST    STATUS            ; Return ok?
  2507.     BMI    90$            ; No, issue an error
  2508.     
  2509.     MOV    RSPARY,R0        ; Get the response number
  2510.     ASL    R0            ; Make this a word index
  2511.     MOV    T$SPD-2(R0),VALUE    ; Store the value
  2512. 99$:    RTS    PC            ; Return to the caller
  2513. ;
  2514. ; Here if there was an error in the processing of the multi-choice menu
  2515. ; Just return that we didn't get a value
  2516. ;
  2517. 90$:    PJMP    CCRET            ; No value return
  2518.  
  2519.     .SBTTL    SETLINE -- Set flow of control
  2520.  
  2521. ;++
  2522. ; These routines will handle the setting of the flow of control parameters
  2523. ; for the XK.  These routines will just toggle the state of the flow
  2524. ; of control processing.
  2525. ;--
  2526.  
  2527.     .PSECT    $CODE$, RO, I
  2528. ;
  2529. ; Dynamic menu processing routine for flow of control
  2530. ;
  2531.  
  2532. DYNFC:    MOV    #TC.BIN,R0        ; Get the parameter to look for
  2533.     MOV    XKBLK,R1        ; Point to the block to look in
  2534.     JSR    PC,FNDXKP        ; Find the XK parameter
  2535.     TST    R0            ; Find it?
  2536.     BEQ    99$            ; No, just exit
  2537.     MOVB    (R0),R1            ; Get the parameter state
  2538.     CLR    R0            ; Assume the first
  2539.     TST    R1            ; Is this enabled?
  2540.     BEQ    10$            ; Yes, light the first
  2541.     INC    R0            ; No, use the second
  2542. 10$:    JSR    PC,DYNBLD        ; Do the bolding
  2543. 99$:    RTS    PC            ; Return to the caller
  2544. ;
  2545. ; Set routine for flow of control
  2546. ;
  2547. SETFC:    MOV    #TC.BIN,R0        ; Get the parameter to look for
  2548.     MOV    XKBLK,R1        ; Get the block we are processing
  2549.     JSR    PC,FNDXKP        ; Find the XK parameter
  2550.     TST    R0            ; Have a value?
  2551.     BEQ    99$            ; Not in block?
  2552.     MOVB    VALUE,(R0)        ; Store the information
  2553. 99$:    RTS    PC            ; Return to the caller
  2554. ;
  2555. ; Input routine for flow of control
  2556. ;
  2557. INPFC:    MOV    #TC.BIN,R0        ; Get the parameter to look for
  2558.     MOV    XKBLK,R1        ; Get the block we are processing
  2559.     JSR    PC,FNDXKP        ; Find the XK parameter
  2560.     TST    R0            ; Have a value?
  2561.     BEQ    99$            ; Not in block?
  2562.     MOVB    (R0),VALUE        ; Get the item
  2563.     MOV    #1,R0            ; Get this value
  2564.     XOR    R0,VALUE        ; And change it
  2565. 99$:    RTS    PC            ; Return to the caller
  2566.  
  2567.     .SBTTL    SET LINE -- Modem type routines
  2568. ;++
  2569. ; These routines will handle the modem type, store the information into
  2570. ; the dynamic menu, accept it, etc.
  2571. ;--
  2572.  
  2573. .MACRO XTM
  2574.  $TAB    XTM.NO,<No modem, hard-wired line>
  2575.  $TAB    XTM.FS,<USFSK- 0..300 baud Bell 103J>
  2576.  $TAB    XTM.21,<CCITTV.21- 0..300 baud European>
  2577.  $TAB    XTM.M1,<CCITTV.23 Mode 1 - 75/0.. 300 split>
  2578.  $TAB    XTM.M2,<CCITTV.23 Mode 2 - 75/0..1200 split>
  2579.  $TAB    XTM.PS,<DPSK - 1200 baud Bell 212>
  2580. .ENDM
  2581. ;
  2582. ; Generate the table
  2583. ;
  2584.     .PSECT    $PLIT$, RO, D
  2585.  
  2586.     TABLE    XTM, XTM        ; Generate the table
  2587. ;
  2588. ; Routines - Dynamic menu routine
  2589. ;
  2590.     .PSECT    $CODE$, RO, I
  2591.  
  2592. DYNMDM:    MOV    #XT.MTP,R0        ; Need the modem type
  2593.     MOV    XKBLK,R1        ; From this block
  2594.     JSR    PC,FNDXKP        ; Find the XK parameter
  2595.     TST    R0            ; Have an address?
  2596.     BEQ    99$            ; No, just leave
  2597.     MOVB    (R0),R2            ; Get the value of the parameter
  2598.     MOV    #T$XTM,R0        ; Get the table address
  2599.     MOV    #XTM$L,R1        ; Get the length
  2600.     JSR    PC,DYNFIS        ; Find and insert the string
  2601. 99$:    RTS    PC            ; Return to the caller
  2602. ;
  2603. ; Set routine
  2604. ;
  2605. SETMDM:    MOV    #XT.MTP,R0        ; Need the modem type
  2606.     MOV    XKBLK,R1        ; Current block we are processing
  2607.     JSR    PC,FNDXKP        ; Find the parameter
  2608.     TST    R0            ; Have the address?
  2609.     BEQ    99$            ; No, just return
  2610.     MOVB    VALUE,(R0)        ; Store the value
  2611. 99$:    RTS    PC            ; Return to the caller
  2612. ;
  2613. ; Input routine
  2614. ;
  2615. INPMDM:    BLSCAL    DOMENU,<#F$MODM,#K$INRM,#TRUE> ; Get the input from a one shot
  2616.     RTS    PC            ; Return to the caller
  2617.  
  2618.     .SBTTL    Modem input routines
  2619.  
  2620. ;++
  2621. ; The following routines will return the various values for the modem
  2622. ; types
  2623. ;--
  2624.  
  2625. RTNOMD:    MOV    #XTM.NO,VALUE        ; No modem
  2626.     RTS    PC            ; Return to the caller
  2627.  
  2628. RTUSFS:    MOV    #XTM.FS,VALUE        ; USFSK 103J
  2629.     RTS    PC            ; Return to the caller
  2630.  
  2631. RTCC21:    MOV    #XTM.21,VALUE        ; CCITTV.21 0..300
  2632.     RTS    PC            ; Return to the caller
  2633.  
  2634. RTCCM1:    MOV    #XTM.M1,VALUE        ; CCITTV.23 Mode 1
  2635.     RTS    PC            ; Return to the caller
  2636.  
  2637. RTCCM2:    MOV    #XTM.M2,VALUE        ; CCITTV.23 Mode 2
  2638.     RTS    PC            ; Return to the caller
  2639.  
  2640. RTDPSK:    MOV    #XTM.PS,VALUE        ; DPSK Bell 212
  2641.     RTS    PC            ; Return to the caller
  2642.  
  2643.     .SBTTL    Set line characteristics -- Parity
  2644.  
  2645. ;++
  2646. ; The following routines will set and fix dynamic menus for the parity settings
  2647. ; for PRO/Kermit.
  2648. ;--
  2649.  
  2650. .MACRO    PAR
  2651.  $TAB    PR.NONE,<None>
  2652.  $TAB    PR.EVEN,<Even>
  2653.  $TAB    PR.SPACE,<Space>
  2654.  $TAB    PR.MARK,<Mark>
  2655.  $TAB    PR.ODD,<Odd>
  2656. .ENDM
  2657. ;
  2658. ; Now generate the parity information
  2659. ;
  2660.     TABLE    PAR,PAR
  2661. ;
  2662. ; Dynamic menu routine for the parity processing.
  2663. ;
  2664. DYNPAR:    MOV    #T$PAR,R0        ; Get the parity table
  2665.     MOV    #PAR$L,R1        ; Get the length of the table
  2666.     MOV    PARITY,R2        ; Get the current value
  2667.     PJMP    DYNFIS            ; Find and insert the string
  2668. ;
  2669. ; Set the value routine
  2670. ;
  2671. SETPAR:    MOV    VALUE,PARITY        ; Store the value
  2672.     CMP    #PR.NONE,PARITY        ; No parity?
  2673.     BEQ    10$            ; Yes, handle it
  2674.     CMP    #PR.EVEN,PARITY        ; Even parity?
  2675.     BEQ    20$            ; Yes, handle it
  2676.     CMP    #PR.ODD,PARITY        ; Odd parity?
  2677.     BEQ    30$            ; Yes, handle it
  2678. ;
  2679. ; Here if it is a type of parity that we have to handle
  2680. ;
  2681.     MOV    #FALSE,DEV.PARITY.FLAG    ; Note the device is doing it
  2682.     CLR    R2            ; TC.PAR is set to zero
  2683.     MOV    #8.,R3            ; 8 bit data information
  2684.     CLR    R4            ; Clear this
  2685.     BR    90$            ; Enter common code
  2686. ;
  2687. ; Here to handle the no parity setting
  2688. ;
  2689. 10$:    MOV    #TRUE,DEV.PARITY.FLAG    ; Note the device is doing it
  2690.     CLR    R2            ; TC.PAR is set to zero
  2691.     MOV    #8.,R3            ; 8 bit data information
  2692.     CLR    R4            ; Clear this
  2693.     BR    90$            ; Enter common code
  2694. ;
  2695. ; Here to handle the even parity setting
  2696. ;
  2697. 20$:    MOV    #TRUE,DEV.PARITY.FLAG    ; Note the device is doing it
  2698.     MOV    #1,R2            ; TC.PAR is set to one
  2699.     MOV    #8.,R3            ; 8 bit data information
  2700.     MOV    #1,R4            ; Clear this
  2701.     BR    90$            ; Enter common code
  2702. ;
  2703. ; Here to handle the odd parity setting
  2704. ;
  2705. 30$:    MOV    #TRUE,DEV.PARITY.FLAG    ; Note the device is doing it
  2706.     MOV    #1,R2            ; TC.PAR is set to one
  2707.     MOV    #8.,R3            ; 8 bit data information
  2708.     CLR    R4            ; Clear this
  2709.  
  2710. ;
  2711. ; First attempt to find the parity setting
  2712. ;
  2713. 90$:    MOV    #TC.PAR,R0        ; Need the parity type
  2714.     MOV    XKBLK,R1        ; From this block
  2715.     JSR    PC,FNDXKP        ; Find the XK parameter
  2716.     TST    R0            ; Have an address?
  2717.     BEQ    100$            ; Skip if not found
  2718.     MOVB    R2,@R0            ; Store the updated information
  2719. ;
  2720. ; Now do the character size
  2721. ;
  2722. 100$:    MOV    #TC.FSZ,R0        ; Get the character size
  2723.     JSR    PC,FNDXKP        ; Find it
  2724.     TST    R0            ; Have an address?
  2725.     BEQ    110$            ; Branch if not found
  2726.     MOVB    R3,@R0            ; Store the updated value
  2727. ;
  2728. ; Now do the parity setting
  2729. ;
  2730. 110$:    MOV    #TC.EPA,R0        ; Get the even/odd parity setting
  2731.     JSR    PC,FNDXKP        ; Find the XK parameter
  2732.     TST    R0            ; Have it?
  2733.     BEQ    120$            ; Branch if not found
  2734.     MOVB    R4,@R0            ; Store the updated value
  2735. ;
  2736. ; Now return to the caller
  2737. ;
  2738. 120$:    RTS    PC            ; Return to the caller
  2739.  
  2740. ;
  2741. ; Input routine for the parity processing
  2742. ;
  2743. INPPAR:    BLSCAL    DOMENU,<#F$PAR,#K$INRM,#TRUE> ; Call the menu processing
  2744.     RTS    PC            ; Return to the caller
  2745.  
  2746.     .SBTTL    Return parity types
  2747.  
  2748. ;++
  2749. ; The following routines return the different possible parity settings.
  2750. ;--
  2751.  
  2752. RTNOPR:    MOV    #PR.NONE,VALUE        ; Store the value
  2753.     RTS    PC            ; Return to the caller
  2754.  
  2755. RTEVPR:    MOV    #PR.EVEN,VALUE        ; Store the value
  2756.     RTS    PC            ; Return to the caller
  2757.  
  2758. RTODPR:    MOV    #PR.ODD,VALUE        ; Store the odd parity value
  2759.     RTS    PC            ; Return to the caller
  2760.  
  2761. RTMKPR:    MOV    #PR.MARK,VALUE        ; Store the mark parity value
  2762.     RTS    PC            ; Return to the caller
  2763.  
  2764. RTSPPR:    MOV    #PR.SPACE,VALUE        ; Store the space parity value
  2765.     RTS    PC            ; Return to the caller
  2766.  
  2767.     .SBTTL    Terminal emulation -- Connect escape character
  2768.  
  2769. ;++
  2770. ; This routine will set the terminal emulation escape character.  This
  2771. ; character will return the user back to the menu for the emulation processor.
  2772. ;--
  2773.  
  2774.     .PSECT    $PLIT$, RO, D
  2775.  
  2776. MSG    ECH,<Enter escape character and then press DO:>
  2777.  
  2778.     .PSECT    $CODE$, RW, I
  2779.  
  2780. ; Input routine
  2781.  
  2782. INPECH:    BLSCAL    GETINP,<#TRUE,#M$ECH,#10.,#0> ; Get the input
  2783.     MOV    R0,VALUE        ; Store the value
  2784.     RTS    PC            ; Return to the caller
  2785. ;
  2786. ; Dynamic menu routines
  2787. ;
  2788. ; Connect escape character
  2789. ;
  2790. DYNECH:    MOVB    ESCCHR,R1        ; Get the receive quoting
  2791.     BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2792.     PJMP    DYNCOC            ; Convert to octal and store
  2793.  
  2794.     .SBTTL    Terminal emulation -- IBM turn around character
  2795.  
  2796. ;++
  2797. ; This routine will se the IBM turn around character.
  2798. ;--
  2799.  
  2800.     .PSECT    $PLIT$, RO, D
  2801.  
  2802. MSG    ICH,<Enter IBM turn around character and then press DO:>
  2803.  
  2804.     .PSECT    $CODE$, RW, I
  2805.  
  2806. ; Store routines.
  2807.  
  2808. SETICH:    MOV    VALUE,IBM.CHAR        ; Store the quoting value
  2809.     RTS    PC            ; Return to the caller
  2810.  
  2811. ; Input routine
  2812.  
  2813. INPICH:    BLSCAL    GETINP,<#TRUE,#M$ICH,#10.,#0> ; Get the input
  2814.     MOV    R0,VALUE        ; Store the value
  2815.     RTS    PC            ; Return to the caller
  2816. ;
  2817. ; Dynamic menu routines receive quoting
  2818. ;
  2819. DYNICH:    MOVB    IBM.CHAR,R1        ; Get the receive quoting
  2820.     BLSCAL    BL$ABS,R1        ; Make sure this is positive
  2821.     PJMP    DYNCOC            ; Convert to octal and store
  2822.  
  2823.     .SBTTL    Terminal emulation -- IBM mode
  2824.  
  2825. ;++
  2826. ; This routine will set the IBM mode flag for PRO/Kermit.
  2827. ;--
  2828.  
  2829.     .PSECT    $CODE$, RO, I
  2830.  
  2831. ; Dynamic menu routine
  2832.  
  2833. DYNIMD:    CLR    R0            ; Assume it is
  2834.     BIT    #1,IBM.FLAG        ; Is this true?
  2835.     BNE    10$            ; Skip if it is
  2836.     INC    R0            ; No, change to the second
  2837. 10$:    PJMP    DYNBLD            ; Bold the section
  2838.  
  2839. ; Input routine
  2840.  
  2841. INPIMD:    MOV    IBM.FLAG,VALUE        ; Copy the value
  2842.     MOV    #1,R0            ; Get the value
  2843.     XOR    R0,VALUE        ; Convert the value
  2844.     RTS    PC            ; And return to the caller
  2845.  
  2846.     .SBTTL    Terminal emulation -- Duplex
  2847.  
  2848. ;++
  2849. ; This routine will set the terminal to either half or full duplex.
  2850. ;--
  2851.  
  2852.     .PSECT    $CODE$, RO, I
  2853.  
  2854. ; Dynamic menu processing routine
  2855.  
  2856. DYNDPX:    CLR    R0            ; Assume that this is the first item
  2857.     CMP    #DP.FULL,DUPLEX        ; Am I correct?
  2858.     BNE    10$            ; Branch if so
  2859.     INC    R0            ; No, use the second entry
  2860. 10$:    PJMP    DYNBLD            ; Bold the section on the screen
  2861.  
  2862. ; Input routine, just toggle the current value to the other valu
  2863.  
  2864. INPDPX:    MOV    #DP.HALF,VALUE        ; Assume half duplex
  2865.     CMP    #DP.HALF,DUPLEX        ; Am I wrong?
  2866.     BNE    99$            ; No, just return
  2867.     MOV    #DP.FULL,VALUE        ; Already is half, change to full
  2868. 99$:    RTS    PC            ; Return to the caller
  2869.  
  2870.     .SBTTL    Terminal emulation -- 7-bit character codes
  2871.  
  2872. ;++
  2873. ; This routine will set the 7-bit character codes.  This should not be
  2874. ; confused with the parameter in the XK port driver.  This one causes the
  2875. ; 8th bit to be striped only for the terminal emulation and not for the
  2876. ; transfers.  This is useful for talking with DECsystem-10s that sent
  2877. ; even parity characters to the terminal, but Kermit-10 sends full 8 bit
  2878. ; information
  2879. ;--
  2880.  
  2881.     .PSECT    $CODE$, RO, I
  2882.  
  2883. ;++
  2884. ; This routine will set the information in the dynamic menu.
  2885. ;--
  2886.  
  2887. DYN7BT:    CLR    R0            ; Assume that this is the first item
  2888.     BIT    #TRUE,TRM7BT        ; Transparent terminal emulation?
  2889.     BNE    10$            ; Branch if so
  2890.     INC    R0            ; No, use the second entry
  2891. 10$:    PJMP    DYNBLD            ; Bold the section on the screen
  2892.  
  2893. ;++
  2894. ; Input routine for the 7-bit character code processing.  Just toggle the
  2895. ; bit in for this
  2896. ;--
  2897.  
  2898. INP7BT:    MOV    TRM7BT,VALUE        ; Store the value
  2899.     MOV    #TRUE,R0        ; Get the bit to toggle
  2900.     XOR    R0,VALUE        ; Change it to the other way
  2901.     RTS    PC            ; Return to the caller
  2902.  
  2903.     .SBTTL    Terminal emulation -- Local echo
  2904.  
  2905. ;++
  2906. ; These routines will handle the local echo flag.  This determines
  2907. ;whether the terminal emulation will echo the characters from the
  2908. ;keyboard to the screen.
  2909. ;--
  2910.  
  2911.     .PSECT    $CODE$, RO, I
  2912.  
  2913. ;++
  2914. ; This routine will set the information in the dynamic menu.
  2915. ;--
  2916.  
  2917. DYNLCE:    CLR    R0            ; Assume that this is the first item
  2918.     BIT    #TRUE,LCLECH        ; Local echo on?
  2919.     BNE    10$            ; Branch if so
  2920.     INC    R0            ; No, use the second entry
  2921. 10$:    PJMP    DYNBLD            ; Bold the section on the screen
  2922.  
  2923. ;++
  2924. ; Input routine for the local echo processing.  Just toggle the
  2925. ; bit in for this.
  2926. ;--
  2927.  
  2928. INPLCE:    MOV    LCLECH,VALUE        ; Store the value
  2929.     MOV    #TRUE,R0        ; Get the bit to toggle
  2930.     XOR    R0,VALUE        ; Change it to the other way
  2931.     RTS    PC            ; Return to the caller
  2932.  
  2933.     .SBTTL    Terminal emulation -- Transparent function keys
  2934.  
  2935. ;++
  2936. ; This routine will set the terminal into transparent mode or not
  2937. ;--
  2938.  
  2939.     .PSECT    $CODE$, RO, I
  2940.  
  2941. ; Dynamic menu processing routine
  2942.  
  2943. DYNTRN:    CLR    R0            ; Assume that this is the first item
  2944.     BIT    #TRUE,TRMTRN        ; Transparent terminal emulation?
  2945.     BNE    10$            ; Branch if so
  2946.     INC    R0            ; No, use the second entry
  2947. 10$:    PJMP    DYNBLD            ; Bold the section on the screen
  2948.  
  2949. ; Input routine, just toggle the current value to the other valu
  2950.  
  2951. INPTRN:    MOV    TRMTRN,VALUE        ; Move the value into the right place
  2952.     MOV    #TRUE,R0        ; Toggle the value
  2953.     XOR    R0,VALUE        ; . . .
  2954.     RTS    PC            ; Return to the caller
  2955.  
  2956.     .SBTTL    SETLRS - Reset the current line characteristics from defaults
  2957.  
  2958. ;++
  2959. ; This routine will reset the current line characteristics from the defaults.
  2960. ;--
  2961.  
  2962.     .PSECT    $TEXT$, RO, D
  2963.  
  2964. MSG    LPR,<Line characteristics reset from defaults>
  2965.  
  2966.     .PSECT    $CODE$, RO, I
  2967.  
  2968. SETLRS:    BLSCAL    BL$MOV,<#CURXKL,#DEFXKP,#CURXKP>,+ ; Reset the current
  2969.                     ;  parameters to defaults
  2970.     BLSCAL    BL$MOV,<#LPR$L,#M$LPR,#MSG1>,- ; Inform user reset
  2971.     RTS    PC            ; Return to the caller
  2972.  
  2973.     .SBTTL    SETTRM - Set terminal emulation paramters
  2974.  
  2975. ;++
  2976. ; This routine will set the terminal emulation parameters
  2977. ;--
  2978.  
  2979.  
  2980. SETTRM:    BLSCAL    DOMENU,<#F$TCHR,#K$NORM,#FALSE> ; Set terminal emulation
  2981.     RTS    PC            ; Return to the caller
  2982.  
  2983.     .SBTTL    DOMENU - Display and process menus
  2984.  
  2985. ;++
  2986. ; This routine will display and process menus.
  2987. ;
  2988. ; Usage:
  2989. ;    BLCAL    DOMENU,<Frameblockaddress,Keydispatchblock>
  2990. ;--
  2991.  
  2992.     .PSECT    $CODE$, RO
  2993.  
  2994. BLSRTN    DOMENU,5,<FRMBLK,KEYBLK,RTNFLG>,<LPIDX>
  2995.     CLR    AOPFLG            ; Clear this
  2996. ;
  2997. ; First determine if we have to read the frame into the static frame
  2998. ; buffer.  If it is multi-choice we have already set it up.
  2999. ;
  3000. 1$:    CLR    BADINP            ; Clear the bad input flag
  3001.     MOV    FRMBLK(SP),R0        ; Get the address of the block
  3002. ;
  3003. ; Set up to call MFRAME to read the frame into the static buffer.
  3004. ; Move length and the id into the argument area.
  3005. ;
  3006.     MOVB    .FRILN(R0),MFRMLN    ; Store in the argument block
  3007.     BLSCAL    BL$MOV,<MFRMLN,.FRID(R0),#MFRMID> ; Move the frame id
  3008.     MOV    #A$MFRAM,R5        ; Point to the argument block
  3009.     CALL    MFRAME            ; Call the frame set up
  3010.     TST    STATUS            ; Did this work?
  3011.     BPL    10$            ; Yes, skip error processing
  3012. ;
  3013. ; Here if we encountered an error reading the frame into the static buffer
  3014. ;
  3015.     MOV    #M$FRER,R0        ; Point to the argument block
  3016.     JSR    PC,MERROR        ; Issue the erorr
  3017. ;
  3018. ; Here if we have gotten the frame read correctly into memory.  We must now
  3019. ; determine which type of routine to call DMENU, MENU, MMENU.
  3020. ;
  3021.  
  3022. 10$:    MOV    FRMBLK(SP),R0        ; Get the frame block address again
  3023.     CLR    ADDOPT            ; Clear the additional options flag
  3024.     BITB    #FT.ADDO,.FRTYPE(R0)    ; Need to display them
  3025.     BEQ    13$            ; Branch if no need
  3026.     COM    ADDOPT            ; Make this non-zero
  3027.  
  3028. 13$:    BITB    #FT.STATIC,.FRTYP(R0)    ; Is this a static menu?
  3029.     BEQ    20$            ; No, must be a dynamic menu
  3030. 15$:    MOV    #A$MENU,R5        ; Point to the argument block
  3031.     CALL    MENU            ; Process the static menu
  3032.     BR    100$            ; Join the common code again
  3033. ;
  3034. ; Here if we have to unpack, pack and then display the menu.
  3035. ;
  3036.  
  3037. 20$:    MOV    #UNPARG,R1        ; Point to the argument list
  3038.     MOV    (R1),A$MUNP+UN$AG1    ; Store the first argument
  3039.     MOV    (R1),A$DPAC+DP$AG1    ; Store the first argument
  3040.     MOV    UNPAGL(R1),A$MUNP+UN$AG2 ; Store the second argument
  3041.     MOV    UNPAGL(R1),A$DPAC+DP$AG2 ; Store the second argument
  3042.     MOV    R1,LPIDX(SP)        ; Save the information
  3043.     MOV    #A$MUNP,R5        ; Get the argument pointer
  3044.     CALL    MUNPK            ; Unpack the argument
  3045.     TST    STATUS            ; Did this work?
  3046.     BPL    40$            ; No, just issue an error
  3047. ;
  3048. ; Here to issue the error for unpacking the menu item
  3049. ;
  3050. 30$:    MOV    #M$UPER,R0        ; Issue an unpacking error
  3051.     JSR    PC,MERROR        ; Issue the erorr
  3052. ;
  3053. ; Here if we have unpacked the first entry correctly.  Now we must
  3054. ; pack the entry into the dynamic menu.  The first call to DPACK will
  3055. ; clear the dynamic menu buffer
  3056. ;
  3057. 40$:    MOV    #A$DPAC,R5        ; Get the argument block address
  3058.     CALL    DPACK            ; Pack the item
  3059.     TST    STATUS            ; Get a good return
  3060.     BPL    60$            ; Branch if we did
  3061. ;
  3062. ; Here to issue the error for the DPACK failure
  3063. ;
  3064. 50$:    MOV    #M$PKER,R0        ; Get the argument block for a failure
  3065.     JSR    PC,MERROR        ; Issue the error
  3066. ;
  3067. ; Here to loop for all of the other items after the first.
  3068. ;
  3069. 60$:    ADD    #2,LPIDX(SP)        ; Point to the next argument
  3070.     MOV    LPIDX(SP),R1        ; Get the loop index
  3071.     MOV    (R1),A$MUNP+UN$AG1    ; Store the first argument
  3072.     MOV    (R1),A$DPAK+DK$AG1    ; Store the first argument
  3073.     MOV    UNPAGL(R1),A$MUNP+UN$AG2 ; Store the second argument
  3074.     MOV    UNPAGL(R1),A$DPAK+DK$AG2 ; Store the second argument
  3075.     MOV    #A$MUNP,R5        ; Get the argument pointer
  3076.     CALL    MUNPK            ; Unpack the argument
  3077.     TST    STATUS            ; Did this work?
  3078.     BMI    30$            ; No, just issue an error
  3079.     MOV    #A$DPAK,R5        ; Cheat and use the same argument block
  3080.     CALL    DPACK            ; Pack the item into the menu
  3081.     TST    STATUS            ; Did we get an error?
  3082.     BMI    50$            ; Yes, issue an error message
  3083.     CMP    #UNPARG+UNPAGL-2,LPIDX(SP) ; At the end?
  3084.     BNE    60$            ; No, loop
  3085. ;
  3086. ; Now all of the header items have been unpacked and packed.  We now must
  3087. ; pack the selection items.
  3088. ;
  3089.     CLR    R0            ; Set pointer to first option ('01')
  3090. 70$:    MOV    NUMTAB(R0),R1        ; Get ascii for that option
  3091.     MOV    R1,KEYWNM        ;   and move to locations so that we
  3092.     MOV    R1,OPTNNM        ;   get keyword, option, action, and
  3093.     MOV    R1,ACTNNM        ;   option help for each available
  3094.     MOV    R1,OHLPNM        ;   option
  3095.     MOV    R0,LPIDX(SP)        ; Save the pointer to the option number
  3096.     MOV    #A$UNPO,R5        ; Set up unpacking call by putting buf.
  3097.     CALL    MUNPK            ;   location in R5 and unpack an option
  3098.     TST    STATUS            ; Check for error in call
  3099.     BMI    30$            ; Give the unpack error
  3100.     TST    BUFF1L            ; Check for an empty option, if we have
  3101.     BEQ    75$            ;   one we are done so exit
  3102.     MOV    FRMBLK(SP),R0        ; Get the frame block address
  3103.     MOV    .FRMLN(R0),R1        ; Get the menu block length
  3104.     MOV    .FRMNU(R0),R0        ; Get the menu block address
  3105.     JSR    PC,SETDYN        ; Call routine to fix each option
  3106. ;***CROCK TO GET AROUND P/OS BUG***
  3107.     TST    BUFF3L            ; Anything in the buffer
  3108.     BNE    74$            ; Skip this
  3109.     MOV    #1,BUFF3L        ; One character
  3110.     MOV    #"  ,BUFF3        ; Fill with spaces
  3111. 74$:
  3112. ;***END OF CROCK TO GET AROUND P/OS BUG***
  3113.     MOV    #A$PACO,R5        ; Set up call to pack dynamic buffer
  3114.     CALL    DPACK            ; Pack buffer
  3115.     TST    STATUS            ; Check for error in call
  3116.     BMI    50$            ; Give the pack error message
  3117.     MOV    LPIDX(SP),R0        ; Restore pointer to option
  3118.     TST    (R0)+            ; Increment the pointer
  3119.     CMP    R0,#11.*2        ; At the end?
  3120.     BNE    70$            ; If not maximum go on to next option
  3121. ;
  3122. ; Now to display the dynamic menu
  3123. ;
  3124. 75$:    MOV    #A$DMEN,R5        ; Get the argument block
  3125.     CALL    DMENU            ; Display the menu
  3126.  
  3127. ;
  3128. ; Here to handle the results of the menu that we just displayed.
  3129. ;
  3130. 100$:    JSR    PC,RSTMSG        ; Reset the message areas
  3131.     TST    STATUS            ; Did everything go ok?
  3132.     BPL    200$            ; Branch if ok so far
  3133. ;
  3134. ; Here if an error was encountered.  First check to see if it was a function
  3135. ; key that we can process
  3136. ;
  3137.     MOV    KEYBLK(SP),R0        ; Get the key block
  3138.     JSR    PC,CHKKEY        ; Check to see if it is a valid key
  3139.     TST    R0            ; Did we get a routine address?
  3140.     BNE    120$            ; Branch if we did
  3141.     BLSCAL    BL$MOV,<#BADK$L,#M$BADK,#MSG1> ; Move the bad function key text
  3142.     BR    300$            ; Try again    
  3143. ;
  3144. ; Here if a function key that we can process was found.  Just branch to the
  3145. ; routine to handle the function key.
  3146. ;
  3147. 120$:    MOV    @R0,R0            ; Get the address of the routine
  3148.     JMP    @R0            ; Jump to the routine
  3149.  
  3150. ;
  3151. ; Here to handle the action processing for the item selected
  3152. ;
  3153. 200$:    MOV    FRMBLK(SP),R3        ; Get the frame block
  3154.     MOV    .FRMNU(R3),R0        ; Get the menu dispatch
  3155.     MOV    .FRMLN(R3),R1        ; Get the block length
  3156.     ASR    R1            ; Make it number of entries
  3157.     MOV    ACTION,R2        ; Get the item to find
  3158.     JSR    PC,FNDOFS        ; Find the item
  3159.     TST    R0            ; Check for something we didn't
  3160.     BEQ    300$            ; Write yet
  3161.     ADD    .FRMLN(R3),R0        ; Point to the action routine
  3162.     MOV    R0,-(SP)        ; Save on the stack
  3163. ;
  3164. ; Point to the input routine if there is one and call it
  3165. ;
  3166.     ADD    .FRMLN(R3),R0        ; Point to the input routine
  3167.     TST    (R0)            ; Have a routine to call
  3168.     BEQ    210$            ; No, skip this then
  3169.     MOV    @R0,R0            ; Get the address of the routine
  3170.     JSR    PC,@R0            ; Call the routine
  3171. ;
  3172. ; Here to call the set routine
  3173. ;
  3174. 210$:    MOV    (SP)+,R0        ; Get the routine address from the
  3175.                     ;  stack
  3176.     TST    BADINP            ; Bad input?
  3177.     BNE    220$            ; Valid input?
  3178.     MOV    @R0,R0            ; Get the address of the routine
  3179.  
  3180.     MOV    FRMBLK(SP),R1        ; Get the frame block address
  3181.     BITB    #FT.STORE,.FRTYP(R1)    ; Store directly and not call action
  3182.                     ;  routine?
  3183.     BEQ    215$            ; Call action routine
  3184.     MOV    VALUE,@R0        ; Store the value
  3185.     BR    220$            ; Continue processing
  3186.  
  3187. 215$:    JSR    PC,@R0            ; Call the action routine
  3188. 220$:    CMP    RTNFLG(SP),#TRUE    ; Must we return after one pass?
  3189.     BEQ    399$            ; Yes, just return right away
  3190. ;
  3191. ; Here to redisplay the menu that we are processing.
  3192. ;
  3193. 300$:    TST    MAIFLG            ; Return to the main screen?
  3194.     BNE    399$            ; Yes, just exit
  3195.     JMP    1$            ; Yes, redisplay it
  3196.  
  3197. 399$:    RTS    PC            ; Return to the caller
  3198.  
  3199.     .SBTTL    CHKKEY - Check to see if a function key was pressed
  3200.  
  3201. ;+
  3202. ; This routine will determine if a function key was pressed.  If it was
  3203. ; a function key then we will determine if the key is valid at this
  3204. ; point.  It it is not a failure return will be passed back otherwise
  3205. ; the address from the key table will be passed back to the caller.
  3206. ;
  3207. ; Usage:
  3208. ;    MOV    #Key.table,R0
  3209. ;    JSR    PC,CHKKEY
  3210. ;    (Return)
  3211. ;
  3212. ; On return:
  3213. ;    R0/ 0 - If not in the key table
  3214. ;    R0/ Address of routine to jump to if in the table.
  3215. ;
  3216. ;--
  3217.  
  3218. CHKKEY:    CMP    #ST.KEY,STATUS        ; Was this a function key?
  3219.     BEQ    10$            ; Yes, find it in the table
  3220. 5$:    CLR    R0            ; No, return a zero
  3221.     RTS    PC            ; Return to the caller
  3222.  
  3223. ;
  3224. ; Here if we have a possible function key.  STATUS+2 contains the function
  3225. ; key code.
  3226. ;
  3227. 10$:    MOV    R0,R1            ; Copy the address
  3228.     MOV    (R0)+,R1        ; Get the table length
  3229.     MOV    R1,-(SP)        ; Save for later
  3230.     MOV    STATUS+2,R2        ; Get the key code
  3231.     JSR    PC,FNDOFS        ; Find it in the table
  3232.     TST    R0            ; Did we find it in the table?
  3233.     BNE    20$            ; Branch if we found it
  3234.     TST    (SP)+            ; Remove the length
  3235.     BR    5$            ; Return a failure
  3236. ;
  3237. ; Here if we found the function key in the table.  Just add the length of
  3238. ; the table to the item and return to the caller
  3239. ;
  3240. 20$:    ADD    (SP),R0            ; Point to the routine address
  3241.     ADD    (SP)+,R0        ; . . .
  3242.     RTS    PC            ; Return to the caller
  3243.  
  3244.     .SBTTL    SETDYN - Routine to set the dynamic menu option
  3245.  
  3246. ;++
  3247. ; This routine will be called after the dynamic option has been read into
  3248. ; the buffer.  This routine will then be called to dispatch to the correct
  3249. ; dynamic menu option.  The routine will expect that DMNUAD will contain
  3250. ; the address of a menu table and that DMNULN will contain the length of the
  3251. ; menu table.  The routine will store the address of the offset into DMNUOF.
  3252. ;
  3253. ; Usage:
  3254. ;    R0/    Address of the menu table
  3255. ;    R1/    Length of the menu table in bytes
  3256. ;    JSR    PC,SETDYN
  3257. ;    (Return - Menu packed)
  3258. ;
  3259. ;--
  3260.  
  3261.     .PSECT    $CODE$,    RO
  3262.  
  3263. SETDYN:    MOV    R1,-(SP)        ; Save the length on the stack
  3264.     BEQ    10$            ; If the length is zero just return
  3265.     ASR    R1            ; Make it the number of entries
  3266.     MOV    MUNPBF,R2        ; Get the dynamic option
  3267.     JSR    PC,FNDOFS        ; Find the offset into the table
  3268.     TST    R0            ; Find it?
  3269.     BEQ    10$            ; No, error
  3270.     ADD    (SP),R0            ; Point to the SET routine
  3271.     ADD    (SP),R0            ; Point to the input routine
  3272.     ADD    (SP)+,R0        ; Point to the DYN routine
  3273.     MOV    @R0,R0            ; Get the address
  3274.     BEQ    5$            ; Branch if no routine
  3275.     JSR    PC,@R0            ; Call the routine
  3276. 5$:    RTS    PC            ; Return to the caller
  3277.  
  3278. ; Here if there was an error unpacking the dynamic menu option
  3279.  
  3280. 10$:    TST    (SP)+            ; Remove the information from the stack
  3281.     RTS    PC            ; Return to the caller for now
  3282.  
  3283.     .SBTTL    Dynamic menu processing - Make a string bold
  3284.  
  3285. ;++
  3286. ; This routine will cause a string to be bolded.
  3287. ;
  3288. ; Usage:
  3289. ;    MOV    #Number,R0        ; Offset to be bolded
  3290. ;    JSR    PC,DYNBLD        ; Bold it
  3291. ;
  3292. ; Number := 0 for first string, 1 for second
  3293. ;--
  3294.  
  3295. DYNBLD:    TST    R0            ; Is this the first or second?
  3296.     BNE    10$            ; Branch if the second
  3297.     MOV    #BVID$L,R0        ; Get the length
  3298.     MOV    #M$BVID,R1        ; Get the address of the text
  3299.     JSR    PC,DYNINS        ; Insert the string
  3300.     MOV    #NVID$L,R0        ; Back to normal video
  3301.     MOV    #M$NVID,R1        ; Normal video now
  3302.     JSR    PC,DYNINS        ; Insert it
  3303.     JSR    PC,DYNDEL        ; Delete the string
  3304.     BR    DYNDEL            ; Delete the last string
  3305. ;
  3306. ; Bold the second string
  3307. ;
  3308. 10$:    JSR    PC,DYNDEL        ; Delete the string
  3309.     JSR    PC,DYNDEL        ; Delete the string
  3310.     MOV    #BVID$L,R0        ; Get the length
  3311.     MOV    #M$BVID,R1        ; Get the address of the text
  3312.     JSR    PC,DYNINS        ; Insert the string
  3313.     MOV    #NVID$L,R0        ; Back to normal video
  3314.     MOV    #M$NVID,R1        ; Normal video now
  3315.     BR    DYNINS            ; Insert it
  3316.  
  3317.     .SBTTL    Dynamic menu processing - Store a character and octal number
  3318.  
  3319. ;++
  3320. ; This routine will convert and store the character and the octal number
  3321. ; that is the character.  This routine will use the DYNCHR and the DYNOCT
  3322. ; routines to do all of the work.
  3323. ;
  3324. ; Usage:
  3325. ;    MOV    #Character,R0
  3326. ;    JSR    PC,DYNCOC
  3327. ;    (Return)
  3328. ;--
  3329.  
  3330. DYNCOC:    MOV    R0,-(SP)        ; Save the character on the stack
  3331.     JSR    PC,DYNCHR        ; Store the character in the menu
  3332.     MOV    (SP)+,R0        ; Get the character code back
  3333.     BR    DYNOCT            ; Store the octal of the character
  3334.  
  3335.     .SBTTL    Dynamic menu processing - Store a special character
  3336.  
  3337. ;++
  3338. ; This routine will convert the octal number to a printable character.
  3339. ; It will convert control characters to ^<char>, deletes to 'del' and
  3340. ; spaces to 'sp'.
  3341. ;
  3342. ; Usage:
  3343. ;    MOV    #Char,R0        ; Get the character code
  3344. ;    JSR    PC,DYNCHR
  3345. ;    (Return)
  3346. ;
  3347. ; On return:
  3348. ;  - String inserted into the menu
  3349. ;
  3350. ;--
  3351.  
  3352.     .PSECT    $PLIT$, RO, D
  3353.  
  3354. MSG    DEL,<del>
  3355. MSG    SPC,<spc>
  3356.  
  3357.     .PSECT    $CODE$, RO, I
  3358.  
  3359. DYNCHR:    CMP    R0,#.CHDEL        ; Is this a delete?
  3360.     BNE    10$            ; Branch if not a delete
  3361. ;
  3362. ; Here if we are processing a delete
  3363. ;
  3364.     MOV    #DEL$L,R0        ; Get the length
  3365.     MOV    #M$DEL,R1        ; Get the address
  3366.     BR    99$            ; Store the text and exit
  3367. ;
  3368. ; Here if we have something other than a delete
  3369. ;
  3370. 10$:    CMP    R0,#.CHSPC        ; Is this a space?
  3371.     BGT    30$            ; Branch if just a printable character
  3372.     BEQ    20$            ; Branch if a space
  3373. ;
  3374. ; Here if we have a control character
  3375. ;
  3376.     MOVB    #'^,IOBUFF        ; Store an "^"
  3377.     ADD    #'A-1,R0        ; Convert to a printable character
  3378.     MOVB    R0,IOBUFF+1        ; Store the character
  3379.     MOV    #2,R0            ; Get the length
  3380.     BR    98$            ; Get the address of the buffer and
  3381.                     ;  store and exit
  3382. ;
  3383. ; Here if we have a space
  3384. ;
  3385. 20$:    MOV    #SPC$L,R0        ; Get the length
  3386.     MOV    #M$SPC,R1        ; And the text
  3387.     BR    99$            ; Common exit
  3388. ;
  3389. ; Here if we have just a printable character
  3390. ;
  3391. 30$:    MOVB    R0,IOBUFF        ; Store the character
  3392.     MOV    #1,R0            ; Get the length
  3393. 98$:    MOV    #IOBUFF,R1        ; And the buffer address
  3394. 99$:    PJMP    DYNINS            ; Insert the text
  3395.  
  3396.     .SBTTL    Dynamic menu processing - Store an octal number
  3397.  
  3398. ;++
  3399. ; This routine will store an octal number into the dynamic menu.
  3400. ;
  3401. ; Usage:
  3402. ;    MOV    Number,R0
  3403. ;    JSR    PC,DYNOCT
  3404. ;
  3405. ;--
  3406.  
  3407. DYNOCT:    MOV    R0,-(SP)        ; Save on the stack
  3408.     JSR    PC,ALTBUF        ; Set up the alternate routine
  3409.     MOV    (SP)+,R2        ; Get the number back
  3410.     JSR    PC,CHGOCT        ; Output the number
  3411.     BLSCAL    TT.OUTPUT        ; Dump the buffer
  3412.     MOV    IOBLEN,R0        ; Get the length
  3413.     MOV    #IOBUFF,R1        ; Point to the information
  3414.     JSR    PC,DYNINS        ; Insert it
  3415.     PJMP    ALTRST            ; Restore the output routine
  3416.  
  3417.     .SBTTL    Dynamic menu processing - Store a decimal number
  3418.  
  3419. ;++
  3420. ; This routine will store a decimal number into the dynamic menu.
  3421. ;
  3422. ; Usage:
  3423. ;    MOV    Number,R0
  3424. ;    JSR    PC,DYNDEC
  3425. ;
  3426. ;--
  3427.  
  3428. DYNDEC:    MOV    R0,-(SP)        ; Save on the stack
  3429.     JSR    PC,ALTBUF        ; Set up the alternate routine
  3430.     MOV    (SP)+,R2        ; Get the number back
  3431.     JSR    PC,CHGDEC        ; Output the number
  3432.     BLSCAL    TT.OUTPUT        ; Dump the buffer
  3433.     MOV    IOBLEN,R0        ; Get the length
  3434.     MOV    #IOBUFF,R1        ; Point to the information
  3435.     JSR    PC,DYNINS        ; Insert it
  3436.     PJMP    ALTRST            ; Restore the output routine
  3437.  
  3438.     .SBTTL    Dynamic menu processing - Delete underscore string
  3439.  
  3440. ;++
  3441. ; This routine will eat an underscore string.
  3442. ;
  3443. ; Usage:
  3444. ;    JSR    PC,DYNDEL
  3445. ;    (Return)
  3446. ;
  3447. ;--
  3448.  
  3449. DYNDEL:    JSR    R1,$SAVE3        ; Save a few registers
  3450.     MOV    #BUFF1,R1        ; Address of the string
  3451.     MOV    BUFF1L,R2        ; Length of the string
  3452.  
  3453. 10$:    CMPB    (R1)+,#'_        ; Is this the character?
  3454.     BEQ    20$            ; Branch if so
  3455.     SOB    R2,10$            ; Loop for all characters
  3456.     RTS    PC            ; Not found, just return
  3457. ;
  3458. ; Here if we have to just move over the characters
  3459. ;
  3460. 20$:    MOV    R1,R3            ; Copy the address of the start
  3461.     DEC    R3            ; Decrement this
  3462. 30$:    DEC    BUFF1L            ; Decrement the count
  3463.     CMPB    (R1)+,#'_        ; Is this still the underscore?
  3464.     BNE    40$            ; No, move the rest of the buffer
  3465.     SOB    R2,30$            ; Loop for all characters
  3466.     RTS    PC            ; Just return if nothing left
  3467. ;
  3468. ; Here to copy the rest of the string
  3469. ;
  3470. 40$:    DEC    R1            ; Back up the byte
  3471. 50$:    MOVB    (R1)+,(R3)+        ; Move the byte
  3472.     SOB    R2,50$            ; Loop for all characters
  3473.     RTS    PC            ; Return to the caller
  3474.  
  3475.     .SBTTL    Dynamic menu processing - Find and insert string
  3476.  
  3477. ;++
  3478. ; This routine will find and insert the string into the menu buffer.
  3479. ;
  3480. ; Usage:
  3481. ;    MOV    #Address of table,R0
  3482. ;    MOV    #Length of table,R1
  3483. ;    MOV    #Item to find and insert string of,R2
  3484. ;    JSR    PC,DYNFIS
  3485. ;    (Return)
  3486. ;
  3487. ;--
  3488.  
  3489. DYNFIS:    MOV    R1,-(SP)        ; Save the length
  3490.     ASR    R1            ; Make it the number of words
  3491.     JSR    PC,FNDOFS        ; Find the item
  3492.     TST    R0            ; Find it?
  3493.     BNE    10$            ; Yes, handle it
  3494.     TST    (SP)+            ; Remove the item from the stack
  3495.     RTS    PC            ; Return to the caller
  3496. ;
  3497. ; Here if we found the item in the table.
  3498. ;
  3499. 10$:    ADD    (SP)+,R0        ; Point to the address of the counted
  3500.                     ;  text
  3501.     MOV    (R0),R1            ; Get the address of the string-1
  3502.     MOVB    (R1)+,R0        ; Get the count of characters
  3503.     BNE    DYNINS            ; Insert the string
  3504.     RTS    PC            ; Return to the caller
  3505.  
  3506.     .SBTTL    Dynamic menu processing - Insert string
  3507.  
  3508. ;++
  3509. ; This routine will insert the given string into the menu buffer.
  3510. ; The first underline string will be replaced.
  3511. ;
  3512. ; Usage:
  3513. ;    MOV    #Length,R0
  3514. ;    MOV    #String,R1
  3515. ;    JSR    PC,DYNINS
  3516. ;    (Return)
  3517. ;--
  3518.  
  3519. DYNINS:    JSR    R1,$SAVE3        ; Save R2 and R3
  3520.     MOV    #BUFF1,R2        ; Point to the buffer
  3521.     MOV    BUFF1L,R3        ; Length of the buffer
  3522. ;
  3523. ; First determine where the string starts
  3524. ;
  3525. 10$:    CMPB    (R2)+,#'_        ; Is this the start of the
  3526.                     ;  string?
  3527.     BEQ    20$            ; Branch if it is
  3528.     SOB    R3,10$            ; Loop for all of the characters
  3529.     RTS    PC            ; Return if none
  3530. ;
  3531. ; Here if we have found the first of the underline characters
  3532. ;
  3533. 20$:    DEC    R2            ; Back up the pointer
  3534. 25$:    MOVB    (R1)+,(R2)+        ; Move the character
  3535.     DEC    R3            ; Decrement the total characters
  3536.     BEQ    99$            ; Return if nothing else
  3537.     DEC    R0            ; Decrement the characters
  3538.     BEQ    30$            ; Branch if we are finished
  3539.     CMPB    (R2),#'_        ; Is this still characters to be replaced?
  3540.     BEQ    25$            ; Yes, continue to loop
  3541.     RTS    PC            ; Return if finished replacing
  3542. ;
  3543. ; Here to determine if the two strings are exactly the same length
  3544. ; and if not just fill with spaces.
  3545. ;
  3546. 30$:    CMPB    (R2),#'_        ; Is this still character to be eaten?
  3547.     BNE    99$            ; No, just return
  3548.  
  3549.     MOV    R2,R1            ; Get a copy of the pointer
  3550. 40$:    CMPB    (R2)+,#'_        ; Underscore?
  3551.     BNE    45$            ; No, copy this and the rest
  3552.     DEC    BUFF1L            ; Yes, decrement the length
  3553.     SOB    R3,40$            ; And loop until end of string or underscores
  3554.     RTS    PC            ; Underscores were at end, just return
  3555.  
  3556. 45$:    DEC    R2            ; Back up so we get this character
  3557.  
  3558. 50$:    MOVB    (R2)+,(R1)+        ; Remove the underscore
  3559.     SOB    R3,50$            ; Loop for the remainder of the record
  3560. 99$:    RTS    PC            ; Return to the caller
  3561.  
  3562.     .SBTTL    Support routines -- GETINP - Get input for SET commands
  3563.  
  3564. ;++
  3565. ; THis routine will get input from the terminal for the various set commands.
  3566. ; The input can be either a character or a string of digits.  This routine
  3567. ; is called with a numeric/character flag, prompt string, radix if numeric
  3568. ; and a validation routine.
  3569. ;
  3570. ; Usage:
  3571. ;    BLSCAL    GETINP,<#Character.flag,#Prompt,#Radix,#Checkout.rtn>
  3572. ;
  3573. ; On return:
  3574. ;    R1/ Value input
  3575. ;--
  3576.  
  3577. BLSRTN    GETINP,5,<CHRFLG,PROMPT,RADIX,CHKOUT>
  3578.     JSR    PC,SETESC        ; Allow escape sequences
  3579. 10$:    MOV    #IOBUFF,R0        ; Point to the buffer
  3580.     CLR    (R0)+            ; Clear some of it
  3581.     CLR    (R0)            ; . . .
  3582.     TST    -(R0)            ; Reset to start of buffer
  3583.     BLSCAL    TT.TEXT,#M$PPRM,+    ; Position for the prompt
  3584.     MOV    PROMPT+..STKO+2(SP),R0    ; Get the prompt
  3585.     BLSCAL    TT.TEXT,R0,+        ; Output the prompt
  3586.     BLSCAL    TT.OUTPUT,,-        ; Output the text and reset the stack
  3587.  
  3588.     TST    CHRFLG+2(SP)        ; Character input?
  3589. .IF EQ TRUE
  3590.     BEQ    50$            ; Yes, branch
  3591. .IFF
  3592.     BNE    50$            ; . . .
  3593. .ENDC
  3594. ;
  3595. ; Here if we are inputting a character string
  3596. ;
  3597.     DIR$    #READ,IOERR        ; Get input
  3598.     MOV    #IOBUFF,R1        ; Get the buffer location
  3599.  
  3600. 20$:    MOVB    (R1)+,R0        ; Get a character
  3601.     BEQ    30$            ; Branch if done
  3602.     CMPB    #.CHESC,R0        ; Is this an escape?
  3603.     BNE    20$            ; No, continue
  3604.     CLRB    -(R1)            ; Clear the byte
  3605.     TSTB    (R1)+            ; Point back to the end
  3606.  
  3607. ; Here if we are done reading the character string
  3608.  
  3609. 30$:    DEC    R1            ; Since we passed the last input 
  3610.                     ;   character back up one so we 
  3611.                     ;   can check length
  3612.     SUB    #IOBUFF+3,R1        ; Subtract off the buffer start address
  3613.                     ;   and subtract three(maximum 
  3614.                     ;   number of digits)
  3615.     BGT    60$            ; If it is non-negative the input was
  3616.                     ;   too long so branch to error routine
  3617.     MOV    #IOBUFF,R2        ; Get the I/O buffer address
  3618.     MOV    RADIX+2(SP),R5        ; Get the radix
  3619.     JSR    PC,BASCHK        ; Check for illegal characters
  3620.     BCS    60$            ; If bad characters the jump to bad
  3621.     MOV    #IOBUFF,R2        ; Get the I/O buffer address
  3622.     JSR    PC,ASCBIN        ; Convert the ascii to binary
  3623.     MOV    R1,R0            ; Get the result
  3624. ;
  3625. ; Now to validity check the input from the user
  3626. ;
  3627.     MOV    CHKOUT+2(SP),R1        ; Get the routine to call
  3628.     BEQ    40$            ; Branch if there is no routine
  3629.     JSR    PC,@R1            ; Call the routine
  3630.     BCS    70$            ; Branch if there was an error
  3631. ;
  3632. ; Here if there was no error, just return to the caller
  3633. ;
  3634. 40$:    RTS    PC            ; Return to sender
  3635.  
  3636. 50$:    DIR$    #READ1,IOERR        ; Get input (read single character, 
  3637.                     ;   pass all)
  3638.     MOVB    IOBUFF,R0        ; Get the character
  3639.     BR    40$            ; Jump to return routine
  3640.  
  3641. 60$:    MOV    #M$BADI,R1        ; Get the error text
  3642. ;
  3643. ; Here to issue an error message
  3644. ;
  3645. 70$:    BLSCAL    TT.TEXT,#M$PPRM,+    ; Position for the prompt
  3646.     BLSCAL    TT.TEXT,R1,+        ; Output the error message
  3647.     BLSCAL    TT.OUTPUT,,-        ; Output remaining characters.
  3648.     CALL    WTRES            ; Wait for resume key
  3649.     BR    10$            ; Reprompt for input
  3650.  
  3651.     .SBTTL    Support routines -- Validity checks for input
  3652.  
  3653. ;++
  3654. ; The following routines are validity checks for the GETINP routine.
  3655. ; This routines are specified as the argument (CHKOUT) to the routine.
  3656. ;
  3657. ; Usage:
  3658. ;    JSR    PC,CHKxxx
  3659. ;    (Return)
  3660. ;
  3661. ; On return:
  3662. ;    If carry set ==> R0 contains the value
  3663. ;    If carry clear ==> R1 contains the address of the error text
  3664. ;
  3665. ;--
  3666.  
  3667.     .PSECT    $TEXT$, RO, D
  3668.  
  3669. MSG    QERR,<Value must be 41 to 76 or 140 to 176>
  3670.  
  3671.     .PSECT    $CODE$, RO, I
  3672.  
  3673. CHKQUO:    CMP    R0,#41            ; Compare against the lower bound
  3674.     BLT    10$            ; Branch if less than that
  3675.     CMP    R0,#76            ; Compare against the first upper
  3676.     BLE    20$            ; Value ok, return to caller
  3677.     CMP    R0,#140            ; Compare against the other lower bound
  3678.     BLT    10$            ; Bad value
  3679.     CMP    R0,#176            ; And the other upper value
  3680.     BLE    20$            ; Value ok
  3681. ;
  3682. ; Here if the value is not valid
  3683. ;
  3684. 10$:    MOV    #M$QERR,R1        ; Get the error text
  3685.     SEC                ; Set the carry
  3686.     RTS    PC            ; Return to the caller
  3687. ;
  3688. ; Here if the value is valid
  3689. ;
  3690. 20$:    CLC                ; Clear the carry
  3691.     RTS    PC            ; Return to the caller
  3692.  
  3693.     .SBTTL    CHKxxx - CHKCTL - Check to see if a control character
  3694.  
  3695. ;++
  3696. ; This routine will determine if the value is a control character.  If the
  3697. ; value is not then an error return will be given (carry bit set and the
  3698. ; address of the error text in R1).
  3699. ;--
  3700.  
  3701.     .PSECT    $TEXT$, RO, D
  3702.  
  3703. MSG    CERR,<Value must be 0 to 37>
  3704.  
  3705.     .PSECT    $CODE$, RO, I
  3706.  
  3707. CHKCTL:    CMP    R0,#37            ; Is this a control character?
  3708.     BGT    10$            ; Invalid
  3709.     CLC                ; Clear the carry
  3710.     RTS    PC            ; Return to the caller
  3711.  
  3712. 10$:    MOV    #M$CERR,R1        ; Get the error message
  3713.     SEC                ; Flag it is an error
  3714.     RTS    PC            ; Return to the caller
  3715.  
  3716.     .SBTTL    CHKxxx - CHKTIM - Check the timeout value
  3717.  
  3718. ;++
  3719. ; This routine will check the timeout value that the user has given.
  3720. ; If the value is not within the range of 1 to 94 an error return will
  3721. ; be given by this routine (carry bit set and error text address in R1).
  3722. ;--
  3723.  
  3724.     .PSECT    $TEXT$, RO, D
  3725.  
  3726. MSG    TERR,<Timeout must be between 1 and 94>
  3727.  
  3728.     .PSECT    $CODE$, RO, I
  3729.  
  3730. CHKTIM:    CMP    R0,#1            ; Is this within the range?
  3731.     BLT    10$            ; of 1 to
  3732.     CMP    R0,#94.            ;  94?
  3733.     BGT    10$            ; No, error
  3734.     CLC                ; Clear the carry
  3735.     RTS    PC            ; Return to the caller
  3736. ;
  3737. ; Here with an illegal value
  3738. ;
  3739. 10$:    MOV    #M$TERR,R1        ; Get the error text
  3740.     SEC                ; Set the carry
  3741.     RTS    PC            ; Return to the caller
  3742.  
  3743.     .SBTTL    CHKxxx - CHKPKL - Check for a valid packet length
  3744.  
  3745. ;++
  3746. ; This routine will check to determine if there is a valid packet length
  3747. ; in R0.  If the packet length is zero it will return with the carry bit
  3748. ; set and the address of the error text in R1.
  3749. ;--
  3750.  
  3751.     .PSECT    $TEXT$, RO, D
  3752.  
  3753. MSG    PERR,<Packet length must be from 10 to 94 (dec)>
  3754.  
  3755.     .PSECT    $CODE$, RO, I
  3756.  
  3757. CHKPKL:    CMP    R0,#10.            ; Is this within the range of
  3758.     BLT    10$            ;  10 to
  3759.     CMP    R0,#94.            ;    94?
  3760.     BGT    10$            ; Branch if not
  3761.     CLC                ; Clear the carry
  3762.     RTS    PC            ; Return to the caller
  3763. ;
  3764. ; Here if we have an invalid error, return the address of the error
  3765. ; text.
  3766. ;
  3767. 10$:    MOV    #M$PERR,R1        ; Get the error text
  3768.     SEC                ; Set the carry
  3769.     RTS    PC            ; Return to the caller
  3770.  
  3771.     .SBTTL    CHKxxx - CHKPDC - Check padding character
  3772.  
  3773. ;++
  3774. ; This routine will validate the padding character to determine if it is
  3775. ; a valid value.  If it is not, then it will set the carry bit and return
  3776. ; the text of the error message.  Valid values are 0 to 37 or 177.
  3777. ;--
  3778.  
  3779.     .PSECT    $TEXT$, RO, D
  3780.  
  3781. MSG    PCER,<Illegal pad character value, must be 0 to 37 or 177>
  3782.  
  3783.     .PSECT    $CODE$, RO, I
  3784.  
  3785. CHKPDC:    CMP    R0,.CHDEL        ; Is this the value
  3786.     BEQ    10$            ; If so, just return
  3787.     CMP    R0,#37            ; Is this a control character?
  3788.     BGT    20$            ; Branch if illegal
  3789. 10$:    CLC                ; Clear the carry
  3790.     RTS    PC            ; Return to the caller
  3791. ;
  3792. ; Here to return the failure
  3793. ;
  3794. 20$:    MOV    #M$PCER,R1        ; Get the error text
  3795.     SEC                ; Set the carry
  3796.     RTS    PC            ; Return to the caller
  3797.  
  3798.     .SBTTL    DOSPWN - Spawn a task 
  3799.  
  3800. ;++
  3801. ; This routine will spawn a task and return to the caller when the task
  3802. ; has completed.  It will wait until the task is finished.
  3803. ;
  3804. ; Usage:
  3805. ;    R0 - Address of the task name
  3806. ;    JSR    PC,DOSPWN
  3807. ;    (Return)
  3808. ;
  3809. ;--
  3810.  
  3811.     .PSECT    $TEXT$, RO, D
  3812.  
  3813. MSG    SPWN,<Error spawning task>
  3814.  
  3815.     .PSECT    $CODE$, RO, I
  3816.  
  3817. DOSPWN:    SPWN$S    R0,,,,,#SPNEFN        ; Spawn the task
  3818.     CMP    $DSW,#IS.SUC        ; Success?
  3819.     BEQ    10$            ; Branch if so
  3820.     BLSCAL    BL$MOV,<#SPWN$L,#M$SPWN,#MSG1>
  3821.     RTS    PC            ; Return to the caller
  3822. ;
  3823. ; Here to return to the caller
  3824. ;
  3825. 10$:    STSE$S    #SPNEFN,        ; Wait until it finishes
  3826.     RTS    PC            ; Return to the caller
  3827.  
  3828.     .SBTTL    Support routines -- RSTMSG - Reset MSG1 and MSG2 buffers
  3829.  
  3830.  
  3831. ;++
  3832. ; This routine will reset the MSG1 and MSG2 buffers to spaces.  This routine is
  3833. ; called after every time we process a menu.  It will reset the buffers to 
  3834. ; spaces after, so that error messages can be displayed on the screen after the
  3835. ; user attempts to do something.
  3836. ;
  3837. ; Usage:
  3838. ;
  3839. ;    JSR    PC,RSTMSG
  3840. ;    (Return)
  3841. ;
  3842. ;--
  3843.  
  3844.     .PSECT    $CODE$,    RO
  3845.  
  3846. RSTMSG:    MOV    #MSG1,R0        ; Get the first pointer
  3847.     MOV    #MSG2,R1        ; Point to the other
  3848.     MOV    #40.,R2            ; Number of times to loop
  3849.  
  3850. 10$:    MOV    #"  ,(R0)+        ; Store a two spaces
  3851.     MOV    #"  ,(R1)+        ; And another two
  3852.     SOB    R2,10$            ; Loop until done
  3853.     RTS    PC            ; Return to the caller
  3854.  
  3855.     .SBTTL    MERROR - Handle a menu error
  3856.  
  3857. ;++
  3858. ; This routine will handle a menu error.  It will call the P/OS routine
  3859. ; FATLER to do most of the work, but this routine will construct the text
  3860. ; that is to be output to the user.
  3861. ;
  3862. ; Usage:
  3863. ;    MOV    #Text,R0        ; Starting text to output
  3864. ;    JSR    PC,MERROR        ; Call the routine
  3865. ;    (No return)
  3866. ;
  3867. ;--
  3868.  
  3869.     .PSECT    $TEXT$, RO, D
  3870.  
  3871. MSG    MERT,< - Status = >
  3872. MSG    MER1,<, >
  3873.  
  3874.     .PSECT    $CODE$, RO, I
  3875.  
  3876. MERROR:    JSR    R1,$SAVE5        ; Save registers for debugging
  3877.     MOV    R0,R5            ; Save over the call
  3878. ;
  3879. ; Build the message
  3880. ;
  3881.     JSR    PC,ALTBUF        ; Alternate output point
  3882.     BLSCAL    TT.TEXT,<R5>,+        ; Output the text
  3883.     BLSCAL    TT.TEXT,<#M$MERT>,+    ; The rest of the text
  3884.     BLSCAL    TT.NUMB,<STATUS>,+    ; Output the first number
  3885.     BLSCAL    TT.TEXT,<#M$MER1>,+    ; More text to output
  3886.     BLSCAL    TT.NUMB,<STATUS+2>,+    ; Output the second word
  3887.     BLSCAL    TT.OUTPUT,,-        ; Output the text
  3888. ;
  3889. ; Output the message
  3890. ;
  3891.     MOV    #A$FATL,R5        ; Get the argument block
  3892.     JSR    PC,FATLER        ; Issue the error message
  3893.     HALT                ; Should not get here
  3894.  
  3895.     .SBTTL    End of KERMNU
  3896.  
  3897.     .END                ; End of KERMNU
  3898.  
  3899.