home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / asm / tbsource / shellterm / stv1.09.s < prev   
Text File  |  1993-12-21  |  57KB  |  2,854 lines

  1. *************************************************
  2. *                        *
  3. *         (C)opyright 1992        *
  4. *                        *
  5. *        by  Tomi Blinnikka        *
  6. *                        *
  7. *    Don´t try to understand the code    *
  8. *                        *
  9. * Version 0.01    28/05/1992            *
  10. *     -0.99ö                    *
  11. *                        *
  12. * Version 1.00    04/08/1992            *
  13. *                        *
  14. * BUGS: Lots! No phonebook.            *
  15. *                        *
  16. * Version 1.01    05/08/1992            *
  17. *                        *
  18. * BUGS: Some. Dialer problems.            *
  19. *                        *
  20. * Version 1.02    06/08/1992            *
  21. *                        *
  22. * BUGS: Less. Still dialer problems.        *
  23. *                        *
  24. * Version 1.03    08/08/1992            *
  25. *                        *
  26. * BUGS:                     *
  27. *                        *
  28. * Version 1.04    11/08/1992            *
  29. *                        *
  30. * Released                    *
  31. *                        *
  32. * BUGS: Send CTRL-P didn't work            *
  33. *                        *
  34. * Version 1.05    15/08/1992            *
  35. *                        *
  36. * Version 1.06    28/08/1992            *
  37. *                        *
  38. * Added prefs file and swap BS & DEL        *
  39. * See docs for more info            *
  40. *                        *
  41. * Version 1.07    30/08/1992            *
  42. *                        *
  43. * Version 1.08    04/09/1992            *
  44. *                        *
  45. * Added cursor remap                *
  46. *                        *
  47. * Version 1.09    06/09/1992            *
  48. *                        *
  49. *************************************************
  50.  
  51.     INCLUDE    "JMPLibs.i"
  52.     INCLUDE    "exec/types.i"
  53.     INCLUDE    "exec/nodes.i"
  54.     INCLUDE    "exec/lists.i"
  55.     INCLUDE    "exec/ports.i"
  56.     INCLUDE    "exec/memory.i"
  57.     INCLUDE    "exec/devices.i"
  58.     INCLUDE    "exec/io.i"
  59.     INCLUDE    "exec/tasks.i"
  60.     INCLUDE    "libraries/dosextens.i"
  61.     INCLUDE    "libraries/dos.i"
  62.     INCLUDE    "devices/serial.i"
  63.  
  64.     INCLUDE    "XREF:2.0.xref"
  65.     INCLUDE    "XREF:exec.xref"
  66.     INCLUDE    "XREF:dos.xref"
  67.  
  68.  
  69. CTRL_B:        EQU    2
  70. CTRL_F:        EQU    6
  71. BS:        EQU    8
  72. TAB:        EQU    9
  73. LF:        EQU    10
  74. CR:        EQU    13
  75. CTRL_N:        EQU    $E
  76. CTRL_O:        EQU    $F
  77. CTRL_P:        EQU    $10
  78. DEL:        EQU    127
  79. CSI:        EQU    $9B
  80. Cursor_Up:    EQU    'A'
  81. Cursor_Down:    EQU    'B'
  82. Cursor_Left:    EQU    'D'
  83. Cursor_Right:    EQU    'C'
  84.  
  85. MENU_KEY:    EQU    CTRL_P
  86. STATS_KEY:    EQU    CTRL_O
  87.  
  88. FALSE:        EQU    0
  89. TRUE:        EQU    1
  90.  
  91. BUFLEN:        EQU    1024
  92. ENTRYLENGTH:    EQU    20
  93.  
  94.         section    ST,CODE
  95.  
  96.         push    d2-d7/a2-a6
  97.         push    d0/a0
  98.  
  99.         openlib    Dos,NoDos        ;Keep at beginning
  100.  
  101. CLIStart:    lib    Dos,Output
  102.         move.l    d0,_stdout
  103.         lib    Dos,Input
  104.         move.l    d0,_stdin
  105.         move.l    d0,d1
  106.         lib    Dos,IsInteractive
  107.         tst.l    d0
  108.         beq    NotInteractive
  109.         pull    d0/a0
  110.         clr.b    -1(a0,d0.l)
  111.         cmp.b    #'?',(a0)
  112.         beq    Usage
  113.         cmp.w    #'-?',(a0)
  114.         beq    Usage
  115.         cmp.w    #'-h',(a0)
  116.         beq    Usage
  117.  
  118.         tst.b    (a0)
  119.         beq    Cont1.3
  120. Cont1:        lea.l    FileNameBuf1,a1
  121.         move.l    a1,a2
  122.         add.l    #128,a2
  123. Cont1.1:    tst.b    (a0)
  124.         beq    Cont1.2
  125.         cmp.b    #' ',(a0)
  126.         beq    Cont1.2
  127.         cmp.b    #TAB,(a0)
  128.         beq    Cont1.2
  129.         cmp.b    #LF,(a0)
  130.         beq    Cont1.2
  131.         cmp.b    #CR,(a0)
  132.         beq    Cont1.2
  133.         move.b    (a0)+,(a1)+
  134.         cmp.l    a1,a2
  135.         bne    Cont1.1
  136. Cont1.2:    clr.b    (a1)
  137. Cont1.3:
  138.  
  139. ;Create read reply port for serial.device (or modem0.device etc.)
  140.  
  141. MainStart:    openlib    Utility,NoUtility        ;Keep at beginning
  142.         lib    Exec,CreateMsgPort
  143.         move.l    d0,SRRPort
  144.         beq    NoMsgPort
  145.  
  146. ;Create read IOReq for serial.device (or for other device, but size is EXTSER)
  147.  
  148.         move.l    #IOEXTSER_SIZE,d0
  149.         move.l    SRRPort,a0
  150.         lib    Exec,CreateIORequest
  151.         move.l    d0,IORRequest
  152.         beq    NoIOReq
  153.  
  154.         move.l    IORRequest,a1
  155.         move.w    #CMD_READ,IO_COMMAND(a1)
  156.         or.b    #IOF_QUICK,IO_FLAGS(a1)
  157.         lea.l    Buffer3,a0
  158.         move.l    a0,IO_DATA(a1)
  159.         move.l    #1,IO_LENGTH(a1)
  160.  
  161. ;Create write reply port for serial.device (or modem0.device etc.)
  162.  
  163.         lib    Exec,CreateMsgPort
  164.         move.l    d0,SWRPort
  165.         beq    NoMsgPort
  166.  
  167. ;Create write IOReq for serial.device (or for other device, but size is EXTSER)
  168.  
  169.         move.l    #IOEXTSER_SIZE,d0
  170.         move.l    SWRPort,a0
  171.         lib    Exec,CreateIORequest
  172.         move.l    d0,IOWRequest
  173.         beq    NoIOReq
  174.  
  175.         bsr    LoadPrefsFile
  176.  
  177.         bsr    OpenSerial
  178.         tst.l    d0
  179.         bne    ShutDown
  180.  
  181.         lea.l    StartText1,a0
  182.         bsr    Printer
  183.  
  184. ;Change mode for CLI to RAW:
  185.  
  186.         move.l    _stdin,d1
  187.         move.l    #TRUE,d2
  188.         lib    Dos,SetMode
  189.  
  190. ;Flush extra text
  191.  
  192.         move.l    _stdin,d1
  193.         lib    Dos,Flush
  194.  
  195. Looper:        move.l    _stdin,d1
  196.         move.l    #5000,d2
  197.         lib    Dos,WaitForChar
  198.         tst.l    d0
  199.         beq    Looper1
  200.         move.l    _stdin,d1
  201.         lea.l    Buffer1,a0
  202.         move.l    a0,d2
  203.         move.l    #1,d3
  204.         lib    Dos,Read
  205.         cmp.b    #MENU_KEY,Buffer1
  206.         beq    Menu
  207.         move.b    CPAssign,d0
  208.         cmp.b    Buffer1,d0
  209.         beq    DoCTRL_P2
  210.         bsr    DoCLIInput
  211. Looper1:    move.l    #BUFLEN,d0
  212.         move.l    #1,d1
  213.         bsr    Read
  214.         tst.l    d0
  215.         beq    Looper
  216.  
  217.         lea.l    Buffer3,a0
  218.         clr.b    0(a0,d0.l)    ;null terminated, please!
  219.  
  220.         bsr    DoSerialInput
  221.  
  222.         move.l    _stdout,d1
  223.         lea.l    Buffer4,a1
  224.         bsr    GetLength
  225.         move.l    d0,d3
  226.         lea.l    Buffer4,a0
  227.         move.l    a0,d2
  228.         lib    Dos,Write
  229.  
  230.         bsr    DoCapture
  231.  
  232.         bra    Looper
  233.  
  234. Menu:        bsr    DoANSI
  235.         lea.l    MenuText1,a0
  236.         bsr    Printer
  237. Menu1:        move.l    _stdin,d1
  238.         lib    Dos,FGetC
  239.         cmp.l    #-1,d0
  240.         beq    ShutDown
  241.         cmp.l    #'a',d0
  242.         bcs    Menu2
  243.         cmp.l    #'z',d0
  244.         bhi    Menu2
  245.         sub.l    #32,d0
  246. Menu2:        cmp.l    #'P',d0
  247.         beq    Prefs
  248.         cmp.l    #'S',d0
  249.         beq    DoStats
  250.         cmp.l    #'C',d0
  251.         beq    ClearBoth
  252.         cmp.l    #'D',d0
  253.         beq    Dialer
  254.         cmp.l    #'B',d0
  255.         beq    DoBreak
  256.         cmp.l    #'O',d0
  257.         beq    DoCTRL_P
  258.         cmp.l    #'F',d0
  259.         beq    ResetFont
  260.         cmp.l    #'X',d0
  261.         beq    ClearScreen
  262.         cmp.l    #'R',d0
  263.         beq    DoReset
  264.         cmp.l    #'H',d0
  265.         beq    DoHangUp
  266.         cmp.l    #'L',d0
  267.         beq    DoOpenCapture
  268.         cmp.l    #'K',d0
  269.         beq    DoCloseCapture
  270.         cmp.l    #'+',d0
  271.         beq    DoUpLoad
  272.         cmp.l    #'-',d0
  273.         beq    DoDownLoad
  274.         cmp.l    #'?',d0
  275.         beq    DoInfo
  276.         cmp.l    #'Q',d0
  277.         beq    Quit
  278.         cmp.l    #'E',d0
  279.         beq    Exit1
  280.         bra    Menu1
  281. Exit1:        lea.l    ExitText1,a0
  282.         bsr    Printer
  283.         bra    Looper1
  284.  
  285. ResetFont:    lea.l    ResetFText1,a0
  286.         bsr    Printer
  287.         lea.l    PlainText1,a0
  288.         bsr    Printer
  289.         bra    Menu
  290.  
  291. ClearScreen:    lea.l    ClearSText1,a0
  292.         bsr    Printer
  293.         bra    Exit
  294.  
  295. DoANSI:        tst.b    UseANSI
  296.         beq    DoANSI_OUT
  297.         lea.l    ClearSText1,a0
  298.         bsr    Printer
  299. DoANSI_OUT:    rts
  300.  
  301. DoStats:    lea.l    StatsText2,a0
  302.         bsr    Printer
  303.         bsr    DoANSI
  304.         bsr    GiveStats
  305.         bsr    GetAnyKey
  306.         bra    Menu
  307.  
  308. ClearBoth:    lea.l    ClearText1,a0
  309.         bsr    Printer
  310.         clr.l    Received
  311.         clr.l    Sent
  312.         bra    Menu
  313.  
  314. DoBreak:    bsr    SendBREAK
  315.         lea.l    BreakText2,a0
  316.         bsr    Printer
  317.  
  318.         bra    Exit
  319.  
  320. DoCTRL_P:    move.b    #CTRL_P,Buffer1
  321.         bsr    Writer
  322.         lea.l    CTRL_PText1,a0
  323.         bsr    Printer
  324.         add.l    #1,Sent
  325.         bra    Exit
  326.  
  327. DoCTRL_P2:    move.b    #CTRL_P,Buffer1
  328.         bsr    Writer
  329.         add.l    #1,Sent
  330.         bra    Looper
  331.  
  332. DoReset:    lea.l    ResetText1,a0
  333.         bsr    Printer
  334.         lea.l    ResetText2,a1
  335.         bsr    GetLength
  336.         lea.l    ResetText2,a0
  337.         bsr    Writer2
  338.         bra    Exit
  339.  
  340. DoHangUp:    lea.l    HangUpText1,a0
  341.         bsr    Printer
  342.         move.l    #3*50,d1
  343.         lib    Dos,Delay
  344.         lea.l    HangUpText2,a1
  345.         bsr    GetLength
  346.         lea.l    HangUpText2,a0
  347.         bsr    Writer2
  348.         move.l    #2*55,d1
  349.         lib    Dos,Delay
  350.         lea.l    HangUpText3,a1
  351.         bsr    GetLength
  352.         lea.l    HangUpText3,a0
  353.         bsr    Writer2
  354.         bra    Exit
  355.  
  356. DoOpenCapture:    lea.l    OpenCaptureText1,a0
  357.         bsr    Printer
  358.  
  359.         tst.l    CaptureFile
  360.         bne    DoOpenCapture_ERR2
  361.  
  362.         lea.l    FileNameBuf2,a0
  363.         move.l    #128,d3
  364.         bsr    GetString
  365.  
  366.         tst.b    FileNameBuf2
  367.         beq    DoOpenCapture_OUT
  368.  
  369.         lea.l    FileNameBuf2,a0
  370.         move.l    a0,d1
  371.         move.l    #MODE_READWRITE,d2
  372.         lib    Dos,Open
  373.         move.l    d0,CaptureFile
  374.         beq    DoOpenCapture_ERR1
  375.  
  376. DoOpenCapture_OUT: bra    Menu
  377. DoOpenCapture_ERR1: lea.l    CaptureErrorText1,a0
  378.         bsr    Printer
  379.         bra    Menu
  380. DoOpenCapture_ERR2: lea.l    CaptureErrorText2,a0
  381.         bsr    Printer
  382.         bra    Menu
  383.  
  384. DoCloseCapture:    lea.l    CloseCaptureText1,a0
  385.         bsr    Printer
  386.  
  387.         move.l    CaptureFile,d1
  388.         beq    DoCloseCapture
  389.         lib    Dos,Close
  390.         clr.l    CaptureFile
  391. DoCloseCapture_OUT: bra    Menu
  392.  
  393. DoUpLoad:    lea.l    ULText2,a0
  394.         bsr    Printer
  395.         lea.l    ULProgram,a0
  396.         tst.b    (a0)
  397.         beq    DoUpLoad9
  398.  
  399.         lea.l    FileNameBuf2,a0
  400.         move.l    #128,d3
  401.         bsr    GetString
  402.  
  403.         bsr    MakeCmdString
  404.  
  405.         tst.b    ULDir
  406.         beq    DoUpLoad1
  407.         lea.l    ULDir,a0
  408.         move.l    a0,d1
  409.         move.l    #ACCESS_READ,d2
  410.         lib    Dos,Lock
  411.         move.l    d0,ULLock
  412.         bne    DoUpLoad2
  413.  
  414. DoUpLoad1:    lea.l    NoULDirText1,a0
  415.         bsr    Printer
  416.         bra    DoUpLoad5
  417.  
  418. DoUpLoad2:    move.l    ULLock,d1
  419.         lib    Dos,CurrentDir
  420.         move.l    d0,OldLock
  421.  
  422. DoUpLoad5:    lea.l    ULText3,a0
  423.         bsr    Printer
  424.  
  425.         lea.l    FileNameBuf3,a0
  426.         move.l    a0,d1
  427.         clr.l    d2
  428.         clr.l    d3
  429.         lib    Dos,Execute
  430.  
  431. ;change back to dir where we started from
  432.  
  433.         move.l    OldLock,d1
  434.         beq    DoUpLoad7
  435.         lib    Dos,CurrentDir
  436.         clr.l    OldLock
  437.  
  438. DoUpLoad7:    move.l    ULLock,d1
  439.         beq    DoUpLoad8
  440.         lib    Dos,UnLock
  441.         clr.l    ULLock
  442. DoUpLoad8:
  443.         bra    Exit
  444. DoUpLoad9:    lea.l    NoULDLProgText1,a0
  445.         bsr    Printer
  446.         bra    Exit
  447.  
  448. DoDownLoad:    lea.l    DLText2,a0
  449.         bsr    Printer
  450.         tst.b    DLProgram
  451.         beq    DoDownLoad9
  452.  
  453. ;change to the dl dir
  454.  
  455.         tst.b    DLDir
  456.         beq    DoDownLoad1
  457.         lea.l    DLDir,a0
  458.         move.l    a0,d1
  459.         move.l    #ACCESS_READ,d2
  460.         lib    Dos,Lock
  461.         move.l    d0,DLLock
  462.         bne    DoDownLoad2
  463.  
  464. DoDownLoad1:    lea.l    NoDLDirText1,a0
  465.         bsr    Printer
  466.         bra    DoDownLoad5
  467.  
  468. DoDownLoad2:    move.l    DLLock,d1
  469.         lib    Dos,CurrentDir
  470.         move.l    d0,OldLock
  471.  
  472. DoDownLoad5:    lea.l    DLProgram,a0
  473.         move.l    a0,d1
  474.         clr.l    d2
  475.         clr.l    d3
  476.         lib    Dos,Execute
  477.  
  478. ;change back to dir where we started from
  479.  
  480.         move.l    OldLock,d1
  481.         beq    DoDownLoad7
  482.         lib    Dos,CurrentDir
  483.         clr.l    OldLock
  484.  
  485. DoDownLoad7:    move.l    DLLock,d1
  486.         beq    DoDownLoad8
  487.         lib    Dos,UnLock
  488.         clr.l    DLLock
  489. DoDownLoad8:
  490.         bra    Exit
  491. DoDownLoad9:    lea.l    NoULDLProgText1,a0
  492.         bsr    Printer
  493.         bra    Exit
  494.  
  495. DoInfo:        lea.l    InfoText1,a0
  496.         bsr    Printer
  497.         bsr    DoANSI
  498.         lea.l    AuthorText1,a0
  499.         bsr    Printer
  500.         bsr    GetAnyKey
  501.         bra    Menu
  502.  
  503. Quit:        lea.l    QuitText1,a0
  504.         bsr    Printer
  505.         lea.l    CRLFText1,a0
  506.         bsr    Printer
  507.         bsr    GiveStats
  508.         bra    ShutDown
  509.  
  510. Exit:        bsr    DoANSI
  511.         lea.l    TerminalText1,a0
  512.         bsr    Printer
  513.         bra    Looper1
  514.  
  515. Dialer:        lea.l    DialerText1,a0
  516.         bsr    Printer
  517. Dialer0.1:    bsr    DoANSI
  518.         lea.l    DialerText2,a0
  519.         bsr    Printer
  520. Dialer0.2:    bsr    PrintEntries
  521. Dialer0.3:    bsr    PrintSelect
  522. Dialer0.4:    lea.l    DialerText3,a0
  523.         bsr    Printer
  524. Dialer1:    move.l    _stdin,d1
  525.         lib    Dos,FGetC
  526.         cmp.l    #-1,d0
  527.         beq    Menu
  528.         cmp.l    #'a',d0
  529.         bcs    Dialer2
  530.         cmp.l    #'z',d0
  531.         bhi    Dialer
  532.         sub.l    #32,d0
  533. Dialer2:    cmp.l    #'0',d0
  534.         beq    DoEntry0
  535.         cmp.l    #'1',d0
  536.         beq    DoEntry1
  537.         cmp.l    #'2',d0
  538.         beq    DoEntry2
  539.         cmp.l    #'3',d0
  540.         beq    DoEntry3
  541.         cmp.l    #'4',d0
  542.         beq    DoEntry4
  543.         cmp.l    #'5',d0
  544.         beq    DoEntry5
  545.         cmp.l    #'6',d0
  546.         beq    DoEntry6
  547.         cmp.l    #'7',d0
  548.         beq    DoEntry7
  549.         cmp.l    #'8',d0
  550.         beq    DoEntry8
  551.         cmp.l    #'9',d0
  552.         beq    DoEntry9
  553.         cmp.l    #'D',d0
  554.         beq    DialList
  555.         cmp.l    #'E',d0
  556.         beq    Exit1
  557.         cmp.l    #'M',d0
  558.         beq    MainMenu
  559.         cmp.l    #'-',d0
  560.         beq    MainMenu
  561.         cmp.l    #'S',d0
  562.         beq    SingleDial
  563.         cmp.l    #'R',d0
  564.         beq    Relist
  565.         cmp.l    #'C',d0
  566.         beq    ClearList
  567.         cmp.l    #'A',d0
  568.         beq    SelectAll
  569.         cmp.l    #'I',d0
  570.         beq    SetModifyMode
  571.         cmp.l    #'P',d0
  572.         beq    EditPrefix
  573.         cmp.l    #'H',d0
  574.         beq    DialerHelp
  575.         cmp.l    #'?',d0
  576.         beq    DialerHelp
  577.         bra    Dialer1
  578.  
  579. SetModifyMode:    bchg.b    #0,ModifyMode
  580.         beq    SetModifyMode1
  581.         lea.l    ModifyText2,a0
  582.         bsr    Printer
  583.         bra    Dialer0.4
  584. SetModifyMode1:    lea.l    ModifyText1,a0
  585.         bsr    Printer
  586.         bra    Dialer0.4
  587.  
  588. DialerHelp:    lea.l    HelpText1,a0
  589.         bsr    Printer
  590.         bsr    DoANSI
  591.         bra    Dialer0.4
  592.  
  593. ClearList:    lea.l    ClearText2,a0
  594.         bsr    Printer
  595.         bsr    DoANSI
  596.         clr.l    EntrySelected1
  597.         clr.l    EntrySelected5
  598.         clr.w    EntrySelected9
  599.         bra    DoEntry_OUT1
  600.  
  601. SelectAll:    lea.l    AllText1,a0
  602.         bsr    Printer
  603.         bsr    DoANSI
  604.         move.l    #$01010101,EntrySelected1
  605.         move.l    #$01010101,EntrySelected5
  606.         move.w    #$0101,EntrySelected9
  607.         bra    DoEntry_OUT1
  608.  
  609. DoEntry1:    lea.l    Entry1,a0
  610.         tst.w    ModifyMode
  611.         bne    EditEntry
  612.         bchg.b    #0,EntrySelected1
  613.         bra    DoEntry_OUT
  614. DoEntry2:    lea.l    Entry2,a0
  615.         tst.w    ModifyMode
  616.         bne    EditEntry
  617.         bchg.b    #0,EntrySelected2
  618.         bra    DoEntry_OUT
  619. DoEntry3:    lea.l    Entry3,a0
  620.         tst.w    ModifyMode
  621.         bne    EditEntry
  622.         bchg.b    #0,EntrySelected3
  623.         bra    DoEntry_OUT
  624. DoEntry4:    lea.l    Entry4,a0
  625.         tst.w    ModifyMode
  626.         bne    EditEntry
  627.         bchg.b    #0,EntrySelected4
  628.         bra    DoEntry_OUT
  629. DoEntry5:    lea.l    Entry5,a0
  630.         tst.w    ModifyMode
  631.         bne    EditEntry
  632.         bchg.b    #0,EntrySelected5
  633.         bra    DoEntry_OUT
  634. DoEntry6:    lea.l    Entry6,a0
  635.         tst.w    ModifyMode
  636.         bne    EditEntry
  637.         bchg.b    #0,EntrySelected6
  638.         bra    DoEntry_OUT
  639. DoEntry7:    lea.l    Entry7,a0
  640.         tst.w    ModifyMode
  641.         bne    EditEntry
  642.         bchg.b    #0,EntrySelected7
  643.         bra    DoEntry_OUT
  644. DoEntry8:    lea.l    Entry8,a0
  645.         tst.w    ModifyMode
  646.         bne    EditEntry
  647.         bchg.b    #0,EntrySelected8
  648.         bra    DoEntry_OUT
  649. DoEntry9:    lea.l    Entry9,a0
  650.         tst.w    ModifyMode
  651.         bne    EditEntry
  652.         bchg.b    #0,EntrySelected9
  653.         bra    DoEntry_OUT
  654. DoEntry0:    lea.l    Entry10,a0
  655.         tst.w    ModifyMode
  656.         bne    EditEntry
  657.         bchg.b    #0,EntrySelected0
  658. DoEntry_OUT:    lea.l    EntryTextXIV,a0
  659.         bsr    Printer
  660.         bsr    DoANSI
  661. DoEntry_OUT1:    bsr    PrintSelect
  662.         lea.l    SelectionText1,a0
  663.         bsr    Printer
  664.         bra    Dialer1
  665.  
  666. EditEntry:    push    a0
  667.         lea.l    EditEntryText1,a0
  668.         bsr    Printer
  669.         lea.l    EditEntryText2,a0
  670.         bsr    Printer
  671.         pull    a0
  672.         move.l    #ENTRYLENGTH,d3
  673.         bsr    GetString
  674.         bsr    PrintEntries
  675.         bra    DoEntry_OUT1
  676.  
  677. EditPrefix:    lea.l    EditEntryText3,a0
  678.         bsr    Printer
  679.         lea.l    EditEntryText4,a0
  680.         bsr    Printer
  681.         lea.l    DialPrefix,a0
  682.         move.l    #16,d3
  683.         bsr    GetString
  684.         bra    Dialer0.1
  685.  
  686. MainMenu:    lea.l    MainMenuText1,a0
  687.         bsr    Printer
  688.         bra    Menu
  689.  
  690. DialList:    lea.l    DialText1,a0
  691.         bsr    Printer
  692.         bsr    DoANSI
  693.         lea.l    DialText2,a0
  694.         bsr    Printer
  695.  
  696. DialList1:    lea.l    EntrySelected1,a2
  697.         tst.b    (a2)
  698.         beq    DialList2
  699.         lea.l    Entry1,a0
  700.         tst.b    (a0)
  701.         beq    DialList1.1
  702.         bsr    DialEntry
  703.         tst.l    d0        ;connect
  704.         bne    DialList1.01
  705. DialLCONNECT:    clr.b    (a2)
  706.         beq    Exit
  707. DialList1.01:    cmp.l    #2,d0        ;cancel
  708.         beq    Dialer0.1
  709.         cmp.l    #3,d0        ;remove
  710.         bne    DialList2
  711. DialList1.1:    clr.b    (a2)
  712. DialList2:    lea.l    EntrySelected2,a2
  713.         tst.b    (a2)
  714.         beq    DialList3
  715.         lea.l    Entry2,a0
  716.         tst.b    (a0)
  717.         beq    DialList2.1
  718.         bsr    DialEntry
  719.         tst.l    d0
  720.         beq    DialLCONNECT    ;Connect
  721.         cmp.l    #2,d0        ;cancel
  722.         beq    Dialer0.1
  723.         cmp.l    #3,d0        ;remove
  724.         bne    DialList3
  725. DialList2.1:    clr.b    (a2)
  726. DialList3:    lea.l    EntrySelected3,a2
  727.         tst.b    (a2)
  728.         beq    DialList4
  729.         lea.l    Entry3,a0
  730.         tst.b    (a0)
  731.         beq    DialList3.1
  732.         bsr    DialEntry
  733.         tst.l    d0
  734.         beq    DialLCONNECT    ;Connect
  735.         cmp.l    #2,d0        ;cancel
  736.         beq    Dialer0.1
  737.         cmp.l    #3,d0        ;remove
  738.         bne    DialList4
  739. DialList3.1:    clr.b    (a2)
  740. DialList4:    lea.l    EntrySelected4,a2
  741.         tst.b    (a2)
  742.         beq    DialList5
  743.         lea.l    Entry4,a0
  744.         tst.b    (a0)
  745.         beq    DialList4.1
  746.         bsr    DialEntry
  747.         tst.l    d0
  748.         beq    DialLCONNECT    ;Connect
  749.         cmp.l    #2,d0        ;cancel
  750.         beq    Dialer0.1
  751.         cmp.l    #3,d0        ;remove
  752.         bne    DialList5
  753. DialList4.1:    clr.b    (a2)
  754. DialList5:    lea.l    EntrySelected5,a2
  755.         tst.b    (a2)
  756.         beq    DialList6
  757.         lea.l    Entry5,a0
  758.         tst.b    (a0)
  759.         beq    DialList5.1
  760.         bsr    DialEntry
  761.         tst.l    d0
  762.         beq    DialLCONNECT    ;Connect
  763.         cmp.l    #2,d0        ;cancel
  764.         beq    Dialer0.1
  765.         cmp.l    #3,d0        ;remove
  766.         bne    DialList6
  767. DialList5.1:    clr.b    (a2)
  768. DialList6:    lea.l    EntrySelected6,a2
  769.         tst.b    (a2)
  770.         beq    DialList7
  771.         lea.l    Entry6,a0
  772.         tst.b    (a0)
  773.         beq    DialList6.1
  774.         bsr    DialEntry
  775.         tst.l    d0
  776.         beq    DialLCONNECT    ;Connect
  777.         cmp.l    #2,d0        ;cancel
  778.         beq    Dialer0.1
  779.         cmp.l    #3,d0        ;remove
  780.         bne    DialList7
  781. DialList6.1:    clr.b    (a2)
  782. DialList7:    lea.l    EntrySelected7,a2
  783.         tst.b    (a2)
  784.         beq    DialList8
  785.         lea.l    Entry7,a0
  786.         tst.b    (a0)
  787.         beq    DialList7.1
  788.         bsr    DialEntry
  789.         tst.l    d0
  790.         beq    DialLCONNECT    ;Connect
  791.         cmp.l    #2,d0        ;cancel
  792.         beq    Dialer0.1
  793.         cmp.l    #3,d0        ;remove
  794.         bne    DialList8
  795. DialList7.1:    clr.b    (a2)
  796. DialList8:    lea.l    EntrySelected8,a2
  797.         tst.b    (a2)
  798.         beq    DialList9
  799.         lea.l    Entry8,a0
  800.         tst.b    (a0)
  801.         beq    DialList8.1
  802.         bsr    DialEntry
  803.         tst.l    d0
  804.         beq    DialLCONNECT    ;Connect
  805.         cmp.l    #2,d0        ;cancel
  806.         beq    Dialer0.1
  807.         cmp.l    #3,d0        ;remove
  808.         bne    DialList9
  809. DialList8.1:    clr.b    (a2)
  810. DialList9:    lea.l    EntrySelected9,a2
  811.         tst.b    (a2)
  812.         beq    DialList10
  813.         lea.l    Entry9,a0
  814.         tst.b    (a0)
  815.         beq    DialList9.1
  816.         bsr    DialEntry
  817.         tst.l    d0
  818.         beq    DialLCONNECT    ;Connect
  819.         cmp.l    #2,d0        ;cancel
  820.         beq    Dialer0.1
  821.         cmp.l    #3,d0        ;remove
  822.         bne    DialList10
  823. DialList9.1:    clr.b    (a2)
  824. DialList10:    lea.l    EntrySelected0,a2
  825.         tst.b    (a2)
  826.         beq    DialList11
  827.         lea.l    Entry10,a0
  828.         tst.b    (a0)
  829.         beq    DialList10.1
  830.         bsr    DialEntry
  831.         tst.l    d0
  832.         beq    DialLCONNECT    ;Connect
  833.         cmp.l    #2,d0        ;cancel
  834.         beq    Dialer0.1
  835.         cmp.l    #3,d0        ;remove
  836.         bne    DialList11
  837. DialList10.1:    clr.b    (a2)
  838. DialList11:    tst.l    EntrySelected1
  839.         bne    DialList1
  840.         tst.l    EntrySelected5
  841.         bne    DialList1
  842.         tst.w    EntrySelected9
  843.         bne    DialList1
  844.         lea.l    EmptyText1,a0
  845.         bsr    Printer
  846.         bra    Dialer0.1
  847.  
  848. Relist:        lea.l    RelistText1,a0
  849.         bsr    Printer
  850.         bsr    DoANSI
  851.         bra    Dialer0.2
  852.  
  853. SingleDial:    lea.l    SingleText1,a0
  854.         bsr    Printer
  855.  
  856.         bsr    DoANSI
  857.  
  858.         lea.l    SingleText2,a0
  859.         bsr    Printer
  860.  
  861.         lea.l    DialBuffer1,a0
  862.         move.l    #ENTRYLENGTH,d3
  863.         bsr    GetString
  864.         tst.l    d0
  865.         bne    Dialer0.1
  866.  
  867.         lea.l    DialBuffer1,a1
  868.         bsr    GetLength
  869.         tst.l    d0
  870.         beq    Dialer0.1
  871.  
  872.         lea.l    DialText2,a0
  873.         bsr    Printer
  874.  
  875. SingleDial1:    lea.l    DialBuffer1,a0
  876.         bsr    DialEntry
  877.         tst.l    d0
  878.         beq    Exit
  879.         cmp.l    #1,d0
  880.         beq    SingleDial1
  881.         cmp.l    #2,d0
  882.         beq    Dialer0.1
  883.         cmp.l    #3,d0
  884.         beq    Dialer0.1
  885.         bra    Dialer0.1
  886.  
  887. Prefs:        lea.l    PrefsText1,a0
  888.         bsr    Printer
  889. Prefs1:        bsr    DoANSI
  890.         lea.l    PrefsText2,a0
  891.         bsr    Printer
  892. Prefs2:        move.l    _stdin,d1
  893.         lib    Dos,FGetC
  894.         cmp.l    #-1,d0
  895.         beq    Menu
  896.         cmp.l    #'a',d0
  897.         bcs    Prefs3
  898.         cmp.l    #'z',d0
  899.         bhi    Prefs3
  900.         sub.l    #32,d0
  901. Prefs3:        cmp.l    #'S',d0
  902.         beq    SetSpeed
  903.         cmp.l    #'T',d0
  904.         beq    Terminal
  905.         cmp.l    #'R',d0
  906.         beq    ClearSettings
  907.         cmp.l    #'L',d0
  908.         beq    DoLoad
  909.         cmp.l    #'W',d0
  910.         beq    DoSave
  911.         cmp.l    #'N',d0
  912.         beq    NameFile
  913.         cmp.l    #'E',d0
  914.         beq    Exit1
  915.         cmp.l    #'V',d0
  916.         beq    DoView
  917.         cmp.l    #'U',d0
  918.         beq    SetULDir
  919.         cmp.l    #'D',d0
  920.         beq    SetDLDir
  921.         cmp.l    #'+',d0
  922.         beq    SetULProg
  923.         cmp.l    #'-',d0
  924.         beq    SetDLProg
  925.         cmp.l    #'A',d0
  926.         beq    AssignCTRL_P
  927.         cmp.l    #'M',d0
  928.         beq    MainMenu
  929.         bra    Prefs2
  930.  
  931. SetULDir:    lea.l    ULText5,a0
  932.         bsr    Printer
  933.         lea.l    ULDir,a0
  934.         move.l    #128,d3
  935.         bsr    GetString
  936.         bra    Prefs1
  937.  
  938. SetDLDir:    lea.l    DLText5,a0
  939.         bsr    Printer
  940.         lea.l    DLDir,a0
  941.         move.l    #128,d3
  942.         bsr    GetString
  943.         bra    Prefs1
  944.  
  945. SetULProg:    lea.l    ULText1,a0
  946.         bsr    Printer
  947.         lea.l    ULProgram,a0
  948.         move.l    #128,d3
  949.         bsr    GetString
  950.         bra    Prefs1
  951.  
  952. SetDLProg:    lea.l    DLText1,a0
  953.         bsr    Printer
  954.         lea.l    DLProgram,a0
  955.         move.l    #128,d3
  956.         bsr    GetString
  957.         bra    Prefs1
  958.  
  959. AssignCTRL_P:    lea.l    AssignText1,a0
  960.         bsr    Printer
  961.  
  962.         move.l    _stdin,d1
  963.         lib    Dos,Flush
  964.  
  965.         lea.l    AssignText2,a0
  966.         bsr    Printer
  967.  
  968.         move.l    _stdin,d1
  969.         lib    Dos,FGetC
  970.         cmp.l    #-1,d0
  971.         beq    Prefs1
  972.         move.b    d0,CPAssign
  973.  
  974.         lea.l    CRLFText1,a0
  975.         bsr    Printer
  976.         bra    Prefs1
  977.  
  978. NameFile:    lea.l    EnterNText1,a0
  979.         bsr    Printer
  980.  
  981.         lea.l    EnterNText2,a0
  982.         bsr    Printer
  983.  
  984.         lea.l    FileNameBuf1,a0
  985.         move.l    #128,d3
  986.         bsr    GetString
  987.         tst.l    d0
  988.         bne    Prefs1
  989.  
  990.         bra    Prefs1
  991.  
  992. DoLoad:        lea.l    LoadText1,a0
  993.         bsr    Printer
  994.         bsr    LoadPrefsFile
  995.         bsr    CloseSerial
  996.         bsr    OpenSerial
  997.         bsr    SetSerParams
  998.         bra    Prefs1
  999. DoSave:        lea.l    SaveText1,a0
  1000.         bsr    Printer
  1001.         bsr    SavePrefsFile
  1002.         bra    Prefs1
  1003.  
  1004. DoView:        lea.l    ViewText1,a0
  1005.         bsr    Printer
  1006.         bsr    DoANSI
  1007.         bsr    GiveSettings
  1008.         bsr    GetAnyKey
  1009.         bra    Prefs1
  1010.  
  1011. ClearSettings:    lea.l    ClearText3,a0
  1012.         bsr    Printer
  1013.         move.l    #9600,Speed
  1014.         move.b    #8,DataBits
  1015.         move.b    #1,StopBits
  1016.         clr.l    CRTranslate    ;All translating (long)
  1017.         clr.l    SwapBSDEL    ;SwapBSDEL+UseANSI+CPAssign+CursorRemap
  1018.         bsr    SetSerParams
  1019.         tst.l    d0
  1020.         beq    Prefs1
  1021.         lea.l    SerSetText1,a0
  1022.         bsr    Printer
  1023.         bra    Prefs1
  1024.  
  1025. Terminal:    lea.l    STerminalText1,a0
  1026.         bsr    Printer
  1027. Terminal1:    bsr    DoANSI
  1028.         lea.l    STerminalText2,a0
  1029.         bsr    Printer
  1030. Terminal2:    move.l    _stdin,d1
  1031.         lib    Dos,FGetC
  1032.         cmp.l    #-1,d0
  1033.         beq    Prefs1
  1034.         cmp.l    #'a',d0
  1035.         bcs    Terminal3
  1036.         cmp.l    #'z',d0
  1037.         bhi    Terminal3
  1038.         sub.l    #32,d0
  1039. Terminal3:    cmp.l    #'L',d0
  1040.         beq    SetLocalEcho
  1041.         cmp.l    #'S',d0
  1042.         beq    SetSwapBSDEL
  1043.         cmp.l    #'1',d0
  1044.         beq    SetCRTrans
  1045.         cmp.l    #'2',d0
  1046.         beq    SetLFTrans
  1047.         cmp.l    #'3',d0
  1048.         beq    SetCRTransIn
  1049.         cmp.l    #'4',d0
  1050.         beq    SetLFTransIn
  1051.         cmp.l    #'A',d0
  1052.         beq    SetANSIMode
  1053.         cmp.l    #'C',d0
  1054.         beq    SetCRemapMode
  1055.         cmp.l    #'E',d0
  1056.         beq    Exit1
  1057.         cmp.l    #'M',d0
  1058.         beq    MainMenu
  1059.         cmp.l    #'-',d0
  1060.         beq    Prefs
  1061.         bra    Terminal2
  1062.  
  1063. SetCRemapMode:    bchg.b    #0,CursorRemap
  1064.         beq    SetCRemapMode1
  1065.         lea.l    CRemapText2,a0
  1066.         bsr    Printer
  1067.         bra    Terminal1
  1068. SetCRemapMode1:    lea.l    CRemapText1,a0
  1069.         bsr    Printer
  1070.         bra    Terminal1
  1071.  
  1072. SetANSIMode:    bchg.b    #0,UseANSI
  1073.         beq    SetANSIMode1
  1074.         lea.l    ANSIText2,a0
  1075.         bsr    Printer
  1076.         bra    Terminal1
  1077. SetANSIMode1:    lea.l    ANSIText1,a0
  1078.         bsr    Printer
  1079.         bra    Terminal1
  1080.  
  1081. SetSwapBSDEL:    bchg.b    #0,SwapBSDEL
  1082.         beq    SetSwapBSDEL1
  1083.         lea.l    SwapText2,a0
  1084.         bsr    Printer
  1085.         bra    Terminal1
  1086. SetSwapBSDEL1:    lea.l    SwapText1,a0
  1087.         bsr    Printer
  1088.         bra    Terminal1
  1089.  
  1090. SetCRTrans:    lea.l    CRTransText1,a0
  1091.         bsr    Printer
  1092.         lea.l    CRTransText2,a0
  1093.         bsr    Printer
  1094.         bsr    GetNSA
  1095.         cmp.l    #-1,d0
  1096.         beq    Terminal1
  1097.         move.b    d0,CRTranslate
  1098.         bra    Terminal1
  1099.  
  1100. SetLFTrans:    lea.l    LFTransText1,a0
  1101.         bsr    Printer
  1102.         lea.l    LFTransText2,a0
  1103.         bsr    Printer
  1104.         bsr    GetNSA
  1105.         cmp.l    #-1,d0
  1106.         beq    Terminal1
  1107.         move.b    d0,LFTranslate
  1108.         bra    Terminal1
  1109.  
  1110. SetCRTransIn:    lea.l    CRTransText3,a0
  1111.         bsr    Printer
  1112.         lea.l    CRTransText2,a0
  1113.         bsr    Printer
  1114.         bsr    GetNSA
  1115.         cmp.l    #-1,d0
  1116.         beq    Terminal1
  1117.         move.b    d0,CRTranslateIn
  1118.         bra    Terminal1
  1119.  
  1120. SetLFTransIn:    lea.l    LFTransText3,a0
  1121.         bsr    Printer
  1122.         lea.l    LFTransText2,a0
  1123.         bsr    Printer
  1124.         bsr    GetNSA
  1125.         cmp.l    #-1,d0
  1126.         beq    Terminal1
  1127.         move.b    d0,LFTranslateIn
  1128.         bra    Terminal1
  1129.  
  1130. SetLocalEcho:    bchg.b    #0,LocalEcho
  1131.         beq    SetLocalEcho1
  1132.         lea.l    EchoText2,a0
  1133.         bsr    Printer
  1134.         bra    Terminal1
  1135. SetLocalEcho1:    lea.l    EchoText1,a0
  1136.         bsr    Printer
  1137.         bra    Terminal1
  1138.  
  1139. SetSpeed:    lea.l    SpeedText11,a0
  1140.         bsr    Printer
  1141. SetSpeed1:    bsr    DoANSI
  1142.         lea.l    SpeedText1,a0
  1143.         bsr    Printer
  1144. SetSpeed2:    move.l    _stdin,d1
  1145.         lib    Dos,FGetC
  1146.         cmp.l    #-1,d0
  1147.         beq    Prefs1
  1148.         cmp.l    #'a',d0
  1149.         bcs    SetSpeed3
  1150.         cmp.l    #'z',d0
  1151.         bhi    SetSpeed3
  1152.         sub.l    #32,d0
  1153. SetSpeed3:    move.l    Speed,d7    ;get real speed if fail later
  1154.         cmp.l    #'0',d0
  1155.         beq    DoSpeed0
  1156.         cmp.l    #'1',d0
  1157.         beq    DoSpeed1
  1158.         cmp.l    #'2',d0
  1159.         beq    DoSpeed2
  1160.         cmp.l    #'3',d0
  1161.         beq    DoSpeed3
  1162.         cmp.l    #'4',d0
  1163.         beq    DoSpeed4
  1164.         cmp.l    #'5',d0
  1165.         beq    DoSpeed5
  1166.         cmp.l    #'6',d0
  1167.         beq    DoSpeed6
  1168.         cmp.l    #'7',d0
  1169.         beq    DoSpeed7
  1170.         cmp.l    #'8',d0
  1171.         beq    DoSpeed8
  1172.         cmp.l    #'9',d0
  1173.         beq    DoSpeed9
  1174.         cmp.l    #'D',d0
  1175.         beq    SetDataBits
  1176.         cmp.l    #'S',d0
  1177.         beq    SetStopBits
  1178.         cmp.l    #'N',d0
  1179.         beq    SetDevice
  1180.         cmp.l    #'R',d0
  1181.         beq    ReOpenDevice
  1182.         cmp.l    #'E',d0
  1183.         beq    Exit1
  1184.         cmp.l    #'M',d0
  1185.         beq    MainMenu
  1186.         cmp.l    #'-',d0
  1187.         beq    Prefs
  1188.         bra    SetSpeed2
  1189.  
  1190. DoSpeed1:    move.l    #110,Speed
  1191.         bra    DoSpeed_OUT
  1192. DoSpeed2:    move.l    #300,Speed
  1193.         bra    DoSpeed_OUT
  1194. DoSpeed3:    move.l    #1200,Speed
  1195.         bra    DoSpeed_OUT
  1196. DoSpeed4:    move.l    #2400,Speed
  1197.         bra    DoSpeed_OUT
  1198. DoSpeed5:    move.l    #4800,Speed
  1199.         bra    DoSpeed_OUT
  1200. DoSpeed6:    move.l    #9600,Speed
  1201.         bra    DoSpeed_OUT
  1202. DoSpeed7:    move.l    #19200,Speed
  1203.         bra    DoSpeed_OUT
  1204. DoSpeed8:    move.l    #38400,Speed
  1205.         bra    DoSpeed_OUT
  1206. DoSpeed9:    move.l    #57600,Speed
  1207.         bra    DoSpeed_OUT
  1208. DoSpeed0:    move.l    #115200,Speed
  1209. DoSpeed_OUT:    lea.l    SpeedText13,a0
  1210.         bsr    Printer
  1211.  
  1212.         bsr    SetSerParams
  1213.         tst.l    d0
  1214.         beq    DoSpeed_OUT1
  1215.  
  1216.         lea.l    SpeedText12,a0
  1217.         bsr    Printer
  1218.         move.l    d7,Speed
  1219. DoSpeed_OUT1:    bra    SetSpeed1        ;OPTI
  1220.  
  1221. SetDevice:    lea.l    NameText1,a0
  1222.         bsr    Printer
  1223.  
  1224.         lea.l    NameText2,a0
  1225.         bsr    Printer
  1226.  
  1227.         lea.l    SerDevNBuffer1,a0
  1228.         move.l    #32,d3
  1229.         bsr    GetString
  1230.         tst.l    d0
  1231.         bne    SetSpeed1
  1232.  
  1233.         lea.l    NameText3,a0
  1234.         bsr    Printer
  1235.  
  1236.         lea.l    DialBuffer1,a0
  1237.         move.l    #12,d3
  1238.         bsr    GetString
  1239.         tst.l    d0
  1240.         bne    SetSpeed1
  1241.  
  1242.         lea.l    DialBuffer1,a0
  1243.         bsr    ConvASCII
  1244.         move.l    d0,SerUnit
  1245.  
  1246.         lea.l    CRLFText1,a0
  1247.         bsr    Printer
  1248.  
  1249.         bsr    CloseSerial
  1250.         bsr    OpenSerial
  1251.         bra    SetSpeed1
  1252.  
  1253. ReOpenDevice:    lea.l    ReOpenText1,a0
  1254.         bsr    Printer
  1255.         bsr    CloseSerial
  1256.         bsr    OpenSerial
  1257.         bra    SetSpeed1
  1258.  
  1259. SetDataBits:    move.b    DataBits,d7
  1260. SetDataBits0.1:    cmp.b    #7,DataBits
  1261.         beq    SetDataBits1
  1262.         move.b    #7,DataBits
  1263.         lea.l    DBitsText1,a0
  1264.         bsr    Printer
  1265.         bra    SetDataBits2
  1266. SetDataBits1:    move.b    #8,DataBits
  1267.         lea.l    DBitsText2,a0
  1268.         bsr    Printer
  1269.         bra    SetSpeed1
  1270. SetDataBits2:    bsr    SetSerParams
  1271.         tst.l    d0
  1272.         beq    SetSpeed1
  1273.         move.b    d7,DataBits
  1274.         lea.l    DBitsText3,a0
  1275.         bsr    Printer
  1276.         bra    SetSpeed1
  1277.  
  1278. SetStopBits:    move.b    StopBits,d7
  1279. SetStopBits0.1:    cmp.b    #1,StopBits
  1280.         beq    SetStopBits1
  1281.         move.b    #1,StopBits
  1282.         lea.l    SBitsText1,a0
  1283.         bsr    Printer
  1284.         bra    SetStopBits2
  1285. SetStopBits1:    move.b    #2,StopBits
  1286.         lea.l    SBitsText2,a0
  1287.         bsr    Printer
  1288.         bra    SetSpeed1
  1289. SetStopBits2:    bsr    SetSerParams
  1290.         tst.l    d0
  1291.         beq    SetSpeed1
  1292.         move.b    d7,StopBits
  1293.         lea.l    SBitsText3,a0
  1294.         bsr    Printer
  1295.         bra    SetSpeed1
  1296.  
  1297. ;Dials one number. Fails for three reasons, because the user decided
  1298. ;to skip this entry, to cancel dialing or to remove this entry.
  1299. ;If a busy is found, a value of 1 will be returned.
  1300. ;
  1301. ;Inputs a0 = pointer to phonenumber (ASCII text)
  1302. ;
  1303. ;Result d0 = Success (0=Connect, 1=Skipped, 2=Cancelled, 3=Remove this entry)
  1304. ;
  1305.  
  1306. DialEntry:    push    d2-d7/a2-a6
  1307.         move.l    a0,a4
  1308.  
  1309. DialEntry1:    lea.l    DialPrefix,a1
  1310.         bsr    GetLength
  1311.         lea.l    DialPrefix,a0
  1312.         bsr    Writer2
  1313.         move.l    a4,a1
  1314.         bsr    GetLength
  1315.         move.l    a4,a0
  1316.         bsr    Writer2
  1317.         lea.l    CRLFText1,a1
  1318.         bsr    GetLength
  1319.         lea.l    CRLFText1,a0
  1320.         bsr    Writer2
  1321.         lea.l    DialingText1,a0
  1322.         bsr    Printer
  1323.         move.l    a4,a0
  1324.         bsr    Printer
  1325.         lea.l    CRLFText1,a0
  1326.         bsr    Printer
  1327.         move.l    #BUFLEN,d0        ;try to read ATDT etc.
  1328.         move.l    #1,d1
  1329.         bsr    Read
  1330.  
  1331. DialEntry2:    move.l    #10,d1
  1332.         lib    Dos,Delay
  1333.         move.l    #BUFLEN,d0
  1334.         move.l    #4,d1
  1335.         bsr    Read
  1336.         tst.l    d0
  1337.         beq    DialEntry3
  1338.         lea.l    Buffer3,a0
  1339.         clr.b    0(a0,d0.l)    ;null terminated, please!
  1340.         move.w    #'CO',d0
  1341.         lea.l    Buffer3,a0
  1342.         bsr    FindWord
  1343.         bne    DialEntry_OUT1
  1344.         move.w    #'BU',d0
  1345.         lea.l    Buffer3,a0
  1346.         bsr    FindWord
  1347.         bne    DialEntry4
  1348.         move.w    #'NO',d0
  1349.         lea.l    Buffer3,a0
  1350.         bsr    FindWord
  1351.         bne    DialEntry_OUT2
  1352. DialEntry3:    move.l    _stdin,d1
  1353.         move.l    #10000,d2
  1354.         lib    Dos,WaitForChar
  1355.         tst.l    d0
  1356.         beq    DialEntry2
  1357.         move.l    _stdin,d1
  1358.         lea.l    Buffer2,a0
  1359.         move.l    a0,d2
  1360.         move.l    #1,d3
  1361.         lib    Dos,Read
  1362.         cmp.l    #1,d0
  1363.         bne    DialEntry2
  1364.         cmp.b    #' ',Buffer2    ;Space
  1365.         beq    DialEntry_OUT2
  1366.         cmp.b    #27,Buffer2    ;ESC
  1367.         beq    DialEntry_OUT3
  1368.         cmp.b    #8,Buffer2    ;BS
  1369.         beq    DialEntry_OUT4
  1370.         bra    DialEntry2
  1371. DialEntry4:    lea.l    BusyText1,a0
  1372.         bsr    Printer
  1373.         move.l    #50+25,d1
  1374.         lib    Dos,Delay
  1375.         pull    d2-d7/a2-a6
  1376.         move.l    #1,d0
  1377.         rts
  1378. DialEntry_OUT1:    move.l    #BUFLEN,d0        ;try to read extra stuff
  1379.         move.l    #1,d1
  1380.         bsr    Read
  1381.         lea.l    ConnectText1,a0
  1382.         bsr    Printer
  1383.         pull    d2-d7/a2-a6
  1384.         clr.l    d0
  1385.         rts
  1386. DialEntry_OUT2:    lea.l    CRLFText1,a1
  1387.         bsr    GetLength
  1388.         lea.l    CRLFText1,a0
  1389.         bsr    Writer2
  1390.         lea.l    SkippedText1,a0
  1391.         bsr    Printer
  1392.         move.l    #50+25,d1
  1393.         lib    Dos,Delay
  1394.         pull    d2-d7/a2-a6
  1395.         move.l    #1,d0
  1396.         rts
  1397. DialEntry_OUT3:    lea.l    CancelledText1,a0
  1398.         bsr    Printer
  1399.         lea.l    CRLFText1,a1
  1400.         bsr    GetLength
  1401.         lea.l    CRLFText1,a0
  1402.         bsr    Writer2
  1403.         move.l    #50+25,d1
  1404.         lib    Dos,Delay
  1405.         pull    d2-d7/a2-a6
  1406.         move.l    #2,d0
  1407.         rts
  1408. DialEntry_OUT4:    lea.l    CRLFText1,a1
  1409.         bsr    GetLength
  1410.         lea.l    CRLFText1,a0
  1411.         bsr    Writer2
  1412.         move.l    #55,d1
  1413.         lib    Dos,Delay
  1414.         lea.l    RemoveText1,a0
  1415.         bsr    Printer
  1416.         pull    d2-d7/a2-a6
  1417.         move.l    #3,d0
  1418.         rts
  1419.  
  1420. Break:        lea.l    BreakText1,a0
  1421.         bsr    Printer
  1422.         clr.l    d0
  1423.         rts
  1424.  
  1425. ClearSer:    move.l    IORRequest,a1
  1426.         lib    Exec,CheckIO
  1427.         tst.l    d0
  1428.         beq    ClearSer1
  1429.         move.l    IORRequest,a1
  1430.         lib    Exec,WaitIO
  1431.         rts
  1432.  
  1433. ClearSer1:    move.l    IORRequest,a1
  1434.         ABORTIO
  1435.         move.l    IORRequest,a1
  1436.         lib    Exec,WaitIO
  1437.         rts
  1438.  
  1439. ;Buffered read from a device
  1440. ;
  1441. ;Inputs d0 = Buffer length (maximum amount to read)
  1442. ;    d1 = Minimum amout to read
  1443. ;
  1444. ;Result d0 = Amount actually read
  1445. ;
  1446.  
  1447. Read:        push    d2-d7/a2-a6
  1448.         move.l    d0,d4
  1449.         move.l    d1,d5
  1450.  
  1451.         move.l    IOWRequest,a1            ;get amount of bytes
  1452.         move.w    #SDCMD_QUERY,IO_COMMAND(a1)    ;in buffer
  1453.         or.b    #IOF_QUICK,IO_FLAGS(a1)
  1454.         lib    Exec,DoIO
  1455.  
  1456.         move.l    IOWRequest,a1
  1457.         move.l    IO_ACTUAL(a1),d0
  1458.         beq    Read_OUT1
  1459.         cmp.l    d5,d0
  1460.         bmi    Read_OUT1
  1461.         cmp.l    d4,d0
  1462.         bls    Read1
  1463.         move.l    d4,d0            ;available > buffer size
  1464. Read1:        move.l    IORRequest,a1
  1465.         move.l    d0,IO_LENGTH(a1)
  1466.         BEGINIO
  1467.  
  1468.         move.l    IORRequest,a1
  1469.         move.l    IO_ACTUAL(a1),d0    ;even on error we return
  1470.         add.l    d0,Received        ;correct amount in buffer
  1471.         pull    d2-d7/a2-a6
  1472.         rts
  1473.  
  1474. Read_OUT1:    clr.l    d0
  1475.         pull    d2-d7/a2-a6
  1476.         rts
  1477.  
  1478. Writer:        tst.w    SerOpen
  1479.         beq    Writer1.1
  1480.         add.l    #1,Sent
  1481.         move.l    IOWRequest,a1
  1482.         move.l    #1,IO_LENGTH(a1)        ;writes in one byte "chunks"
  1483.         move.w    #CMD_WRITE,IO_COMMAND(a1)
  1484.         lea.l    Buffer1,a0
  1485.         move.l    a0,IO_DATA(a1)
  1486.         lib    Exec,DoIO        ;May freeze, too bad
  1487. Writer1.1:    rts
  1488.  
  1489. ;Writes string to serial port
  1490. ;
  1491. ;D0 = Length
  1492. ;A0 = String
  1493.  
  1494. Writer2:    tst.w    SerOpen
  1495.         beq    Writer2.1
  1496.         add.l    d0,Sent
  1497.         move.l    IOWRequest,a1
  1498.         move.w    #CMD_WRITE,IO_COMMAND(a1)
  1499.         move.l    d0,IO_LENGTH(a1)
  1500.         move.l    a0,IO_DATA(a1)
  1501.         lib    Exec,DoIO        ;May freeze, too bad
  1502. Writer2.1:    rts
  1503.  
  1504. DoCapture:    move.l    CaptureFile,d1
  1505.         beq    DoCapture_OUT
  1506.         lea.l    Buffer4,a1
  1507.         bsr    GetLength
  1508.         move.l    d0,d3
  1509.         lea.l    Buffer4,a0
  1510.         move.l    a0,d2
  1511.         lib    Dos,Write
  1512. DoCapture_OUT:    rts
  1513.  
  1514. SetSerParams:    move.l    IOWRequest,a1
  1515.         clr.l    IO_LENGTH(a1)
  1516.         clr.l    IO_DATA(a1)
  1517.         move.w    #SDCMD_SETPARAMS,IO_COMMAND(a1)
  1518.         move.l    Speed,IO_BAUD(a1)
  1519.         move.b    DataBits,IO_READLEN(a1)
  1520.         move.b    DataBits,IO_WRITELEN(a1)
  1521.         move.b    StopBits,IO_STOPBITS(a1)
  1522.         lib    Exec,DoIO
  1523.         rts
  1524.  
  1525. SendBREAK:    move.l    IOWRequest,a1
  1526.         move.w    #SDCMD_BREAK,IO_COMMAND(a1)
  1527.         or.b    #IOF_QUICK,IO_FLAGS(a1)
  1528.         lib    Exec,DoIO
  1529.         rts
  1530.  
  1531. DoCLIInput:    lea.l    Buffer1,a0
  1532.         cmp.b    #CR,Buffer1
  1533.         beq    DoCLIInput3
  1534.         cmp.b    #LF,Buffer1
  1535.         beq    DoCLIInput4
  1536.         cmp.b    #BS,Buffer1
  1537.         beq    DoCLIInput5
  1538.         cmp.b    #DEL,Buffer1
  1539.         beq    DoCLIInput6
  1540.         cmp.b    #CSI,Buffer1
  1541.         beq    DoCSI
  1542. DoCLIInput1:    bsr    Writer
  1543.         btst.b    #0,LocalEcho
  1544.         beq    DoCLIInput2
  1545.         lea.l    Buffer1,a0
  1546.         bsr    Printer
  1547. DoCLIInput2:    rts
  1548. DoCLIInput3:    tst.b    CRTranslate
  1549.         beq    DoCLIInput1
  1550.         cmp.b    #1,CRTranslate
  1551.         beq    DoCLIInput2
  1552.         cmp.b    #2,CRTranslate
  1553.         bne    DoCLIInput2
  1554.         bsr    DoCLIInput1
  1555.         move.b    #LF,Buffer1
  1556.         bra    DoCLIInput1
  1557. DoCLIInput4:    tst.b    LFTranslate
  1558.         beq    DoCLIInput1
  1559.         cmp.b    #1,LFTranslate
  1560.         beq    DoCLIInput2
  1561.         cmp.b    #2,LFTranslate
  1562.         bne    DoCLIInput2
  1563.         move.b    #CR,Buffer1
  1564.         bsr    DoCLIInput1
  1565.         move.b    #LF,Buffer1
  1566.         bra    DoCLIInput1
  1567. DoCLIInput5:    tst.b    SwapBSDEL
  1568.         beq    DoCLIInput1
  1569.         move.b    #DEL,Buffer1
  1570.         bra    DoCLIInput1
  1571. DoCLIInput6:    tst.b    SwapBSDEL
  1572.         beq    DoCLIInput1
  1573.         move.b    #BS,Buffer1
  1574.         bra    DoCLIInput1
  1575.  
  1576. DoCSI:        tst.b    CursorRemap
  1577.         beq    DoCSI_OUT
  1578.         move.l    _stdin,d1
  1579.         lea.l    Buffer1,a0
  1580.         move.l    a0,d2
  1581.         move.l    #1,d3
  1582.         lib    Dos,Read
  1583.         cmp.b    #Cursor_Up,Buffer1
  1584.         beq    DoCSI1
  1585.         cmp.b    #Cursor_Down,Buffer1
  1586.         beq    DoCSI2
  1587.         cmp.b    #Cursor_Left,Buffer1
  1588.         beq    DoCSI3
  1589.         cmp.b    #Cursor_Right,Buffer1
  1590.         beq    DoCSI4
  1591.         bra    DoCLIInput1
  1592. DoCSI1:        move.b    #CTRL_P,Buffer1
  1593.         bra    DoCLIInput1
  1594. DoCSI2:        move.b    #CTRL_N,Buffer1
  1595.         bra    DoCLIInput1
  1596. DoCSI3:        move.b    #CTRL_B,Buffer1
  1597.         bra    DoCLIInput1
  1598. DoCSI4:        move.b    #CTRL_F,Buffer1
  1599. DoCSI_OUT:    bra    DoCLIInput1
  1600.  
  1601. DoSerialInput:    push    d0-d7/a2-a6
  1602.         lea.l    Buffer3,a0
  1603.         lea.l    Buffer4,a1
  1604. DoSerialInput1:    tst.b    (a0)
  1605.         beq    DoSerialInput3.1
  1606.         cmp.b    #CR,(a0)
  1607.         beq    DoSerialInput4
  1608.         cmp.b    #LF,(a0)
  1609.         beq    DoSerialInput6
  1610. DoSerialInput2:    move.b    (a0)+,(a1)+
  1611.         bra    DoSerialInput1
  1612. DoSerialInput3:    pull    d0-d7/a2-a6
  1613.         rts
  1614. DoSerialInput3.1: clr.b    (a1)
  1615.         pull    d0-d7/a2-a6
  1616.         rts
  1617. DoSerialInput4:    tst.b    CRTranslateIn
  1618.         beq    DoSerialInput2
  1619.         cmp.b    #1,CRTranslateIn
  1620.         bne    DoSerialInput5
  1621.         add.l    #1,a0
  1622.         bra    DoSerialInput1
  1623. DoSerialInput5:    cmp.b    #2,CRTranslateIn
  1624.         bne    DoSerialInput2
  1625.         move.b    #CR,(a1)+
  1626.         move.b    #LF,(a1)+
  1627.         add.l    #1,a0
  1628.         bra    DoSerialInput1
  1629. DoSerialInput6:    tst.b    LFTranslateIn
  1630.         beq    DoSerialInput2
  1631.         cmp.b    #1,LFTranslateIn
  1632.         bne    DoSerialInput7
  1633.         add.l    #1,a0
  1634.         bra    DoSerialInput1
  1635. DoSerialInput7:    cmp.b    #2,LFTranslateIn
  1636.         bne    DoSerialInput2
  1637.         move.b    #CR,(a1)+
  1638.         move.b    #LF,(a1)+
  1639.         add.l    #1,a0
  1640.         bra    DoSerialInput1
  1641.  
  1642. ;gets anykey from user
  1643. ;
  1644. ;Results d0 = -1 for error, otherwise d0 = key pressed
  1645.  
  1646. GetAnyKey:    lea.l    AnyKeyText1,a0
  1647.         bsr    Printer
  1648.         move.l    _stdin,d1
  1649.         lib    Dos,Flush
  1650.         move.l    _stdin,d1
  1651.         lib    Dos,FGetC
  1652.         lea.l    CRLFText1,a0
  1653.         bsr    Printer
  1654.         rts
  1655.  
  1656. ;Gets a string from the user, null terminated
  1657. ;
  1658. ;Inputs    a0 = pointer to buffer
  1659. ;    d3 = length of buffer
  1660. ;
  1661. ;Result    d0 = -1 if failed
  1662. ;
  1663.  
  1664. GetString:    push    a0
  1665.         push    a0
  1666.         move.l    _stdin,d1
  1667.         move.l    #FALSE,d2
  1668.         lib    Dos,SetMode
  1669.  
  1670.         move.l    _stdin,d1
  1671.         lib    Dos,Flush
  1672.  
  1673.         move.l    _stdin,d1
  1674.         pull    d2
  1675.         lib    Dos,FGets
  1676.         tst.l    d0
  1677.         beq    GetString_OUT2
  1678.  
  1679.         pull    a0
  1680.         bsr    GetLLength
  1681.         clr.b    -1(a0,d1.l)    ;remove LF
  1682.  
  1683.         move.l    _stdin,d1
  1684.         move.l    #TRUE,d2
  1685.         lib    Dos,SetMode
  1686.  
  1687.         move.l    _stdin,d1
  1688.         lib    Dos,Flush
  1689.  
  1690.         clr.l    d0
  1691.         rts
  1692.  
  1693. GetString_OUT2:    move.l    #-1,d0
  1694.         rts
  1695.  
  1696. ;Gets input from user
  1697. ;
  1698. ;Results d0 = 0 for N, 1 for S, 2 for A, -1 for error
  1699.  
  1700. GetNSA:        move.l    _stdin,d1
  1701.         lib    Dos,FGetC
  1702.         cmp.l    #-1,d0
  1703.         beq    GetNSA_ERR1
  1704.         cmp.l    #'a',d0
  1705.         bcs    GetNSA0.1
  1706.         cmp.l    #'z',d0
  1707.         bhi    GetNSA0.1
  1708.         sub.l    #32,d0
  1709. GetNSA0.1:    cmp.l    #'N',d0
  1710.         beq    GetNSA1
  1711.         cmp.l    #'S',d0
  1712.         beq    GetNSA2
  1713.         cmp.l    #'A',d0
  1714.         beq    GetNSA3
  1715.         cmp.l    #CR,d0
  1716.         beq    GetNSA_ERR1
  1717.         cmp.l    #LF,d0
  1718.         beq    GetNSA_ERR1
  1719.         bra    GetNSA
  1720. GetNSA1:    lea.l    NoneText1,a0
  1721.         bsr    Printer
  1722.         move.l    #0,d0
  1723.         rts
  1724. GetNSA2:    lea.l    StripText1,a0
  1725.         bsr    Printer
  1726.         move.l    #1,d0
  1727.         rts
  1728. GetNSA3:    lea.l    AddText1,a0
  1729.         bsr    Printer
  1730.         move.l    #2,d0
  1731.         rts
  1732. GetNSA_ERR1:    move.l    #-1,d0
  1733.         rts
  1734.  
  1735. ;Give NSA
  1736. ;
  1737. ;Inputs d0 = NSA qualifier(?)
  1738. ;
  1739.  
  1740. GiveNSA:    tst.b    d0
  1741.         beq    GiveNSA1
  1742.         cmp.b    #1,d0
  1743.         beq    GiveNSA2
  1744.         cmp.b    #2,d0
  1745.         beq    GiveNSA3
  1746.         lea.l    NAText1,a0
  1747.         bsr    Printer
  1748.         rts
  1749. GiveNSA1:    lea.l    NText1,a0
  1750.         bsr    Printer
  1751.         rts
  1752. GiveNSA2:    lea.l    SText1,a0
  1753.         bsr    Printer
  1754.         rts
  1755. GiveNSA3:    lea.l    AText1,a0
  1756.         bsr    Printer
  1757.         rts
  1758.  
  1759. Nope:        lea.l    SpaceText1,a0
  1760.         bsr    Printer
  1761.         rts
  1762. Yep:        lea.l    StarText1,a0
  1763.         bsr    Printer
  1764.         rts
  1765.  
  1766. GiveSettings:    clr.l    SpeedText90
  1767.         clr.l    SpeedText90+4
  1768.         lea.l    fstrl3,a0        ;HEX->ASCII
  1769.         lea.l    Speed,a1        ;Number2Print
  1770.         lea.l    PutChProc,a2
  1771.         lea.l    SpeedText90,a3        ;Destination
  1772.         lib    Exec,RawDoFmt
  1773.  
  1774.         lea.l    CurrentText1,a0
  1775.         bsr    Printer
  1776.  
  1777.         tst.l    Speed
  1778.         beq    GiveSettings0.1
  1779.         lea.l    SpeedText90,a0
  1780.         bsr    Printer
  1781.         bra    GiveSettings0.2
  1782.  
  1783. GiveSettings0.1: lea.l    DefText1,a0
  1784.         bsr    Printer
  1785.  
  1786. GiveSettings0.2: lea.l    CurrentText2,a0
  1787.         bsr    Printer
  1788.  
  1789.         tst.w    LocalEcho
  1790.         bne    GiveSettings1
  1791.         bsr    Nope
  1792.         bra    GiveSettings2
  1793. GiveSettings1:    bsr    Yep
  1794.  
  1795. GiveSettings2:    lea.l    CurrentText7,a0
  1796.         bsr    Printer
  1797.  
  1798.         lea.l    CurrentText3,a0
  1799.         bsr    Printer
  1800.  
  1801.         move.b    CRTranslate,d0
  1802.         bsr    GiveNSA
  1803.  
  1804.         lea.l    CurrentText4,a0
  1805.         bsr    Printer
  1806.  
  1807.         move.b    LFTranslate,d0
  1808.         bsr    GiveNSA
  1809.  
  1810.         lea.l    CurrentText7,a0
  1811.         bsr    Printer
  1812.  
  1813.         lea.l    CurrentText5,a0
  1814.         bsr    Printer
  1815.  
  1816.         move.b    CRTranslateIn,d0
  1817.         bsr    GiveNSA
  1818.  
  1819.         lea.l    CurrentText6,a0
  1820.         bsr    Printer
  1821.  
  1822.         move.b    LFTranslateIn,d0
  1823.         bsr    GiveNSA
  1824.  
  1825.         lea.l    CurrentText7,a0
  1826.         bsr    Printer
  1827.  
  1828.         lea.l    CurrentText8,a0
  1829.         bsr    Printer
  1830.  
  1831.         cmp.b    #7,DataBits
  1832.         bne    GiveSettings3
  1833.         lea.l    SevenText1,a0
  1834.         bsr    Printer
  1835.         bra    GiveSettings4
  1836. GiveSettings3:    cmp.b    #8,DataBits
  1837.         bne    GiveSettings3.1
  1838.         lea.l    EightText1,a0
  1839.         bsr    Printer
  1840.         bra    GiveSettings4
  1841. GiveSettings3.1: lea.l    DefText1,a0
  1842.         bsr    Printer
  1843.  
  1844. GiveSettings4:    lea.l    CurrentText9,a0
  1845.         bsr    Printer
  1846.  
  1847.         cmp.b    #1,StopBits
  1848.         bne    GiveSettings5
  1849.         lea.l    OneText1,a0
  1850.         bsr    Printer
  1851.         bra    GiveSettings6
  1852. GiveSettings5:    cmp.b    #2,StopBits
  1853.         bne    GiveSettings5.1
  1854.         lea.l    TwoText1,a0
  1855.         bsr    Printer
  1856.         bra    GiveSettings6
  1857. GiveSettings5.1: lea.l    DefText1,a0
  1858.         bsr    Printer
  1859.  
  1860. GiveSettings6:    lea.l    CurrentText7,a0
  1861.         bsr    Printer
  1862.  
  1863.         lea.l    CurrentText9.1,a0
  1864.         bsr    Printer
  1865.  
  1866.         tst.b    SwapBSDEL
  1867.         bne    GiveSettings7
  1868.         bsr    Nope
  1869.         bra    GiveSettings8
  1870. GiveSettings7:    bsr    Yep
  1871.  
  1872. GiveSettings8:    lea.l    CurrentText9.11,a0
  1873.         bsr    Printer
  1874.  
  1875.         tst.b    UseANSI
  1876.         bne    GiveSettings9
  1877.         bsr    Nope
  1878.         bra    GiveSettings10
  1879. GiveSettings9:    bsr    Yep
  1880.  
  1881. GiveSettings10:    lea.l    CurrentText7,a0
  1882.         bsr    Printer
  1883.  
  1884.         lea.l    CurrentText9.12,a0
  1885.         bsr    Printer
  1886.  
  1887.         tst.b    CursorRemap
  1888.         bne    GiveSettings11
  1889.         bsr    Nope
  1890.         bra    GiveSettings12
  1891. GiveSettings11:    bsr    Yep
  1892.  
  1893. GiveSettings12:    lea.l    CurrentText7,a0
  1894.         bsr    Printer
  1895.  
  1896.         lea.l    CurrentText9.2,a0
  1897.         bsr    Printer
  1898.  
  1899.         clr.w    CPAssignText
  1900.         clr.l    CTRLPASCII
  1901.         move.b    CPAssign,CPAssignText+1
  1902.         lea.l    fstrl4,a0        ;HEX->ASCII
  1903.         lea.l    CPAssignText,a1        ;Number2Print
  1904.         lea.l    PutChProc,a2
  1905.         lea.l    CTRLPASCII,a3        ;Destination
  1906.         lib    Exec,RawDoFmt
  1907.  
  1908.         lea.l    CTRLPASCII,a0
  1909.         bsr    Printer
  1910.  
  1911.         lea.l    CRLFText1,a0
  1912.         bsr    Printer
  1913.  
  1914.         lea.l    CurrentText9.3,a0
  1915.         bsr    Printer
  1916.  
  1917.         lea.l    ULProgram,a0
  1918.         bsr    Printer
  1919.  
  1920.         lea.l    CurrentText9.4,a0
  1921.         bsr    Printer
  1922.  
  1923.         lea.l    DLProgram,a0
  1924.         bsr    Printer
  1925.  
  1926.         lea.l    CurrentText9.5,a0
  1927.         bsr    Printer
  1928.  
  1929.         lea.l    ULDir,a0
  1930.         bsr    Printer
  1931.  
  1932.         lea.l    CurrentText9.6,a0
  1933.         bsr    Printer
  1934.  
  1935.         lea.l    DLDir,a0
  1936.         bsr    Printer
  1937.  
  1938.         lea.l    CRLFText1,a0
  1939.         bsr    Printer
  1940.  
  1941.         lea.l    CurrentText10,a0
  1942.         bsr    Printer
  1943.  
  1944.         lea.l    SerDevNBuffer1,a0
  1945.         bsr    Printer
  1946.  
  1947.         lea.l    CurrentText11,a0
  1948.         bsr    Printer
  1949.  
  1950.         lea.l    fstrl3,a0        ;HEX->ASCII
  1951.         lea.l    SerUnit,a1        ;Number2Print
  1952.         lea.l    PutChProc,a2
  1953.         lea.l    CurrentText12,a3    ;Destination
  1954.         lib    Exec,RawDoFmt
  1955.  
  1956.         lea.l    CurrentText12,a0
  1957.         bsr    Printer
  1958.  
  1959.         lea.l    CurrentText13,a0
  1960.         bsr    Printer
  1961.  
  1962.         lea.l    FileNameBuf1,a0
  1963.         bsr    Printer
  1964.  
  1965.         lea.l    CRLFText1,a0
  1966.         bsr    Printer
  1967.  
  1968.         rts
  1969.  
  1970. GiveStats:    lea.l    fstrl1,a0        ;HEX->ASCII
  1971.         lea.l    Received,a1        ;Number2Print
  1972.         lea.l    PutChProc,a2
  1973.         lea.l    ReceivedText1,a3    ;Destination
  1974.         lib    Exec,RawDoFmt
  1975.  
  1976.         lea.l    fstrl2,a0        ;HEX->ASCII
  1977.         lea.l    Sent,a1            ;Number2Print
  1978.         lea.l    PutChProc,a2
  1979.         lea.l    SentText1,a3        ;Destination
  1980.         lib    Exec,RawDoFmt
  1981.  
  1982.         lea.l    StatsText1,a0
  1983.         bsr    Printer
  1984.         lea.l    ReceivedText1,a0
  1985.         bsr    Printer
  1986.         lea.l    SentText1,a0
  1987.         bsr    Printer
  1988.         lea.l    CRLFText1,a0
  1989.         bsr    Printer
  1990.         rts
  1991.  
  1992. PrintEntries:    tst.b    DialPrefix
  1993.         beq    PrintEntries1
  1994.         lea.l    PrefixText1,a0
  1995.         bsr    Printer
  1996.         lea.l    DialPrefix,a0
  1997.         bsr    Printer
  1998.         lea.l    CRLFText1,a0
  1999.         bsr    Printer
  2000. PrintEntries1:    tst.b    Entry1
  2001.         beq    PrintEntries2
  2002.         lea.l    EntryText1,a0
  2003.         bsr    Printer
  2004.         lea.l    Entry1,a0
  2005.         bsr    Printer
  2006.         lea.l    CRLFText1,a0
  2007.         bsr    Printer
  2008. PrintEntries2:    tst.b    Entry2
  2009.         beq    PrintEntries3
  2010.         lea.l    EntryText2,a0
  2011.         bsr    Printer
  2012.         lea.l    Entry2,a0
  2013.         bsr    Printer
  2014.         lea.l    CRLFText1,a0
  2015.         bsr    Printer
  2016. PrintEntries3:    tst.b    Entry3
  2017.         beq    PrintEntries4
  2018.         lea.l    EntryText3,a0
  2019.         bsr    Printer
  2020.         lea.l    Entry3,a0
  2021.         bsr    Printer
  2022.         lea.l    CRLFText1,a0
  2023.         bsr    Printer
  2024. PrintEntries4:    tst.b    Entry4
  2025.         beq    PrintEntries5
  2026.         lea.l    EntryText4,a0
  2027.         bsr    Printer
  2028.         lea.l    Entry4,a0
  2029.         bsr    Printer
  2030.         lea.l    CRLFText1,a0
  2031.         bsr    Printer
  2032. PrintEntries5:    tst.b    Entry5
  2033.         beq    PrintEntries6
  2034.         lea.l    EntryText5,a0
  2035.         bsr    Printer
  2036.         lea.l    Entry5,a0
  2037.         bsr    Printer
  2038.         lea.l    CRLFText1,a0
  2039.         bsr    Printer
  2040. PrintEntries6:    tst.b    Entry6
  2041.         beq    PrintEntries7
  2042.         lea.l    EntryText6,a0
  2043.         bsr    Printer
  2044.         lea.l    Entry6,a0
  2045.         bsr    Printer
  2046.         lea.l    CRLFText1,a0
  2047.         bsr    Printer
  2048. PrintEntries7:    tst.b    Entry7
  2049.         beq    PrintEntries8
  2050.         lea.l    EntryText7,a0
  2051.         bsr    Printer
  2052.         lea.l    Entry7,a0
  2053.         bsr    Printer
  2054.         lea.l    CRLFText1,a0
  2055.         bsr    Printer
  2056. PrintEntries8:    tst.b    Entry8
  2057.         beq    PrintEntries9
  2058.         lea.l    EntryText8,a0
  2059.         bsr    Printer
  2060.         lea.l    Entry8,a0
  2061.         bsr    Printer
  2062.         lea.l    CRLFText1,a0
  2063.         bsr    Printer
  2064. PrintEntries9:    tst.b    Entry9
  2065.         beq    PrintEntries10
  2066.         lea.l    EntryText9,a0
  2067.         bsr    Printer
  2068.         lea.l    Entry9,a0
  2069.         bsr    Printer
  2070.         lea.l    CRLFText1,a0
  2071.         bsr    Printer
  2072. PrintEntries10:    tst.b    Entry10
  2073.         beq    PrintEntries11
  2074.         lea.l    EntryText10,a0
  2075.         bsr    Printer
  2076.         lea.l    Entry10,a0
  2077.         bsr    Printer
  2078.         lea.l    CRLFText1,a0
  2079.         bsr    Printer
  2080. PrintEntries11:    rts
  2081.  
  2082. PrintSelect:    lea.l    SelectedText1,a0
  2083.         bsr    Printer
  2084.         lea.l    SelectText1,a0
  2085.         bsr    Printer
  2086.         tst.b    EntrySelected1
  2087.         beq    PrintSelect1
  2088.         lea.l    SelectText11,a0
  2089.         bsr    Printer
  2090.         bra    PrintSelect2
  2091. PrintSelect1:    lea.l    SelectText12,a0
  2092.         bsr    Printer
  2093. PrintSelect2:    lea.l    SelectText2,a0
  2094.         bsr    Printer
  2095.         tst.b    EntrySelected2
  2096.         beq    PrintSelect3
  2097.         lea.l    SelectText11,a0
  2098.         bsr    Printer
  2099.         bra    PrintSelect4
  2100. PrintSelect3:    lea.l    SelectText12,a0
  2101.         bsr    Printer
  2102. PrintSelect4:    lea.l    SelectText3,a0
  2103.         bsr    Printer
  2104.         tst.b    EntrySelected3
  2105.         beq    PrintSelect5
  2106.         lea.l    SelectText11,a0
  2107.         bsr    Printer
  2108.         bra    PrintSelect6
  2109. PrintSelect5:    lea.l    SelectText12,a0
  2110.         bsr    Printer
  2111. PrintSelect6:    lea.l    SelectText4,a0
  2112.         bsr    Printer
  2113.         tst.b    EntrySelected4
  2114.         beq    PrintSelect7
  2115.         lea.l    SelectText11,a0
  2116.         bsr    Printer
  2117.         bra    PrintSelect8
  2118. PrintSelect7:    lea.l    SelectText12,a0
  2119.         bsr    Printer
  2120. PrintSelect8:    lea.l    SelectText5,a0
  2121.         bsr    Printer
  2122.         tst.b    EntrySelected5
  2123.         beq    PrintSelect9
  2124.         lea.l    SelectText11,a0
  2125.         bsr    Printer
  2126.         bra    PrintSelect10
  2127. PrintSelect9:    lea.l    SelectText12,a0
  2128.         bsr    Printer
  2129. PrintSelect10:    lea.l    SelectText6,a0
  2130.         bsr    Printer
  2131.         tst.b    EntrySelected6
  2132.         beq    PrintSelect11
  2133.         lea.l    SelectText11,a0
  2134.         bsr    Printer
  2135.         bra    PrintSelect12
  2136. PrintSelect11:    lea.l    SelectText12,a0
  2137.         bsr    Printer
  2138. PrintSelect12:    lea.l    SelectText7,a0
  2139.         bsr    Printer
  2140.         tst.b    EntrySelected7
  2141.         beq    PrintSelect13
  2142.         lea.l    SelectText11,a0
  2143.         bsr    Printer
  2144.         bra    PrintSelect14
  2145. PrintSelect13:    lea.l    SelectText12,a0
  2146.         bsr    Printer
  2147. PrintSelect14:    lea.l    SelectText8,a0
  2148.         bsr    Printer
  2149.         tst.b    EntrySelected8
  2150.         beq    PrintSelect15
  2151.         lea.l    SelectText11,a0
  2152.         bsr    Printer
  2153.         bra    PrintSelect16
  2154. PrintSelect15:    lea.l    SelectText12,a0
  2155.         bsr    Printer
  2156. PrintSelect16:    lea.l    SelectText9,a0
  2157.         bsr    Printer
  2158.         tst.b    EntrySelected9
  2159.         beq    PrintSelect17
  2160.         lea.l    SelectText11,a0
  2161.         bsr    Printer
  2162.         bra    PrintSelect18
  2163. PrintSelect17:    lea.l    SelectText12,a0
  2164.         bsr    Printer
  2165. PrintSelect18:    lea.l    SelectText0,a0
  2166.         bsr    Printer
  2167.         tst.b    EntrySelected0
  2168.         beq    PrintSelect19
  2169.         lea.l    SelectText13,a0
  2170.         bsr    Printer
  2171.         bra    PrintSelect20
  2172. PrintSelect19:    lea.l    SelectText14,a0
  2173.         bsr    Printer
  2174. PrintSelect20:    lea.l    CRLFText1,a0
  2175.         bsr    Printer
  2176.         rts
  2177.  
  2178. LoadPrefsFile:    lea.l    FileNameBuf1,a0
  2179.         move.l    a0,d1
  2180.         move.l    #MODE_OLDFILE,d2
  2181.         lib    Dos,Open
  2182.         move.l    d0,PrefsFile
  2183.         bne    LoadPrefsFile1
  2184.  
  2185.         lea.l    FileErrorText1,a0
  2186.         bsr    Printer
  2187.         lea.l    FileNameBuf1,a0
  2188.         bsr    Printer
  2189.         lea.l    CRLFText1,a0
  2190.         bsr    Printer
  2191.         bra    LoadPF_ERR1
  2192.  
  2193. LoadPrefsFile1:    move.l    PrefsFile,d1
  2194.         lea.l    PrefsStart,a0
  2195.         move.l    a0,d2
  2196.         move.l    #2,d3
  2197.         lib    Dos,Read
  2198.         cmp.l    #2,d0
  2199.         beq    LoadPrefsFile2
  2200.  
  2201.         lea.l    FileErrorText2,a0
  2202.         bsr    Printer
  2203.         bra    LoadPF_ERR1
  2204.  
  2205. LoadPrefsFile2: cmp.w    #'ST',PrefsStart
  2206.         beq    LoadPrefsFile3
  2207.  
  2208.         lea.l    FileErrorText3,a0
  2209.         bsr    Printer
  2210.         bra    LoadPF_ERR1
  2211.  
  2212. LoadPrefsFile3:    move.l    PrefsFile,d1
  2213.         lea.l    SerDevNBuffer1,a0
  2214.         move.l    a0,d2
  2215.         move.l    #PrefsSize-2,d3
  2216.         lib    Dos,Read
  2217.         cmp.l    #PrefsSize-2,d0
  2218.         beq    LoadPrefsFile4
  2219.  
  2220.         lea.l    FileErrorText2,a0
  2221.         bsr    Printer
  2222.         bra    LoadPF_ERR2
  2223.  
  2224. LoadPrefsFile4:
  2225. LoadPF_OUT:    bsr    KillPFile
  2226.         move.l    #-1,d0
  2227.         rts
  2228. LoadPF_ERR1:    clr.l    d0
  2229.         rts
  2230. LoadPF_ERR2:    bsr    KillPFile
  2231.         clr.l    d0
  2232.         rts
  2233.  
  2234. SavePrefsFile:    lea.l    FileNameBuf1,a0
  2235.         move.l    a0,d1
  2236.         move.l    #MODE_NEWFILE,d2
  2237.         lib    Dos,Open
  2238.         move.l    d0,PrefsFile
  2239.         bne    SavePrefsFile1
  2240.  
  2241.         lea.l    FileErrorText1,a0
  2242.         bsr    Printer
  2243.         lea.l    FileNameBuf1,a0
  2244.         bsr    Printer
  2245.         lea.l    CRLFText1,a0
  2246.         bsr    Printer
  2247.         bra    SavePF_ERR1
  2248.  
  2249. SavePrefsFile1:    move.w    #'ST',PrefsStart
  2250.  
  2251.         move.l    PrefsFile,d1
  2252.         lea.l    PrefsStart,a0
  2253.         move.l    a0,d2
  2254.         move.l    #PrefsSize,d3
  2255.         lib    Dos,Write
  2256.         cmp.l    #PrefsSize,d0
  2257.         beq    SavePF_OUT
  2258.  
  2259.         lea.l    FileErrorText4,a0
  2260.         bsr    Printer
  2261.         bra    SavePF_ERR2
  2262.  
  2263. SavePF_OUT:    bsr    KillPFile
  2264.         move.l    #-1,d0
  2265.         rts
  2266. SavePF_ERR1:    clr.l    d0
  2267.         rts
  2268. SavePF_ERR2:    bsr    KillPFile
  2269.         clr.l    d0
  2270.         rts
  2271.  
  2272. KillPFile:    move.l    PrefsFile,d1
  2273.         beq    KillPFile1
  2274.         lib    Dos,Close
  2275.         clr.l    PrefsFile
  2276. KillPFile1:    rts
  2277.  
  2278. ShutDown:    bsr    CloseSerial
  2279. ShutDown9000:    move.l    IORRequest,a0
  2280.         lib    Exec,DeleteIORequest
  2281.  
  2282.         move.l    SRRPort,a0
  2283.         lib    Exec,DeleteMsgPort
  2284.  
  2285.         move.l    IOWRequest,a0
  2286.         lib    Exec,DeleteIORequest
  2287.  
  2288.         move.l    SWRPort,a0
  2289.         lib    Exec,DeleteMsgPort
  2290.  
  2291.         move.l    _stdin,d1
  2292.         beq    ShutDown8000
  2293.         move.l    #FALSE,d2
  2294.         lib    Dos,SetMode
  2295.  
  2296. ShutDown8000:    bsr    KillPFile
  2297.  
  2298.         move.l    CaptureFile,d1
  2299.         beq    ShutDown7000
  2300.         lib    Dos,Close
  2301. ShutDown7000:
  2302. ShutDown1000:    closlib    Dos
  2303.         pull    d2-d7/a2-a6
  2304.         clr.l    d0
  2305.         rts
  2306.  
  2307. ;open serial.device
  2308.  
  2309. OpenSerial:    lea.l    SerDevNBuffer1,a0
  2310.         move.l    SerUnit,d0
  2311.         move.l    IORRequest,a1
  2312.         move.b    #SERF_SHARED,IO_SERFLAGS(a1)
  2313.         move.l    Speed,IO_BAUD(a1)
  2314.         move.b    DataBits,IO_READLEN(a1)
  2315.         move.b    DataBits,IO_WRITELEN(a1)
  2316.         move.b    StopBits,IO_STOPBITS(a1)
  2317.         clr.l    d1                ;no flags
  2318.         lib    Exec,OpenDevice
  2319.         tst.l    d0
  2320.         bne    NoSerial
  2321.         move.w    #$1,SerOpen        ;just to tell if open
  2322.  
  2323. ;Copy info from one req to the other
  2324.  
  2325.         move.l    IORRequest,a0
  2326.         move.l    IOWRequest,a1
  2327.         move.l    IO_DEVICE(a0),IO_DEVICE(a1)
  2328.         move.l    IO_UNIT(a0),IO_UNIT(a1)
  2329.         add.l    #48,a0            ;get start of ioser
  2330.         add.l    #48,a1
  2331.         move.l    #34,d0
  2332.         lib    Exec,CopyMem
  2333.  
  2334.         move.l    #BUFLEN,d0    ;just so the request is used
  2335.         move.l    #0,d1
  2336.         bsr    Read
  2337.  
  2338.         clr.l    d0
  2339.         rts
  2340.  
  2341. CloseSerial:    tst.w    SerOpen
  2342.         beq    CloseSerial1
  2343.         bsr    ClearSer
  2344.         move.l    IORRequest,a1
  2345.         lib    Exec,CloseDevice
  2346.         clr.w    SerOpen
  2347. CloseSerial1:    rts
  2348.  
  2349. ;Get length of text in given address
  2350. ;
  2351. ;Input a1 = Address of null terminated text string
  2352. ;
  2353. ;Result d0 = Length
  2354.  
  2355. GetLength:    clr.l    d0
  2356.         cmp.l    #$00,a1        ;fixes enforcer hit
  2357.         beq    GetLength_OUT
  2358. GetLength2:    add.l    #1,d0
  2359.         tst.b    (a1)+
  2360.         bne    GetLength2
  2361.         sub.l    #1,d0        ;don't include NULL
  2362. GetLength_OUT:    rts
  2363.  
  2364.  
  2365. ;Get line length of text in given address, including LF
  2366. ;
  2367. ;Input a0 = Address of LF terminated text string
  2368. ;
  2369. ;Result d1 = Length
  2370.  
  2371. GetLLength:    push    a0
  2372.         clr.l    d1
  2373.         cmp.l    #$00,a0        ;fixes enforcer hit
  2374.         beq    GetLLength_OUT
  2375. GetLLength2:    add.l    #1,d1
  2376.         cmp.b    #10,(a0)+
  2377.         bne    GetLLength2
  2378. GetLLength_OUT:    pull    a0
  2379.         rts
  2380.  
  2381. ;Finds a string in another string
  2382. ;
  2383. ;Inputs    a0 = Pointer to string1 (from what to find)
  2384. ;    d0 = Word (what to search for)
  2385. ;
  2386. ;Result    d0 = 0 if not found
  2387.  
  2388. FindWord:    tst.b    (a0)
  2389.         beq    FindWord1
  2390.         cmp.w    (a0),d0
  2391.         beq    FindWord2
  2392.         add.l    #1,a0
  2393.         bra    FindWord
  2394. FindWord1:    clr.l    d0        ;keep right before rts
  2395.         rts
  2396. FindWord2:    move.l    #-1,d0        ;keep right before rts
  2397.         rts
  2398.  
  2399. ;Input a0 = Address of text string
  2400. ;
  2401. ;Result d0 = Length
  2402.  
  2403. ConvASCII:    clr.l    d0
  2404.         clr.l    d1
  2405.         cmp.b    #' ',(a0)
  2406.         bne    ConvASCII2
  2407.         add.l    #1,a0
  2408. ConvASCII2:    move.b    (a0),d1
  2409.         cmp.b    #'0',d1
  2410.         bcs    ConvASCII_OUT
  2411.         cmp.b    #'9',d1
  2412.         bhi    ConvASCII_OUT
  2413.         sub.b    #'0',d1
  2414.         push    d1/a0
  2415.         move.l    #10,d1
  2416.         lib    Utility,UMult32
  2417.         pull    d1/a0
  2418.         add.l    d1,d0
  2419.         add.l    #1,a0
  2420.         bra    ConvASCII2
  2421. ConvASCII_OUT:    rts
  2422.  
  2423. MakeCmdString:    lea.l    FileNameBuf3,a0
  2424.         lea.l    ULProgram,a4
  2425.         move.l    a4,a5
  2426.         add.l    #128,a5
  2427.         bsr    MCS1
  2428.  
  2429.         move.b    #' ',(a0)+
  2430.  
  2431.         lea.l    FileNameBuf2,a4
  2432.         move.l    a4,a5
  2433.         add.l    #128,a5
  2434.         bsr    MCS1
  2435.  
  2436. ;        lea.l    FileNameBuf3,a0        ;DEBUG
  2437. ;        bsr    Printer            ;DEBUG
  2438.         rts
  2439.  
  2440. MCS1:        move.b    (a4)+,(a0)+
  2441.         tst.b    (a4)
  2442.         beq    MCS2
  2443.         cmp.l    a4,a5
  2444.         bne    MCS1
  2445. MCS2:        rts
  2446.  
  2447. ;Error etc. messages
  2448.  
  2449. Usage:        lea.l    UsageText1,a0
  2450.         bsr    Printer
  2451.         bra    ShutDown
  2452.  
  2453. NoUtility:    lea.l    NoUtiText1,a0
  2454.         bsr    Printer
  2455.         bra    ShutDown
  2456.  
  2457. NoDos:        add.l    #8,sp
  2458.         pull    d2-d7/a2-a6
  2459.         move.l    #RETURN_FAIL,d0
  2460.         rts
  2461.  
  2462. NotInteractive:    add.l    #8,sp
  2463.         lea.l    NotIntText1,a0
  2464.         bsr    Printer
  2465.         bra    ShutDown
  2466.  
  2467. NoMsgPort:    lea.l    NoMsgPortText1,a0
  2468.         bsr    Printer
  2469.         bra    ShutDown
  2470.  
  2471. NoIOReq:    lea.l    NoIOReqText1,a0
  2472.         bsr    Printer
  2473.         bra    ShutDown
  2474.  
  2475. NoSerial:    lea.l    NoSerialText1,a0
  2476.         bsr    Printer
  2477.         lea.l    SerDevNBuffer1,a0
  2478.         bsr    Printer
  2479.         lea.l    CRLFText1,a0
  2480.         bsr    Printer
  2481.         move.l    #-1,d0
  2482.         rts
  2483.  
  2484. Printer:    printa    a0,_stdout
  2485.         rts
  2486.  
  2487. PutChProc:    tst.b    d0
  2488.         beq    PutChProc_OUT
  2489.         move.b    d0,(a3)+
  2490. PutChProc_OUT:    rts
  2491.  
  2492. ;Structures
  2493.  
  2494. ;lib stuff
  2495.  
  2496.         libnames
  2497.  
  2498. ;Other stuff, part I
  2499.  
  2500. SRRPort:    dc.l    0
  2501. IORRequest:    dc.l    0
  2502. SWRPort:    dc.l    0
  2503. IOWRequest:    dc.l    0
  2504. _stdout:    dc.l    0
  2505. _stdin:        dc.l    0
  2506. Sent:        dc.l    0            ;Count sent chars
  2507. Received:    dc.l    0            ;Count reveived chars
  2508. PrefsFile:    dc.l    0
  2509.  
  2510. ;Other stuff part II
  2511.  
  2512. OldLock:    dc.l    0        ;dir we started from
  2513. ULLock:        dc.l    0        ;uload dir
  2514. DLLock:        dc.l    0        ;dload dir
  2515. CaptureFile:    dc.l    0        ;Capture everything here..
  2516.  
  2517. EntrySelected1:    dc.b    0
  2518. EntrySelected2:    dc.b    0
  2519. EntrySelected3:    dc.b    0
  2520. EntrySelected4:    dc.b    0
  2521. EntrySelected5:    dc.b    0
  2522. EntrySelected6:    dc.b    0
  2523. EntrySelected7:    dc.b    0
  2524. EntrySelected8:    dc.b    0
  2525. EntrySelected9:    dc.b    0
  2526. EntrySelected0:    dc.b    0
  2527. ModifyMode:    dc.w    0    ;0=No, 1=Yes
  2528. CPAssignText:    dc.w    0
  2529.  
  2530. ;Serial device stuff
  2531.  
  2532. SerOpen:    dc.w    0
  2533.  
  2534. ;Strings, error
  2535.  
  2536. BreakText1:    dc.b    "***Break",13,10,0
  2537. NotIntText1:    dc.b    "ERROR: Please don't redirect input!",13,10,0
  2538. NoUtiText1:    dc.b    "ERROR: Couldn't open utility.library!",13,10,0
  2539. NoMsgPortText1:    dc.b    "ERROR: Couldn't get message port!",13,10,0
  2540. NoIOReqText1:    dc.b    "ERROR: Couldn't get SerialIOReq!",13,10,0
  2541. NoSerialText1:    dc.b    "ERROR: Couldn't open ",0
  2542. FileErrorText1:    dc.b    13,10,"ERROR: Couldn't open file: ",0
  2543. FileErrorText2:    dc.b    "ERROR: Couldn't read file!",13,10,0
  2544. FileErrorText3:    dc.b    "ERROR: Incorrect filetype!",13,10,0
  2545. FileErrorText4:    dc.b    "ERROR: Couldn't write to file!",13,10,0
  2546. NoULDLProgText1: dc.b    13,10,"ERROR: No transfer program specified!",13,10,0
  2547. NoULDirText1:    dc.b    13,10,"ERROR: Couldn't access upload directory!",13,10,0
  2548. NoDLDirText1:    dc.b    13,10,"ERROR: Couldn't access download directory!",13,10,0
  2549. CaptureErrorText1:    dc.b    13,10,"ERROR: Couldn't open capture!",13,10,0
  2550. CaptureErrorText2:    dc.b    13,10,"ERROR: Capture already open!",13,10,0
  2551.  
  2552. ;Strings
  2553.  
  2554. StartText1:    dc.b    "Welcome to ShellTerm. Use CTRL-P to get menu.",13,10,0
  2555.  
  2556. ;Main menu
  2557.  
  2558. MenuText1:    dc.b    13,10,"ShellTerm menu. Please choose item:",13,10
  2559.         dc.b    13,10,"(S) Statistics      (C) Clear statistics"
  2560.         dc.b    13,10,"(B) Send BREAK      (O) Send CTRL-P"
  2561.         dc.b    13,10,"(F) Reset font      (X) Clear screen"
  2562.         dc.b    13,10,"(R) Reset modem     (H) Hangup line"
  2563.         dc.b    13,10,"(+) Upload          (-) Download"
  2564.         dc.b    13,10,"(D) Dialer          (P) Preferences"
  2565.         dc.b    13,10,"(L) Open capture    (K) Close capture",13,10
  2566.         dc.b    13,10,"(?) Information"
  2567.         dc.b    13,10,"(Q) Quit ShellTerm  (E) Exit menus",13,10
  2568.         dc.b    13,10,"Selection: ",0
  2569. InfoText1:    dc.b    "Information",13,10,0
  2570. BreakText2:    dc.b    "Break sent",13,10,0
  2571. CTRL_PText1:    dc.b    "CTRL-P sent",13,10,0
  2572. ExitText1:    dc.b    "Exit",13,10
  2573. TerminalText1:    dc.b    13,10,"Terminal mode active:",13,10,0
  2574. ResetFText1:    dc.b    "Reset font",13,10,0
  2575. QuitText1:    dc.b    "Quit",13,10,0
  2576. StatsText1:    dc.b    "Statistics:",13,10,0
  2577. StatsText2:    dc.b    "Statistics",13,10,13,10,0
  2578. DialerText1:    dc.b    "Dialer",13,10,0
  2579. PrefsText1:    dc.b    "Preferences",13,10,0
  2580. ULText1:    dc.b    "Upload program (SZ)",13,10
  2581.         dc.b    "Program name: ",0
  2582. ULText2:    dc.b    "Upload file",13,10
  2583.         dc.b    "File to upload: ",0
  2584. ULText3:    dc.b    "Uploading file, please wait...",13,10,0
  2585. ULText5:    dc.b    "Upload dir",13,10
  2586.         dc.b    "Directory: ",0
  2587. DLText1:    dc.b    "Download program (RZ)",13,10
  2588.         dc.b    "Program name: ",0
  2589. DLText2:    dc.b    "Downloading file, please wait...",13,10,0
  2590. DLText5:    dc.b    "Download dir",13,10
  2591.         dc.b    "Directory: ",0
  2592. OpenCaptureText1: dc.b    "Open capture",13,10
  2593.         dc.b    "Name of file: ",0
  2594. CloseCaptureText1: dc.b    "Close capture",13,10,0
  2595.  
  2596. ReceivedText1:    dc.b    "                            ",00,00,0    ;max of 4294967295
  2597. ;            "   4294967295 bytes received",CR,LF
  2598. SentText1:    dc.b    "                        ",00,00,0    ;max of 4294967295
  2599. ;            "   4294967295 bytes sent",CR,LF
  2600. fstrl1:        dc.b    "   %10.ld bytes received",13,10,0
  2601. fstrl2:        dc.b    "   %10.ld bytes sent",0
  2602. ClearText1:    dc.b    "Cleared",13,10,0
  2603. ClearText3:    dc.b    "Reset",13,10,0
  2604. CRLFText1:    dc.b    CR,LF,0
  2605. ResetText1:    dc.b    "Reset",13,10,0
  2606. ResetText2:    dc.b    "ATZ",13,10,0
  2607. HangUpText1:    dc.b    "Hangup",13,10,0
  2608. HangUpText2:    dc.b    "+++",0
  2609. HangUpText3:    dc.b    "ATH0",13,10,0
  2610. PlainText1:    dc.b    $9b,$30,$6d,$1b,$63
  2611. ClearSText1:    dc.b    $1B,$5B,$30,$3B,$30,$48,$1B,$5B,$4A,0
  2612.  
  2613. ;Preferences
  2614.  
  2615. PrefsText2:    dc.b    13,10,"ShellTerm preferences:",13,10
  2616.         dc.b    13,10,"(S)erial settings  (T)erminal settings"
  2617.         dc.b    13,10,"(R)eset settings   (V)iew settings"
  2618.         dc.b    13,10,"(L)oad prefs       (W)rite prefs"
  2619.         dc.b    13,10,"(N)ame prefsfile   (A)ssign CTRL-P"
  2620.         dc.b    13,10,"(+) Upload program (-) Download program"
  2621.         dc.b    13,10,"(U)pload dir       (D)ownload dir",13,10
  2622.         dc.b    13,10,"(M)ain menu        (E)xit menus",13,10
  2623.         dc.b    13,10,"Selection: ",0
  2624. ViewText1:    dc.b    "View settings",13,10,0
  2625. SpeedText11:    dc.b    "Serial settings",13,10,0
  2626. SpeedText13:    dc.b    "Speed",13,10,0
  2627. STerminalText1:    dc.b    "Terminal settings",13,10,0
  2628. LoadText1:    dc.b    "Load prefs",13,10,0
  2629. SaveText1:    dc.b    "Write prefs",13,10,0
  2630. AssignText1:    dc.b    "Assign CTRL-P",13,10,0
  2631. AssignText2:    dc.b    13,10,"Press key to assign CTRL-P to: ",0
  2632. EnterNText1:    dc.b    "Enter name",13,10,0
  2633. EnterNText2:    dc.b    13,10,"File name: ",0
  2634. DBitsText1:    dc.b    "Using 7 databits",13,10,0
  2635. DBitsText2:    dc.b    "Using 8 databits",13,10,0
  2636. DBitsText3:    dc.b    13,10,"ERROR: Couldn't set databits!",13,10,0
  2637. SBitsText1:    dc.b    "Using 1 stopbit",13,10,0
  2638. SBitsText2:    dc.b    "Using 2 stopbits",13,10,0
  2639. SBitsText3:    dc.b    13,10,"ERROR: Couldn't set stopbits!",13,10,0
  2640. CRTransText2:    dc.b    13,10,"(N)one, (S)trip, (A)dd LF: ",0
  2641. LFTransText2:    dc.b    13,10,"(N)one, (S)trip, (A)dd CR: ",0
  2642. AnyKeyText1:    dc.b    13,10,"Please press any key: ",0
  2643. NoneText1:    dc.b    "None",13,10,0
  2644. StripText1:    dc.b    "Strip",13,10,0
  2645. AddText1:    dc.b    "Add",13,10,0
  2646.  
  2647. STerminalText2:    dc.b    13,10,"Terminal settings:",13,10
  2648.         dc.b    13,10,"OUT: (1) CR translate   (2) LF translate"
  2649.         dc.b    13,10,"IN:  (3) CR translate   (4) LF translate"
  2650.         dc.b    13,10,"     (L)ocal echo       (S)wap DEL & BS"
  2651.         dc.b    13,10,"     (A)nsi codes       (C)ursor remap",13,10
  2652.         dc.b    13,10,"(M)ain menu   (-) Previous menu   (E)xit menus",13,10
  2653.         dc.b    13,10,"Selection: ",0
  2654. CRTransText1:    dc.b    "CR translate (OUT)",13,10,0
  2655. LFTransText1:    dc.b    "LF translate (OUT)",13,10,0
  2656. CRTransText3:    dc.b    "CR translate (IN)",13,10,0
  2657. LFTransText3:    dc.b    "LF translate (IN)",13,10,0
  2658. EchoText1:    dc.b    "Local echo enabled",13,10,0
  2659. EchoText2:    dc.b    "Local echo disabled",13,10,0
  2660. SwapText1:    dc.b    "BS & DEL swapping enabled",13,10,0
  2661. SwapText2:    dc.b    "BS & DEL swapping disabled",13,10,0
  2662. ANSIText1:    dc.b    "ANSI mode on",13,10,0
  2663. ANSIText2:    dc.b    "ANSI mode off",13,10,0
  2664. CRemapText1:    dc.b    "Cursor remap on",13,10,0
  2665. CRemapText2:    dc.b    "Cursor remap off",13,10,0
  2666.  
  2667. CurrentText1:    dc.b    13,10,"Current settings: Speed (",0
  2668. CurrentText2:    dc.b    "), Local echo (",0
  2669. CurrentText3:    dc.b    "                  CR xlate out (",0
  2670. CurrentText4:    dc.b    "), LF xlate out (",0
  2671. CurrentText5:    dc.b    "                  CR xlate in (",0
  2672. CurrentText6:    dc.b    "), LR xlate in (",0
  2673. CurrentText7:    dc.b    ")",13,10,0
  2674. CurrentText8:    dc.b    "                  Databits (",0
  2675. CurrentText9:    dc.b    "), Stopbits (",0
  2676. CurrentText9.1:    dc.b    "                  Swap BS & DEL (",0
  2677. CurrentText9.11: dc.b    "), ANSI mode (",0
  2678. CurrentText9.12: dc.b    "                  Remap cursor keys (",0
  2679. CurrentText9.2:    dc.b    13,10,"CTRL-P assigned to ASCII: ",0
  2680. CurrentText9.3:    dc.b    13,10,"Upload program  : ",0
  2681. CurrentText9.4:    dc.b    13,10,"Download program: ",0
  2682. CurrentText9.5:    dc.b    13,10,"Upload dir      : ",0
  2683. CurrentText9.6:    dc.b    13,10,"Download dir    : ",0
  2684. CurrentText10:    dc.b    13,10,"Device name: ",0
  2685. CurrentText11:    dc.b    13,10,"Unit number: ",0
  2686. CurrentText12:    dcb.b    14,0
  2687. CurrentText13:    dc.b    13,10,"Prefs file : ",0
  2688. NAText1:    dc.b    "N/A",0
  2689. DefText1:    dc.b    "Default",0
  2690. StarText1:    dc.b    "*",0
  2691. SpaceText1:    dc.b    " ",0
  2692. NText1:        dc.b    "N",0
  2693. SText1:        dc.b    "S",0
  2694. AText1:        dc.b    "A",0
  2695. OneText1:    dc.b    "1",0
  2696. TwoText1:    dc.b    "2",0
  2697. SevenText1:    dc.b    "7",0
  2698. EightText1:    dc.b    "8",0
  2699. fstrl4:        dc.b    "%d",0
  2700.  
  2701. ;Speed prefs
  2702. SpeedText1:    dc.b    13,10,"Serial settings:",13,10
  2703.         dc.b    13,10,"(1) 110 bps     (2) 300 bps"
  2704.         dc.b    13,10,"(3) 1200 bps    (4) 2400 bps"
  2705.         dc.b    13,10,"(5) 4800 bps    (6) 9600 bps"
  2706.         dc.b    13,10,"(7) 19 200 bps  (8) 38 400 bps"
  2707.         dc.b    13,10,"(9) 57 600 bps  (0) 115 200 bps"
  2708.         dc.b    13,10,"(N)ame & Unit   (R)e-open"
  2709.         dc.b    13,10,"(D)atabits      (S)topbits",13,10
  2710.         dc.b    13,10,"(M)ain menu   (-) Previous menu   (E)xit menus",13,10
  2711.         dc.b    13,10,"Selection: ",0
  2712. SpeedText12:    dc.b    13,10,"ERROR: Couldn't set that speed. Please reselect!",13,10,0
  2713. SerSetText1:    dc.b    13,10,"ERROR: Couldn't set serial parameters!",13,10,0
  2714. fstrl3:        dc.b    "%ld",0
  2715.         ds.w    0
  2716. CTRLPASCII:    dc.b    0,0,0,0,0,0
  2717. SpeedText90:    dc.b    0,0,0,0,0,0,0,0
  2718. NameText1:    dc.b    "Set device unit & name",13,10,0
  2719. NameText2:    dc.b    13,10,"Device name: ",0
  2720. NameText3:    dc.b    13,10,"Unit number: ",0
  2721. ReOpenText1:    dc.b    "Re-open device",13,10,0
  2722.  
  2723. ;Dialer stuff
  2724.  
  2725. DialerText2:    dc.b    13,10,"Auto-dialer (phonebook)",13,10
  2726.         dc.b    13,10,"Entries:",13,10,13,10,0
  2727. PrefixText1:    dc.b    "Prefix: ",0
  2728. EntryText1:    dc.b    "1) ",0
  2729. EntryText2:    dc.b    "2) ",0
  2730. EntryText3:    dc.b    "3) ",0
  2731. EntryText4:    dc.b    "4) ",0
  2732. EntryText5:    dc.b    "5) ",0
  2733. EntryText6:    dc.b    "6) ",0
  2734. EntryText7:    dc.b    "7) ",0
  2735. EntryText8:    dc.b    "8) ",0
  2736. EntryText9:    dc.b    "9) ",0
  2737. EntryText10:    dc.b    "0) ",0
  2738. DialerText3:    dc.b    13,10,"(0-9) Un/select entry  (R)elist numbers"
  2739.         dc.b    13,10,"  (S)ingle dial        (D)ial list"
  2740.         dc.b    13,10,"  (C)lear list         (A)ll"
  2741.         dc.b    13,10,"Ed(I)t mode            (P)refix",13,10
  2742.         dc.b    13,10,"  (M)ain menu          (E)xit menus",13,10
  2743. SelectionText1:    dc.b    13,10,"Selection: ",0
  2744. DialText1:    dc.b    "Dial list",13,10,0
  2745. MainMenuText1:    dc.b    "Main menu",13,10,0
  2746. SingleText1:    dc.b    "Dial number",13,10,0
  2747. SingleText2:    dc.b    "Number to dial: ",0
  2748. RelistText1:    dc.b    "Relist",13,10,13,10,0
  2749. EntryTextXIV:    dc.b    "Entry",13,10,0
  2750. ClearText2:    dc.b    "Clear",13,10,0
  2751. AllText1:    dc.b    "All",13,10,0
  2752. HelpText1:    dc.b    "Help",13,10,0
  2753. ModifyText1:    dc.b    "Edit mode on",13,10,0
  2754. ModifyText2:    dc.b    "Edit mode off",13,10,0
  2755. EditEntryText1:    dc.b    "Edit entry",13,10,0
  2756. EditEntryText2:    dc.b    13,10,"Enter number: ",0
  2757. EditEntryText3:    dc.b    "Edit prefix",13,10,0
  2758. EditEntryText4:    dc.b    13,10,"Enter prefix: ",0
  2759. DialingText1:    dc.b    13,10,"Dialing: ",0
  2760. DialText2:    dc.b    13,10,"[Space] to skip, [Backspace] to remove this entry, [Escape] to quit",13,10,0
  2761. ConnectText1:    dc.b    "Connection established",13,10,0
  2762. BusyText1:    dc.b    "Busy",13,10,0
  2763. SkippedText1:    dc.b    "Skipping entry",13,10,0
  2764. CancelledText1:    dc.b    "Quitting",13,10,0
  2765. RemoveText1:    dc.b    "Removing this entry",13,10,0
  2766. EmptyText1:    dc.b    13,10,"List is empty",13,10,0
  2767. SelectedText1:    dc.b    13,10,"Entries selected:",13,10,0
  2768. SelectText1:    dc.b    "1 (",0
  2769. SelectText2:    dc.b    "2 (",0
  2770. SelectText3:    dc.b    "3 (",0
  2771. SelectText4:    dc.b    "4 (",0
  2772. SelectText5:    dc.b    "5 (",0
  2773. SelectText6:    dc.b    "6 (",0
  2774. SelectText7:    dc.b    "7 (",0
  2775. SelectText8:    dc.b    "8 (",0
  2776. SelectText9:    dc.b    "9 (",0
  2777. SelectText0:    dc.b    "0 (",0
  2778. SelectText11:    dc.b    "*) ",0
  2779. SelectText12:    dc.b    " ) ",0
  2780. SelectText13:    dc.b    "*)",0
  2781. SelectText14:    dc.b    " )",0
  2782.  
  2783. ;Strings, names
  2784.  
  2785. STVersion:    dc.b    "$VER: "
  2786. UsageText1:    dc.b    "ShellTerm 1.09 (6.9.92) (C)opyright Tomi Blinnikka 1992",13,10,13,10
  2787. ;        dc.b    10,"           !!! BETA TESTER VERSION !!!",13,10,13,10,13,10
  2788.         dc.b    "USAGE: ShellTerm [FileName]",13,10,13,10
  2789.         dc.b    "       Where: [FileName] is the prefs/phonebook file",13,10
  2790.         dc.b    "       Default [FileName] is S:ShellTerm.PREFS",13,10,13,10
  2791.         dc.b    "Use current shell as a terminal program.",13,10
  2792.         dc.b    "See docs for more information.",13,10,0
  2793. AuthorText1:    dc.b    13,10,"Name    : ShellTerm",13,10
  2794.         dc.b    "Version : 1.09 (6.9.92)",13,10
  2795.         dc.b    "Author  : Tomi Blinnikka",13,10,13,10
  2796.         dc.b    "(C)opyright Tomi Blinnikka 1992",13,10,0
  2797.         ds.l    0
  2798.  
  2799. ;Buffers
  2800.  
  2801. Buffer1:    dcb.b    2,0        ;For writes to serial (read from CLI)
  2802. Buffer2:    dcb.b    2,0        ;For reads
  2803. Buffer3:    dcb.b    BUFLEN,0    ;For reads from serial
  2804. Buffer4:    dcb.b    BUFLEN*2,0    ;For writes to CLI
  2805.  
  2806. DialBuffer1:    dcb.b    ENTRYLENGTH,0    ;for single dial/serial unit number :)
  2807.  
  2808. FileNameBuf1:    dc.b    "S:ShellTerm.PREFS"
  2809.         dcb.b    128-19,0
  2810. FileNameBuf2:    dcb.b    128,0        ;File to UL/capture filename
  2811. FileNameBuf3:    dcb.b    2*128,0        ;CMD string with arguments
  2812.  
  2813. PREFS_START:
  2814.  
  2815. PrefsStart:    dc.b    "ST"
  2816. SerDevNBuffer1:    dc.b    "serial.device"
  2817.         dcb.b    32-13,0        ;device name
  2818. SerUnit:    dc.l    0
  2819. Speed:        dc.l    9600
  2820. LocalEcho:    dc.w    0        ;(0=no echo, 1=echo)
  2821. CRTranslate:    dc.b    0        ;0=none, 1=strip, 2=add LF
  2822. LFTranslate:    dc.b    0        ;0=none, 1=strip, 2=add CR
  2823. CRTranslateIn:    dc.b    0        ;0=none, 1=strip, 2=add LF
  2824. LFTranslateIn:    dc.b    0        ;0=none, 1=strip, 2=add CR
  2825. DataBits:    dc.b    8
  2826. StopBits:    dc.b    1
  2827. SwapBSDEL:    dc.b    0        ;1=yes
  2828. UseANSI:    dc.b    0        ;1=yes
  2829. CPAssign:    dc.b    0        ;key to assign CTRL-P to
  2830. CursorRemap:    dc.b    0        ;remap cursor keys
  2831.  
  2832. ULProgram:    dcb.b    128,0        ;SZ
  2833. DLProgram:    dcb.b    128,0        ;RZ
  2834. ULDir:        dcb.b    128,0        ;SZ
  2835. DLDir:        dcb.b    128,0        ;RZ
  2836. DialPrefix:    dc.b    "ATDT"        ;dial prefix
  2837.         dcb.b    16-4,0
  2838. Entry1:        dcb.b    ENTRYLENGTH,0    ;Entry 1
  2839. Entry2:        dcb.b    ENTRYLENGTH,0    ;Entry 2
  2840. Entry3:        dcb.b    ENTRYLENGTH,0    ;Entry 3
  2841. Entry4:        dcb.b    ENTRYLENGTH,0    ;Entry 4
  2842. Entry5:        dcb.b    ENTRYLENGTH,0    ;Entry 5
  2843. Entry6:        dcb.b    ENTRYLENGTH,0    ;Entry 6
  2844. Entry7:        dcb.b    ENTRYLENGTH,0    ;Entry 7
  2845. Entry8:        dcb.b    ENTRYLENGTH,0    ;Entry 8
  2846. Entry9:        dcb.b    ENTRYLENGTH,0    ;Entry 9
  2847. Entry10:    dcb.b    ENTRYLENGTH,0    ;Entry 10
  2848.  
  2849. PREFS_END:    dc.l    0,0
  2850.  
  2851. PrefsSize:    EQU    (PREFS_END-PREFS_START)
  2852.         end
  2853.  
  2854.