home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / nubye / nuby-ins.lbr / NUHZ-1.IQS / nuhz-1.ins
Text File  |  1986-04-25  |  5KB  |  172 lines

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