home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / MODEMS / MODEM7 / M740FT.MOD < prev    next >
Text File  |  2000-06-30  |  2KB  |  96 lines

  1. ;*** New routine for T-mode file transfer in MDM740
  2. ;*** Eric Meyer - 1/85  (new code is in lowercase)
  3. ;(Note that the SPD command and its time delays have been deleted, and
  4. ;instead the transmitted characters now echo [from the remote in T mode,
  5. ;locally in L mode].  Also there's a new XONCH, which you can put in 
  6. ;place of CRDLY if you want; modify your TXO routine to ask you what the
  7. ;XON character should be, and store it in XONCH.  This allows waiting for
  8. ;virtually any "system prompt".  Eg: use ":" for prompts like "1:")
  9. ;
  10. MODOUT:    PUSH    PSW        ;save the character so can use 'A' reg.
  11.     CPI    LF
  12.     JNZ    MODOUTL
  13.     LDA    ADDLF        ;going to send the line feed to modem?
  14.     ORA    A
  15.     JNZ    MODOUTL        ;if yes, go do it
  16.     POP    PSW        ;get the char. back (a line feed)
  17.     lda    locflg
  18.     ora    a        ;need to fake echo?
  19.     rz
  20.     mvi    a,lf        ;yes.
  21.     CALL    TYPE        ;show on CRT, do not send to modem
  22.     RET
  23. ;
  24. MODOUTL: call    rcvready    ;check for incoming stuff
  25.     jnz    mdoutl1
  26.     call    in$moddatp    ;get char
  27.     ora    a        ;(ignore nulls)
  28.     jz    modoutl
  29.     cpi    xoff        ;(check for XOFF)
  30.     push    psw
  31.     cnz    type        ;show on screen if not
  32.     pop    psw
  33.     jnz    modoutl
  34.     LDA    XOFFTST        ;waiting for X-off, X-on ?
  35.     ORA    A
  36.     cnz    waitxon        ;if yes, wait for XON
  37. mdoutl1: CALL    SENDRDY        ;wait until modem is ready to send
  38.     jnz    mdoutl1
  39.     POP    PSW        ;get the character back
  40.     push    psw
  41.     CALL    OUT$MODDATP    ;send character to modem
  42.     lda    locflg
  43.     ora    a        ;need to fake echo?
  44.     jz    mdoutl2
  45.     pop    psw        ;yes.
  46.     push    psw
  47.     call    type
  48.     jmp    mdoutl3
  49. mdoutl2: call    stat        ;check keyboard
  50.     ora    a
  51.     jnz    mdoutl3
  52.     call    rcvready    ;wait for echo
  53.     jnz    mdoutl2
  54.     call    in$moddatp
  55.     call    type        ;show it
  56. mdoutl3: pop    psw
  57.     CPI    CR        ;was it an end of line?
  58.     RNZ
  59. ;
  60. MODOUTN:LDA    XONWAIT        ;wait for X-on after CR?
  61.     ORA    A
  62.     JNZ    WAITXON
  63.     RET
  64. ;.....
  65. ;
  66. ;
  67. TXOFF:    CALL    RCVREADY
  68.     RNZ
  69.     CALL    IN$MODDATP
  70.     ANI    7FH
  71.     CPI    XOFF
  72.     CZ    WAITXON
  73.     RET
  74. ;.....
  75. ;
  76. ;
  77. WAITXON:CALL    RCVREADY    ;have a character? (like x-on)
  78.     JNZ    WTXON1        ;if no char. see if want to abort
  79.     CALL    IN$MODDATP
  80.     ANI    7FH        ;strip off any parity
  81.     JZ    WAITXON        ;ignore nulls
  82.     push    psw
  83.     call    type        ;show it
  84.     pop    psw
  85.     mov    e,a
  86.     lda    xonch    ;XON character
  87.     cmp    e        ;see if char. was x-on
  88.     rz
  89. ;
  90. WTXON1:    CALL    STAT        ;test to see if requesting cancellation
  91.     JZ    WAITXON
  92.     CALL    KEYIN        ;can abort if the x-on never comes
  93.     CPI    CANCEL        ;ctl-x to abort?
  94.     JNZ    WAITXON        ;if not, keep going
  95.     RZ
  96.