home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / bye3 / b3hz-2.ins < prev    next >
Text File  |  1994-07-13  |  4KB  |  154 lines

  1.  
  2. ; B3HZ-2.INS - Heath/Zenith-100 insert for BYE3 - 07/30/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. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  46. ;
  47. ; Modem port equates
  48. ;
  49. DPORT     EQU    0ECH        ; Data port for Heath/Zenith-100 series
  50. SPORT     EQU    DPORT+1        ; Status port
  51. MPORT     EQU    DPORT+2        ; Modem port
  52. CPORT     EQU    DPORT+3        ; Control port
  53. ;
  54. DAV    EQU    00000010B    ; Data available
  55. TBMT    EQU    00000001B    ; Transmit buffer empty
  56. DCD    EQU    10000000B    ; Data carrier detect
  57. ;
  58. BD300     EQU    0F6H        ; 300 baud
  59. BD1200     EQU    0F8H        ; 1200 baud
  60. BD2400     EQU    0FBH        ; 2400 baud
  61. ;
  62. ;-----------------------------------------------------------------------
  63. ;
  64. ; See if we still have a carrier - if not, return with the zero flag set
  65. ;
  66. MDCARCK:IN    SPORT        ; Status port
  67.     ANI    DCD        ; See if there is a carrier (DSR pin)
  68.     RZ
  69.     ORI    255
  70.     RET
  71. ;
  72. ; Disconnect and wait for an incoming call
  73. ;
  74. MDINIT:    XRA    A        ; Drop DTR
  75.     OUT    CPORT
  76. ;
  77.     PUSH    B        ; In case it was being used
  78.     MVI    B,20        ; Delay for 2 seconds
  79. OFFTI:    CALL    DELAY        ; .1 second increments
  80.     DCR    B        ; One less to go
  81.     JNZ    OFFTI        ; If not zero, loop until zero
  82.     POP    B        ; Restore to original
  83. ;
  84.     MVI    A,37H        ; Reset RTS, flags, DTR, enable R/T
  85.     OUT    CPORT        ; Control port
  86. ;
  87.      IF    IMODEM
  88.     CALL    IMINIT        ; Initialize modem
  89.      ENDIF            ; IMODEM
  90. ;
  91.     RET
  92. ;
  93. ; The following is a routine that will input one character from the mo-
  94. ; dem port.  If there is nothing there, it will return garbage... so use
  95. ; the MDINST routine first.
  96. ;
  97. MDINP:    IN    DPORT
  98.     RET
  99. ;
  100. ; The following is a routine to determine if there is a character wait-
  101. ; ing to be received.  If there are none, the zero flag will be set.
  102. ; Otherwise, 0FFH will be returned in 'A' reg.
  103. ;
  104. MDINST:    IN    SPORT
  105.     ANI    DAV        ; Check for receive ready bit
  106.     RZ
  107.     ORI    255        ; We got something...
  108.     RET
  109. ;
  110. ; The following is a routine to determine if the transmit buffer is em-
  111. ; pty.    If not, it returns with the Zero flag set, otherwise it will
  112. ; return with Zero clear.
  113. ;
  114. MDOUTST:IN    SPORT
  115.     ANI    TBMT        ; Check the transmit ready bit
  116.     RZ
  117.     ORI    255
  118.     RET
  119. ;
  120. MDQUIT:     IF    IMODEM
  121.     CALL    IMQUIT
  122.      ENDIF            ; IMODEM
  123. ;
  124. MDSTOP:    XRA    A        ; Turn off DTR
  125.     OUT    CPORT
  126.     RET
  127. ;
  128. ; The following is a routine that will output one character in the 'A'
  129. ; reg. to the modem.
  130. ;
  131. MDOUTP:    OUT    DPORT
  132.     RET
  133. ;
  134. ; Set the baudrate, returns with Zero flag set with successful change
  135. ;
  136. SET300:    MVI    B,BD300
  137.     JMP    LOADBD
  138. ;
  139. SET1200:MVI    B,BD1200
  140.     JMP    LOADBD
  141. ;
  142. SET2400:MVI    B,BD2400
  143. ;
  144. LOADBD:    MVI    A,4EH        ; 1 Stop, no parity, 8 bits, 16x asynch
  145.     OUT    MPORT        ; Send to mode register
  146.     MOV    A,B        ; Get the baudrate
  147.     OUT    MPORT        ; Set the desired speed
  148.     MVI    A,37H        ; Reset flags, RTS, DTR, enable R/T
  149.     OUT    CPORT        ; Send to command register
  150.     XRA    A        ; Shows the baudrate change was ok
  151.     RET
  152. ;                   end
  153. ;-----------------------------------------------------------------------
  154.