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 / BYE5 / B5CP-1.IQS / B5CP-1.INS
Text File  |  2000-06-30  |  7KB  |  263 lines

  1.  
  2. ; B5CP-1.INS - Interfacer 3/4 insert for BYE5 - 07/17/85
  3. ;
  4. ;       2651 I/O with internal baudrage generator
  5. ;
  6. ;         For: CompuPro Interfacer 3
  7. ;              CompuPro Interfacer 4
  8. ;              CompuPro System Support 1
  9. ;
  10. ; Note:  This is an insert, not an overlay.
  11. ;
  12. ;
  13. ; The Interfacer board uses the 2651 I/O.  This has a peculiarity that
  14. ; prevents its proper use if you hook pin 8 (DCD) of the modem to pin 8
  15. ; (DCD) of the Interfacer board.  You should instead hook pin 8 of the
  16. ; modem (DCD) to (DSR) on the Interfacer board.  To further complicate
  17. ; the picture, CompuPro uses an unique wiring they refer to as "master"
  18. ; or "slave setting".  Normally the board is delivered with the serial
  19. ; ports hooked as "slave", which makes (DSR) pin 20 instead of the con-
  20. ; ventional pin 6 as on most RS-232 DB-25 connectors.    It then makes
  21. ; (DTR) pin 6 instead of conventional pin 20.  (See page 14 of the In-
  22. ; terfacer 3 manual or page 20 of the Interfacer 4 manual for additional
  23. ; information on this subject.    The schematic below is shown for both
  24. ; configurations.
  25. ;
  26. ; (For interest, the newer version of the 2561 is called the 2661.  It
  27. ; came out in 1981, but has this same bug the 2651 has.  That chip is
  28. ; used in the Heath/Zenith-100 series computers.  The 2651 has another
  29. ; serious bug, if selecting other than 1 stop pulse, it must receive an
  30. ; incoming signal with the same (or more) stop pulses.    Fortunately few
  31. ; people need 1-1/2 or 2 stop pulses so this bug is rarely a problem.)
  32. ;
  33. ;
  34. ; NOTE FOR HAYES SMARTMODEM USERS:
  35. ; -------------------------------
  36. ;    In the past people using the Hayes Smartmodem 1200 and the
  37. ;    Interfacer board have complained they had to put SW6 up to
  38. ;    use with BYE5 but then had to put it down to use with MEX,
  39. ;    MDM7 or other autodial modem programs.    With the configur-
  40. ;    ation below, SW6 can be left in whatever position the user
  41. ;    prefers (up, for BYE5) and this will have no effect on the
  42. ;    normal use of IMP, MEX or MDM7.
  43. ;
  44. ; If using "slave" mode:
  45. ; ---------------------
  46. ;    MODEM=DCE    INTERFACER    (Slave mode)
  47. ;
  48. ;    TXD    2  -->    3    RXD    received data
  49. ;    RXD    3  <--    2    TXD    tranmitted data
  50. ;    SG    7  ---    7    SG    signal ground
  51. ;    DCD    8  -->    20 *    DSR    data set ready (carrier)
  52. ;    DTR    20 <--    6  *    DTR    data terminal ready
  53. ;
  54. ;
  55. ; If using "master" mode
  56. ; ----------------------
  57. ;    MODEM=DCE    INTERFACER    (as Master)
  58. ;
  59. ;    TXD    2  -->    2    RXD    received data
  60. ;    RXD    3  <--    3    TXD    tranmitted data
  61. ;    SG    7  ---    7    SG    signal ground
  62. ;    DCD    8  -->    6    DSR    data set ready (carrier)
  63. ;    DTR    20 <--    20    DTR    data terminal ready
  64. ;
  65. ;                    - Notes by Irv Hoff
  66. ;
  67. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  68. ;
  69. ; 07/17/85  Written for use with BYE5            - Irv Hoff
  70. ; 10/04/82  Original version                - Paul Traina
  71. ;
  72. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  73. ;
  74. ;
  75. INTER4    EQU    YES        ; Yes for Compupro Interfacer 3 or 4
  76.                 ; No  for Compupro System Support 1
  77. ;
  78. ;
  79. ; The following define the port address and usart number to use.
  80. ;
  81.      IF    INTER4
  82. BASEP    EQU    010H        ; Base port for Interfacer 3/4 boards
  83. CHIP    EQU    6        ; Chip number to use
  84.      ENDIF            ; INTER4
  85. ;
  86.      IF    NOT INTER4
  87. BASEP    EQU    05CH        ; Base port for System Support 1
  88.      ENDIF            ; NOT INTER4
  89. ;
  90. ;
  91. ;-----------------------------------------------------------------------
  92. ;
  93. ; Modem port equates
  94. ;
  95. PORT    EQU    BASEP        ; Modem data port
  96. MDCTL1    EQU    BASEP+1        ; Modem status port
  97. MDCTL2    EQU    BASEP+2        ; Modem mode select port
  98. MDCTL3    EQU    BASEP+3        ; Modem control port
  99. ;
  100.      IF    INTER4
  101. USER    EQU    BASEP+7        ; Modem chip select port
  102.      ENDIF            ; INTER4
  103. ;
  104. ;
  105. ; Mode port equates
  106. ;
  107. BBASE    EQU    30H        ; Mode register 2 base
  108. ;
  109. BD300    EQU    BBASE+5        ; 300 baud
  110. BD1200    EQU    BBASE+7        ; 1200 bps
  111. BD2400    EQU    BBASE+10    ; 2400 bps
  112. ;
  113. ;
  114. ;-----------------------------------------------------------------------
  115. ;
  116. ;
  117. ; See if we still have a carrier - if not, return with the zero flag set
  118. ;
  119. MDCARCK: IF    INTER4
  120.     MVI    A,CHIP        ; Select proper chip
  121.     OUT    USER
  122.      ENDIF
  123. ;
  124.     IN    MDCTL1        ; Read port
  125.     ANI    80H        ; Check DSR pin for DCD (see above)
  126.     RET
  127. ;.....
  128. ;
  129. ;
  130. ; Disconnect and wait for an incoming call
  131. ;
  132. MDINIT:     IF    INTER4
  133.     MVI    A,CHIP        ; Select proper chip
  134.     OUT    USER
  135.      ENDIF            ; INTER4
  136. ;
  137.     MVI    A,15H        ; DTR, RTS off to disconnect phone
  138.     OUT    MDCTL3
  139.     PUSH    B
  140.     MVI    B,20        ; Wait 2 seconds
  141. ;
  142. MDINIT1:CALL    DELAY
  143.     DCR    B
  144.     JNZ    MDINIT1
  145.     POP    B
  146.     MVI    A,27H        ; Turn DTR, RTS back on
  147.     OUT    MDCTL3
  148. ;
  149.      IF    IMODEM
  150.     CALL    IMINIT        ; Initialize intelligent modem
  151.      ENDIF            ; IMODEM
  152. ;
  153.     RET
  154. ;.....
  155. ;
  156. ;
  157. ; Input a character from the modem port
  158. ;
  159. MDINP:     IF    INTER4
  160.     MVI    A,CHIP        ; Select proper chip
  161.     OUT    USER
  162.      ENDIF            ; INTER4
  163. ;
  164.     IN    PORT        ; Get character
  165.     RET
  166. ;.....
  167. ;
  168. ;
  169. ; Check the status to see if a character is available.    If not, return
  170. ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  171. ;
  172. MDINST:     IF    INTER4
  173.     MVI    A,CHIP        ; Select proper chip
  174.     OUT    USER
  175.      ENDIF
  176. ;
  177.     IN    MDCTL1        ; Read port
  178.     ANI    02H        ; Check receive ready bit
  179.     RZ            ; Nope, nothing there
  180.     ORI    0FFH        ; We got something...
  181.     RET
  182. ;.....
  183. ;
  184. ;
  185. ; Send a character to the modem
  186. ;
  187. MDOUTP:     IF    INTER4
  188.     PUSH    PSW
  189.     MVI    A,CHIP        ; Select proper chip
  190.     OUT    USER
  191.     POP    PSW
  192.      ENDIF
  193. ;
  194.     OUT    PORT        ; Send it
  195.     RET
  196. ;.....
  197. ;
  198. ;
  199. ; See if the output is ready for another character
  200. ;
  201. MDOUTST: IF    INTER4
  202.     MVI    A,CHIP        ; Select proper chip
  203.     OUT    USER
  204.      ENDIF
  205. ;
  206.     IN    MDCTL1        ; Read port
  207.     ANI    01H        ; Check transmit ready bit
  208.     RZ
  209.     ORI    0FFH
  210.     RET
  211. ;.....
  212. ;
  213. ;
  214. ; Reinitialize the modem and hang up the phone by dropping DTR and
  215. ; leaving it inactive.
  216. ;
  217. MDQUIT:     IF    INTER4
  218.     MVI    A,CHIP        ; Select proper chip
  219.     OUT    USER
  220.      ENDIF
  221. ;
  222.      IF    IMODEM
  223.     CALL    IMQUIT        ; Tell modem to shut down
  224.      ENDIF
  225. ;
  226. ;
  227. ; Called by the main program after caller types BYE
  228. ;
  229. MDSTOP:    MVI    A,CHIP        ; Select proper chip
  230.     OUT    USER
  231.     MVI    A,15H        ; Turn off DTR, modem will quit
  232.     OUT    MDCTL3
  233.     RET
  234. ;.....
  235. ;
  236. ;
  237. ; The following routine sets the baudrate.  BYE5 asks for the maximum
  238. ; speed you have available.
  239. ;
  240. SET300:    MVI    B,BD300        ; Set baud rate
  241.     JMP    SETBAUD
  242. ;
  243. SET1200:MVI    B,BD1200    ; Set baud rate
  244.     JMP    SETBAUD
  245. ;
  246. SET2400:MVI    B,BD2400    ;set baud rate
  247. ;
  248. SETBAUD: IF    INTER4
  249.     MVI    A,CHIP        ; Select proper chip
  250.     OUT    USER
  251.      ENDIF            ; INTER4
  252. ;
  253.     MVI    A,4EH        ; 1 stop, no parity 8 bits
  254.     OUT    MDCTL2
  255.     MOV    A,B        ; Get the baudrate back
  256.     OUT    MDCTL2
  257.     XRA    A
  258.     RET
  259. ;.....
  260. ;
  261. ;                   end
  262. ;-----------------------------------------------------------------------
  263.