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 / ZSYS / ZNODE-12 / I / MY80BYE5.TXT < prev    next >
Text File  |  2000-06-30  |  6KB  |  202 lines

  1.  
  2. Public Message # 6440  CPMTECH Area  Entered 08:45 Saturday  26-Dec-92
  3. From:  BRUCE DUDLEY
  4.   To:  SIMEON CRAN
  5.   Re:  BYE Modem insert
  6.  
  7. Don't know if this will work but here is the MYZ80 modem insert for BYE and 
  8. Foodo.
  9.  
  10.  --------------------------------------------------------------------------
  11.  
  12.  ; MYZ80.INS - BYE5 insert for MSDOS using MYZ80 CP/M emulator
  13.  ;
  14.  ; This insert adapts the MYZ80 CP/M emulator to BYE5.
  15.  ;
  16.  ; Adaptded to suit by:
  17.  
  18.  ; Bruce Dudley     24/12/92  SYSOP Z-Node 62 RCPM
  19.  
  20.  ;=   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  21.   =
  22.  ; Set to the com: port used on your PC for modem communications
  23.  ; Note: Only set one of these to 'yes'
  24.  
  25.  com1    equ     no
  26.  com2    equ     yes
  27.  com3    equ     no
  28.  com4    equ     no
  29.  
  30.          if      com1
  31.  portbase        equ     0
  32.          endif
  33.  
  34.          if      com2
  35.  portbase        equ     8
  36.          endif
  37.  
  38.          if      com3
  39.  portbase        equ     16
  40.          endif
  41.  
  42.          if      com4
  43.  portbase        equ     24
  44.          endif
  45.  ;-----------------------------------------------------------------------
  46.  ;
  47.  ;
  48.  ; See if we still have a carrier - if not, return with the zero flag
  49.  set
  50.  ;
  51.  mdcarck:in      a,(portbase+6)
  52.          bit     7,a
  53.          ret
  54.  ;.....
  55.  ;
  56.  ; Disconnect and wait for an incoming call
  57.  ;
  58.  mdinit: push    bc
  59.          xor     a
  60.          out     (portbase+1),a  ; Prevent interrupts
  61.          ld      a,00010011b     ; Line control register value set for:
  62.                                  ; DLAB off
  63.                                  ; Break off
  64.                                  ; Parity unstuck
  65.                                  ; None...
  66.                                  ; 1 stop bit
  67.                                  ; 8 data bits
  68.          out     (portbase+3),a
  69.          in      a,(portbase+4)
  70.          set     1,a             ; Make sure RTS is on
  71.          out     (portbase+4),a
  72.          call    mdstop
  73.          ld      b,20            ; 2 second delay
  74.  offti:  call    delay           ; 0.1 second delay
  75.          djnz    offti           ; Keep looping until finished
  76.          call    dtron
  77.  
  78.           if     imodem          ; If using intelligent modem
  79.          call    iminit          ; Go initialize modem now
  80.           endif                  ; IMODEM
  81.  
  82.          pop     bc
  83.          ret
  84.  ;.....
  85.  ;
  86.  ; Input a character from the modem port
  87.  ;
  88.  mdinp:  in      a,(portbase+0)
  89.          ret
  90.  ;.....
  91.  ;
  92.  ;
  93.  ; Check the status to see if a character is available.  If not, return
  94.  ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  95.  ;
  96.  mdinst: in      a,(portbase+5)
  97.          bit     0,a
  98.          ret     z       ; Return if not ready
  99.          or      -1      ; Set the proper flag
  100.          ret             ; And return
  101.  ;.....
  102.  ;
  103.  ;
  104.  ; Send a character to the modem
  105.  ;
  106.  mdoutp: out     (portbase+0),a
  107.          ret
  108.  ;.....
  109.  ;
  110.  ;
  111.  ; See if the output is ready for another character
  112.  ;
  113.  mdoutst:in      a,(portbase+5)
  114.          bit     5,a
  115.          ret
  116.  ;.....
  117.  ;
  118.  ;
  119.  ; Reinitialize the modem and hang up the phone by dropping DTR and
  120.  ; leaving it inactive.
  121.  ;
  122.  mdquit:  if     imodem          ; If using an intelligent modem
  123.          call    imquit          ; Tell it to shut down
  124.           endif                  ; IMODEM
  125.  ;
  126.  ;
  127.  ; Called by the main program after caller types BYE.
  128.  ;
  129.  mdstop: in      a,(portbase+4)
  130.          bit     0,a
  131.          ret     z
  132.          res     0,a             ; Drop DTR
  133.          out     (portbase+4),a
  134.          ret
  135.  ;.....
  136.  
  137.  dtron:  in      a,(portbase+4)
  138.          bit     0,a
  139.          ret     nz
  140.          set     0,a             ; Assert DTR
  141.          out     (portbase+4),a
  142.          ret
  143.  
  144.  ;
  145.  ; The following routine sets the baudrate.  BYE5 asks for the maximum
  146.  ; speed you have available.
  147.  ;
  148.  setinv: or      -1              ; Make sure zero flag is not set
  149.          ret
  150.  ;.....
  151.  ;
  152.  ;
  153.  set300: ld      hl,bd300
  154.          jr      setbaud
  155.  ;
  156.  set1200:ld      hl,bd1200
  157.          jr      setbaud
  158.  ;
  159.  set2400:ld      hl,bd2400
  160.          jr      setbaud
  161.  ;
  162.  set9600:ld      hl,bd9600
  163.          jr      setbaud
  164.  ;
  165.  set1920:ld      hl,bd1920
  166.  ;
  167.  setbaud:in      a,(portbase+3)
  168.          set     7,a             ; Set DLAB
  169.          out     (portbase+3),a
  170.          ld      a,l
  171.          out     (portbase+0),a  ; Do low byte
  172.          ld      a,h
  173.          out     (portbase+1),a  ; Do high byte
  174.          in      a,(portbase+3)
  175.          res     7,a             ; Restore DLAB
  176.          out     (portbase+3),a
  177.          xor     a
  178.          ret                     ; Return
  179.  ;.....
  180.  ;
  181.  ;
  182.  ; The following are baud rates for BPORT -- they will have to be changed
  183.  ; for your particular CTC.
  184.  
  185.  bd300   equ     180h            ; 300
  186.  bd1200  equ     060h            ; 1200
  187.  bd2400  equ     030h            ; 2400
  188.  bd9600  equ     0ch             ; 9600
  189.  bd1920  equ     6               ; 19200
  190.  ;.....
  191.  
  192.   -------------------------------------------------------------------------
  193.  
  194. I don't know if a DOS BBS will reformat all that and if so it will look a 
  195. mess. Looks OK here on Z-Node..
  196.  
  197.   Bruce..
  198.  
  199. --- Foodo v1.1
  200.  * Origin: Z-Node 62 RCPM, Perth Western Australia. CP/M on FidoNet (3:690/718)
  201.  
  202.