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 / B5AS-2.INS < prev    next >
Text File  |  2000-06-30  |  6KB  |  214 lines

  1. ; B5AS-1.INS for the Apple & Super Serial Card for BYE5 - 9/05/85
  2. ;
  3. ;       6551 I/O with internal baudrate generator
  4. ;
  5. ;
  6. ; This version is for Apple ][ computers, using the Microsoft CP/M card
  7. ; and the Apple Super Serial Card.
  8. ;
  9. ;
  10. ; Note:  This is an insert, not an overlay.
  11. ;
  12. ;
  13. ;    MODEM=DCE            Super Serial Card
  14. ;
  15. ;    TXD    2  -------->    2    RXD    received data
  16. ;    RXD    3  <--------    3    TXD    tranmitted data
  17. ;    SG    7  ---------    7    SG    signal ground
  18. ;    DCD    8  -------->    6    DSR    data set ready (carrier)
  19. ;    DTR    20 <-------    20    DTR    data terminal ready
  20. ;
  21. ;
  22. ; This cable configuration uses DSR signal at the SSC to check carrier
  23. ; and Serial card DCD wired to DTR (Jumper pin 20-8) so that modem
  24. ; result codes are received when carrier is off.
  25. ;
  26. ; Set modem switches as defined in B5IM-1.DQC.
  27. ;
  28. ; THIS WORKS PROPERLY WITH BYE5 AND IS COMPATIBLE WITH IMP WITHOUT ANY
  29. ; CHANGES, ANY OTHER CONFIGURATION MIGHT REQUIRE RESETTING SOME MODEM
  30. ; SWITCHES WHEN GOING FROM BYE5 TO IMP, MDM7, MEX, ETC.
  31. ;
  32. ;-----------------------------------------------------------------------
  33. ;
  34. ; For the Apple //e, a user entered Control Q can trash the local dis-
  35. ; play by reverting back to 40 column mode.  This is a patch to turn
  36. ; that Control Q into a backspace.
  37. ;
  38. ; In BYE5 find the label MINP2A:  Just prior to MINP2A should be the
  39. ; lines:
  40. ;        JNZ    MINP2A
  41. ;        MVI    A,08H
  42. ;
  43. ; Add the following code just before JNZ MINP2A
  44. ;
  45. ;        JZ    CHNGIT
  46. ;        CPI    'Q'-'@'
  47. ;        JNZ    MINP2A
  48. ;    ;
  49. ;    CHNGIT: MVI    A,08H    << note the added label
  50. ;
  51. ;
  52. ; When using a Softcard CP/M system and the SSC, a warmboot causes the
  53. ; serial baud rate port to reset to its default setting.  (Whatever the
  54. ; switches are set to on the card.)  The problem is fixed by zeroing out
  55. ; the CALL in the warmboot routine that resets the baud rate.
  56. ;
  57. ; Find the following code in BYE5:
  58. ;
  59. ;            JMP    VWARMBT
  60. ;
  61. ; Just before this instruction, add the following code:
  62. ;            PUSH    PSW     ;Save AF
  63. ;            XRA    A     ;Make it zero
  64. ;            STA    0DAD8H     ;Patch out the opcode
  65. ;            STA    0DAD9H     ;Patch out the operand byte 1
  66. ;            STA    0DADAH     ;Patch out the operand byte 2
  67. ;            POP    PSW     ;Make it like it was
  68. ; Here's the end -->
  69. ; For reference -->    JMP    VWARMBT
  70. ;
  71. ; NOTE:  I suspect that this hack will work only with the 60k version
  72. ;     version of Microsoft CP/M -- v2.2.3
  73. ;=================================
  74. ; 2/8/85 MADE CORRECTION FOR MICROSOFT OFFSET
  75. ; I COULD NOT GET THE HACK FOR NO RESET ON WARM BOOT TO WORK
  76. ; SO I JUST RUN ZCPR
  77. ;    REGARDS, 
  78. ;    ALLAN LEVY
  79. ;
  80. ;=  =  =  =  =    =  =  =  =  =  =  =  =    =  =  =  =  =  =  =  =    =  =
  81. ;
  82. ; 09/08/85  Created overlay for BYE5.  MBSSC-2 by Chris Heuser and
  83. ;        Ryan Katri used as basis.        - Norman Beeler
  84. ;
  85. ;=  =  =  =  =    =  =  =  =  =  =  =  =    =  =  =  =  =  =  =  =    =  =
  86. ;
  87. SLOT    EQU    2        ; Slot 2 is normal
  88. OFFS    EQU    16*SLOT        ; This is the slot offset
  89. MAPPM    EQU    2000H        ; THIS IS THE MICROSOFT OFFSET
  90. ;
  91. PORT    EQU    0C088H+OFFS+MAPPM    ; Dataport    
  92. STPORT    EQU    PORT+1        ; Status port
  93. CPORT    EQU    PORT+2        ; Command port
  94. BRPORT    EQU    PORT+3        ; Baud rate port
  95. ;......
  96. ;
  97. ;
  98. ;-----------------------------------------------------------------------
  99. ;
  100. ; Routine to check carrier .. if not return with zero flag set
  101. ;
  102. MDCARCK:LDA    STPORT        ; Get status
  103.     ANI    40H        ; Check DSR pin for DCD (see above)
  104.     XRI    40H        ; Reverse the zero flag (the 6551
  105.     RET            ; Has status 0 for DCD/DSR true)
  106. ;.....
  107. ;
  108. ;
  109. ; This routine will turn off the serial card and hang up the phone.
  110. ;
  111. MDINIT:    XRA    A        ; Turn off DTR
  112.     STA    STPORT
  113.     PUSH    B        ; Save register
  114.     MVI    B,20        ; Delay 2 sec to drop carrier
  115. ;
  116. OFFTI:    CALL    DELAY        ; 1 sec per loop
  117.     DCR    B
  118.     JNZ    OFFTI        ; Keep going until finished
  119.     POP    B        ; Restore register
  120.     MVI    A,4BH
  121.     STA    CPORT
  122.     MVI    A,18H        ; Set 1200,8 bits, 1 stop
  123.     STA    BRPORT
  124. ;
  125.      IF    IMODEM
  126.     CALL    IMINIT
  127.      ENDIF
  128. ;
  129.     RET
  130. ;.....
  131. ;
  132. ;
  133. ; Check the status to see if a character is available.  Return with zero
  134. ; flag set, if not.  If yes, use 0FFH to clear the flag.
  135. ;
  136. MDINST:    LDA    STPORT        ; Get modem status
  137.     ANI    8        ; Is data available?
  138.     RZ            ; If no, return
  139.     ORI    0FFH        ; Otherwise return true
  140.     RET
  141. ;.....
  142. ;
  143. ;
  144. ; See if the output is ready for another character.
  145. ;
  146. MDOUTST:LDA    STPORT        ; Get modem status
  147.     ANI    10H        ; Mask out junk
  148.     RZ
  149.     ORI    0FFH
  150.     RET
  151. ;.....
  152. ;
  153. ;
  154. ; Input a character from the modem port.
  155. ;
  156. MDINP:    LDA    PORT        ; Get character
  157.     RET
  158. ;.....
  159. ;
  160. ;
  161. ; This routine will output a character to the data port.
  162. ;
  163. MDOUTP:    STA    PORT        ; Send character
  164.     RET
  165. ;.....
  166. ;
  167. ;
  168. ; Reinitialize the modem and hang up the phone by dropping DTR and
  169. ; leaving it inactive.
  170. ;
  171. MDQUIT:     IF    IMODEM        ; If using a smartmodem
  172.     CALL    IMQUIT        ; Tell it to shut down
  173.      ENDIF            ; IMODEM
  174. ;
  175. ;
  176. ; Called by the main program after caller types BYE
  177. ;
  178. MDSTOP:    MVI    A,41H        ; Drop DTR
  179.     STA    CPORT
  180.     XRA    A
  181.     STA    STPORT
  182.     RET
  183. ;.....
  184. ;
  185. ;
  186. ; If you do not support a particular baud rate, put it here before
  187. ; SETINV:
  188. ;
  189. SETINV:    ORI    0FFH
  190.     RET
  191. ;.....
  192. ;
  193. ;
  194. SET300:    MVI    A,16H
  195.     JMP    SETBAUD
  196. ;
  197. SET1200:MVI    A,18H
  198.     JMP    SETBAUD
  199. ;
  200. SET2400:MVI    A,1AH
  201.     JMP    SETBAUD
  202. ;
  203. SET4800:MVI    A,1CH
  204.     JMP    SETBAUD
  205. ;
  206. SET9600:MVI    A,1EH
  207. ;
  208. SETBAUD:STA    BRPORT
  209.     XRA    A        ; Shows the baud rate was changed ok
  210.     RET
  211. ;
  212. ;                end
  213. ;---------------------------------------------------------------------
  214.