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 / NUBYE / NUBY-INS.LBR / NUAS-1.IQS / nuas-1.ins
Text File  |  1986-04-26  |  5KB  |  182 lines

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