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 / B5A7-1.INS < prev    next >
Text File  |  2000-06-30  |  6KB  |  209 lines

  1. ; B5A7-1.INS for the Apple ][ and CCS 7710 interface for BYE5 - 02/02/87
  2. ;
  3. ;           6850 ACIA, no internal baudrate generator
  4. ;
  5. ;
  6. ; This version is for Apple ][ computers, using the Microsoft CP/M card
  7. ; and the CCS 7710 serial interface card.
  8. ;
  9. ;    The 6850 has no baudrate generator.  It relies on the user
  10. ;    setting a dip switch to the maximum speed he wants to use.
  11. ;    The program then uses the 6850 in the "divide by 16" mode
  12. ;    to get that speed.  It can then change to "divide by 64"
  13. ;    to get the only other speed available.    This type system
  14. ;    normally limits the user to 1200 and 300 baud.    If you
  15. ;    set the dip switches for 2400, then you could only get
  16. ;    2400 and 600, eliminating both 1200 and 300 baud.  Using
  17. ;    either the Apricorn or CCS 7710 board just about precludes
  18. ;    the user from wanting to obtain a new modem with 2400 bps.
  19. ;    The 6850 uses the last two bits to select the divisor.    01
  20. ;    gives "divide by 16" and 10 gives "divide by 64".
  21. ;
  22. ;-----------------------------------------------------------------------
  23. ;
  24. ; The CCS 7710 serial card is set up as DCE rather than the more usual
  25. ; DTE, and requires a special cable.....the following cable configura-
  26. ; ion is necessary to work with this overlay -----
  27. ;
  28. ;              MODEM pin       CCS pin
  29. ;
  30. ;             2         3
  31. ;             3         2
  32. ;             5         4
  33. ;             8        20
  34. ;             7         7
  35. ;            20         5
  36. ;
  37. ; =   =  =   =     =   =     =   =     =   =     =   =     =   =     =   =     =   =
  38. ;
  39. ;-----------------------------------------------------------------------
  40. ;
  41. ; For the Apple //e, a user entered CTL-Q can trash the local display by
  42. ; reverting back to 40 column mode.  This is a patch to turn CTL-Q into
  43. ; a backspace.
  44. ;
  45. ; In BYE5 find the label MINP2A:  Just prior to MINP2A should be the
  46. ; lines:
  47. ;        JNZ    MINP2A
  48. ;        MVI    A,08H
  49. ;
  50. ;
  51. ; Add the following code just before JNZ MINP2A
  52. ;
  53. ;        JZ    CHNGIT
  54. ;        CPI    'Q'-'@'
  55. ;        JNZ    MINP2A
  56. ;    CHNGIT: MVI    A,08H    << note the added label
  57. ;
  58. ;
  59. ; When using a Softcard CP/M system and the CCS 7710, a warmboot causes
  60. ; the serial baud rate port to reset to its default setting.  (Whatever
  61. ; the switches are set to on the card.)  The problem is fixed by zeroing
  62. ; out the CALL in the warmboot routine that resets the baud rate.
  63. ;
  64. ; Find the following code in BYE5:
  65. ;
  66. ;            JMP    VWARMBT
  67. ;
  68. ; Just before this instruction, add the following code:
  69. ;
  70. ;            PUSH    PSW     ;Save AF
  71. ;            XRA    A     ;Make it zero
  72. ;            STA    0DAD8H     ;Patch out the opcode
  73. ;            STA    0DAD9H     ;Patch out the operand byte 1
  74. ;            STA    0DADAH     ;Patch out the operand byte 2
  75. ;            POP    PSW     ;Make it like it was
  76. ; Here's the end -->
  77. ; For reference -->    JMP    VWARMBT
  78. ;
  79. ;
  80. ; NOTE:  This change may work only with the 60k version version of the
  81. ;     MicroSoft CP/M, their v2.2.3.
  82. ;
  83. ;
  84. ;=  =  =  =  =    =  =  =  =  =  =  =  =    =  =  =  =  =  =  =  =    =  =
  85. ;
  86. ; 02/02/87  Adapted for the CCS 7710 serial interface card - Irv Hoff
  87. ;
  88. ;=  =  =  =  =    =  =  =  =  =  =  =  =    =  =  =  =  =  =  =  =    =  =
  89. ;
  90. ; Equates for Microsoft Softcard CP/M and Super Serial Card
  91. ;
  92. SLOT    EQU    2        ; Slot of serial interface
  93. SLOTOFF    EQU    16*SLOT        ; Serial card slot offset
  94. MAPOFF    EQU    2000H        ; Microsoft offset
  95. ;
  96. PORT    EQU    0C081H+SLOTOFF+MAPOFF ; Data port
  97. MDCTL1    EQU    PORT-1        ; Control port
  98. MDRCV    EQU    1        ; Bit to test for receive
  99. MDSND    EQU    2        ; Bit to test for send
  100. ;......
  101. ;
  102. ;
  103. ;-----------------------------------------------------------------------
  104. ;
  105. ; Routine to check carrier.  If no carrier, return with zero flag set.
  106. ;
  107. MDCARCK:LDA    MDCTL1        ; Get status byte
  108.     ANI    4        ; Check for DCD
  109.     XRI    4        ; Reverse the zero flag (the 6850
  110.     RET            ;   has status 0 for DCD true)
  111. ;.....
  112. ;
  113. ;
  114. ; This routine will turn off the serial card and hang up the phone.
  115. ;
  116. MDINIT:    MVI    A,0D5H        ; Turn off DTR
  117.     STA    MDCTL1
  118.     PUSH    B        ; Save register
  119.     MVI    B,20        ; Delay 2 sec to drop carrier
  120. ;
  121. OFFTI:    CALL    DELAY        ; 1 sec per loop
  122.     DCR    B
  123.     JNZ    OFFTI        ; Keep going until finished
  124.     POP    B        ; Restore register
  125.     MVI    A,0B5H        ; Turn everything back on, 8 bits, 1 stop
  126. ;
  127.      IF    IMODEM
  128.     CALL    IMINIT
  129.      ENDIF
  130. ;
  131.     RET
  132. ;.....
  133. ;
  134. ;
  135. ; Check the status to see if a character is available.    Return with zero
  136. ; flag set, if not.  If yes, use 0FFH to clear the flag.
  137. ;
  138. MDINST:    LDA    MDCTL1        ; Get modem status
  139.     ANI    1        ; Is data available?
  140.     RZ            ; If no, return
  141.     ORI    0FFH        ; Otherwise return true
  142.     RET
  143. ;.....
  144. ;
  145. ;
  146. ; See if the output is ready for another character.
  147. ;
  148. MDOUTST:LDA    MDCTL1        ; Get modem status
  149.     ANI    2        ; Mask out junk
  150.     RZ
  151.     ORI    0FFH
  152.     RET
  153. ;.....
  154. ;
  155. ;
  156. ; Input a character from the modem port.
  157. ;
  158. MDINP:    LDA    PORT        ; Get character
  159.     RET
  160. ;.....
  161. ;
  162. ;
  163. ; This routine will output a character to the data port.
  164. ;
  165. MDOUTP:    STA    PORT        ; Send character
  166.     RET
  167. ;.....
  168. ;
  169. ;
  170. ; Reinitialize the modem and hang up the phone by dropping DTR and
  171. ; leaving it inactive.
  172. ;
  173. MDQUIT:     IF    IMODEM        ; If using a smartmodem
  174.     CALL    IMQUIT        ; Tell it to shut down
  175.      ENDIF            ; IMODEM
  176. ;
  177. ;
  178. ; Called by the main program after caller types BYE
  179. ;
  180. MDSTOP:    MVI    A,0D5H        ; Drop DTR, set to 1200 speed
  181.     STA    MDCTL1
  182.     RET
  183. ;.....
  184. ;
  185. ;
  186. ; If you do not support a particular baud rate, put it here before
  187. ; SETINV:
  188. ;
  189. SET2400:
  190. SET4800:
  191. SET9600:
  192. SETINV:    ORI    0FFH
  193.     RET
  194. ;.....
  195. ;
  196. ;
  197. SET300:    MVI    A,16H
  198.     JMP    SETBAUD
  199. ;
  200. SET1200:MVI    A,15H
  201. ;
  202. SETBAUD:STA    MDCTL1
  203.     XRA    A        ; Shows the baud rate was changed ok
  204.     RET
  205. ;.....
  206. ;
  207. ;                end
  208. ;---------------------------------------------------------------------
  209.