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 / B5HZ-1.IQS / B5HZ-1.INS
Text File  |  2000-06-30  |  5KB  |  192 lines

  1.  
  2. ; B5HZ-1.INS - Heath/Zenith-100 insert for BYE5 - 07/17/85
  3. ;
  4. ;    2661B I/O with built-in baudrate generator, 4.9152 MHz
  5. ;
  6. ;    Note:  This is an insert, not an overlay.
  7. ;
  8. ;
  9. ;    WIRING THE HEATH:
  10. ;    ----------------
  11. ;       The HZ-100 has a quirk with the 2661 that requires the
  12. ;       DCD signal (carrier detect) from the modem be brought
  13. ;       to the DSR input on the computer, rather than to its DCD
  14. ;       input, else the HZ-100 cannot be programmed properly.
  15. ;       If using the Heath HCA-11 RS-232 cable between the modem
  16. ;       and the computer, the following will need to be done:
  17. ;
  18. ;        Push pins 6 (blue) and 8 (black) from the male
  19. ;        connector at the modem end, then put the blue
  20. ;        one in pin 8, leaving the black one unconnected.
  21. ;        (Tape it or whatever and replace the connector.)
  22. ;
  23. ;        This hooks pin 8 at the modem end to pin 6 at
  24. ;        the computer end and then has nothing connected
  25. ;        to pin 6 at the modem end.  (You can make this
  26. ;        change at either end that is most convenient, so
  27. ;        the computer effective winds up with nothing at
  28. ;        its pin 8.)  This permits the computer's DSR in-
  29. ;        put to check the modem's DCD line.
  30. ;
  31. ;
  32. ;            If using a Hayes Smartmodem 1200,
  33. ;            insure all switches are up except
  34. ;            3, 5 and 8 which should be down.
  35. ;
  36. ;                  modem     computer
  37. ;                 1-----------1
  38. ;                 2-----------2
  39. ;                 3-----------3
  40. ;                 6 n/c         8 n/c
  41. ;                 7-----------7
  42. ;                 8-----------6
  43. ;                20-----------20
  44. ;
  45. ;        The Hayes Smartmodem actually has a short between
  46. ;        its pin 6 and pin 8, internally.  It does not have
  47. ;        any actual DSR information available, giving DCD
  48. ;        information at both its pins 6 and 8.  Other modems
  49. ;        do not use this unorthodox method.
  50. ;
  51. ;        (Thanks to Dennis Vallianos and others for helping
  52. ;        develop this fix for the HZ100 series.)
  53. ;
  54. ;                    - Notes by Irv Hoff
  55. ;
  56. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  57. ;
  58. ; 07/17/85  Written for use with BYE5 and later    - Irv Hoff
  59. ;
  60. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  61. ;
  62. ; Modem port equates
  63. ;
  64. PORT     EQU    0ECH        ; Data port for Heath/Zenith-100 series
  65. MDCTL1     EQU    PORT+1        ; Status port
  66. MDCTL2     EQU    PORT+2        ; Modem port
  67. MDCTL3     EQU    PORT+3        ; Control port
  68. ;
  69. BD300     EQU    0F6H        ; 300 baud
  70. BD1200     EQU    0F8H        ; 1200 bps
  71. BD2400     EQU    0FBH        ; 2400 bps
  72. ;.....
  73. ;
  74. ;
  75. ;-----------------------------------------------------------------------
  76. ;
  77. ; See if we still have a carrier - if not, return with the zero flag set
  78. ;
  79. MDCARCK:IN    MDCTL1        ; Status port
  80.     ANI    80H        ; See if there is a carrier (DSR pin)
  81.     RET            ; If yes, return with Zero flag set
  82. ;.....
  83. ;
  84. ;
  85. ; Disconnect and wait for an incoming call
  86. ;
  87. MDINIT:    MVI    A,15H        ; Turn off DTR, RTS to hang up phone
  88.     OUT    MDCTL3        ; Control port
  89.     IN    MDCTL3        ; Make sure it is now clear
  90.     IN    MDCTL3        ; Try once more
  91.     PUSH    B        ; In case it was being used
  92.     MVI    B,20        ; Delay for 2 seconds
  93. ;
  94. OFFTI:    CALL    DELAY        ; .1 second increments
  95.     DCR    B        ; One less to go
  96.     JNZ    OFFTI        ; If not zero, loop until zero
  97.     POP    B        ; Restore to original
  98.     MVI    A,37H        ; Reset RTS, flags, DTR, enable R/T
  99.     OUT    MDCTL3        ; Control port
  100.     IN    MDCTL3        ; Clear any incoming characters
  101.     IN    MDCTL3        ; Try once more
  102. ;
  103.      IF    IMODEM
  104.     CALL    IMINIT        ; Initialize modem
  105.      ENDIF            ; IMODEM
  106. ;
  107.     RET
  108. ;.....
  109. ;
  110. ;
  111. ; The following is a routine that will input one character from the mo-
  112. ; dem port.  If there is nothing there, it will return garbage... so use
  113. ; the MDINST routine first.
  114. ;
  115. MDINP:    IN    PORT
  116.     RET
  117. ;.....
  118. ;
  119. ;
  120. ; The following is a routine to determine if there is a character wait-
  121. ; ing to be received.  If there are none, the zero flag will be set.
  122. ; Otherwise, 0FFH will be returned in 'A' reg.
  123. ;
  124. MDINST:    IN    MDCTL1
  125.     ANI    02H        ; Check for receive ready bit
  126.     RZ
  127.     ORI    0FFH        ; We got something...
  128.     RET
  129. ;.....
  130. ;
  131. ;
  132. ; The following is a routine to determine if the transmit buffer is em-
  133. ; pty.    If not, it returns with the Zero flag set, otherwise it will
  134. ; return with Zero clear.
  135. ;
  136. MDOUTST:IN    MDCTL1
  137.     ANI    01H        ; Check the transmit ready bit
  138.     RZ
  139.     ORI    0FFH
  140.     RET
  141. ;.....
  142. ;
  143. ;
  144. MDQUIT:     IF    IMODEM
  145.     CALL    IMQUIT
  146.      ENDIF            ; IMODEM
  147. ;
  148. MDSTOP:    MVI    A,15H        ; DTR off, modem will quit working
  149.     OUT    MDCTL3
  150.     RET
  151. ;.....
  152. ;
  153. ;
  154. ; The following is a routine that will output one character in the 'A'
  155. ; reg. to the modem.
  156. ;
  157. ;
  158. MDOUTP:    OUT    PORT
  159.     RET
  160. ;.....
  161. ;
  162. ;
  163. ; Set the baudrate, returns with Zero flag set with successful change
  164. ;
  165. SETINV:    MVI    A,0FFH
  166.     ORA    A        ; Make sure the Zero flag is not set
  167.     RET
  168. ;
  169. SET300:    MVI    B,BD300
  170.     JMP    LOADBD
  171. ;
  172. SET1200:MVI    B,BD1200
  173.     JMP    LOADBD
  174. ;
  175. SET2400:MVI    B,BD2400
  176. ;
  177. LOADBD:    MVI    A,4EH        ; 1 Stop, no parity, 8 bits, 16x asynch
  178.     OUT    MDCTL2        ; Send to mode register
  179.     MOV    A,B        ; Get the baudrate
  180.     OUT    MDCTL2        ; Set the desired speed
  181.     MVI    A,37H        ; Reset flags, RTS, DTR, enable R/T
  182.     OUT    MDCTL3        ; Send to command register
  183.     IN    MDCTL3        ; Clear any incoming characters
  184.     IN    MDCTL3        ; Try once again
  185.     XRA    A        ; Shows the baudrate change was ok
  186.     RET
  187. ;.....
  188. ;
  189. ;
  190. ;                   end
  191. ;-----------------------------------------------------------------------
  192.