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 / B5AC-1.IQS / B5AC-1.INS
Text File  |  2000-06-30  |  3KB  |  133 lines

  1.  
  2. ; B5AC-1 - Apple-Cat insert for BYE5 - 07/17/85
  3. ;
  4. ;        Novation Apple-Cat routines for BYE5
  5. ;
  6. ; This version is for the Apple ][ running with an Apple-Cat modem card.
  7. ; Note:  This is an insert, not an overlay.
  8. ;
  9. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  10. ;
  11. ; 07/17/85  Written to work with BYE5        - Irv Hoff
  12. ;
  13. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  14. ;
  15. ;
  16. ; Apple-Cat modem address equates
  17. ;
  18. SLOT    EQU    2        ; Apple-Cat residing in Slot #2
  19. SLOTVAL    EQU    SLOT*16        ; Number to add for proper slot
  20. ;
  21. MCSTATP    EQU    0E080H+SLOTVAL    ; Carrier status
  22. LNCTL    EQU    0E081H+SLOTVAL    ; Line control
  23. PHCTL    EQU    0E082H+SLOTVAL    ; Phone control
  24. BSRINT    EQU    0E083H+SLOTVAL    ; BSR and interrupts
  25. RCVCTL    EQU    0E089H+SLOTVAL    ; Receiver control
  26. MDPORT    EQU    0E08AH+SLOTVAL    ; Mode (parity/stop bits) port
  27. BAUDPT    EQU    0E08BH+SLOTVAL    ; Baud rate port
  28. XRINT    EQU    0E08CH+SLOTVAL    ; Transmit/receive interrupts
  29. TRXCTL    EQU    0E08DH+SLOTVAL    ; Transmitter control
  30. MODSEL    EQU    0E08FH+SLOTVAL    ; Modem select port
  31. ;
  32. RSPORT    EQU    0E08FH+SLOTVAL    ; Receive status port
  33. RDPORT    EQU    0E08BH+SLOTVAL    ; Receive data port
  34. TSPORT    EQU    0E08FH+SLOTVAL    ; Transmit status port
  35. TDPORT    EQU    0E08EH+SLOTVAL    ; Transmit data port
  36. ;
  37. ;
  38. ;-----------------------------------------------------------------------
  39. ;
  40. ; See if we still have a carrier - if not, return with the zero flag set
  41. ;
  42. MDCARCK:LDA    MCSTATP        ; Get carrier status
  43.     ANI    20H        ; Got a carrier?
  44.     RET
  45. ;.....
  46. ;
  47. ;
  48. ; Disconnect and wait for an incoming call
  49. ;
  50. MDINIT:    MVI    A,1FH        ; Turn off transmitter
  51.     STA    TRXCTL
  52.     MVI    A,0        ; Hang up phone
  53.     STA    PHCTL
  54.     RET
  55. ;.....
  56. ;
  57. ;
  58. ; Input a character from the modem port
  59. ;
  60. MDINP:    MVI    A,10H        ; Clear receiver
  61.     STA    TRXCTL
  62.     LDA    RDPORT        ; Read character
  63.     RET
  64. ;.....
  65. ;
  66. ;
  67. ; Check the status to see if a character is available.    If not, return
  68. ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  69. ;
  70. MDINST:    LDA    RSPORT        ; Get modem status
  71.     ANI    08H        ; Data available?
  72.     RZ            ; Nope
  73.     ORI    0FFH        ; Return true
  74.     RET
  75. ;.....
  76. ;
  77. ;
  78. ; Send a character to the modem
  79. ;
  80. MDOUTP:    STA    TDPORT        ; Send character
  81.     RET
  82. ;.....
  83. ;
  84. ;
  85. ; See if the output is ready for another character
  86. ;
  87. MDOUTST:LDA    TSPORT        ; Get modem status
  88.     ANI    10H        ; Check transmit ready bit
  89.     RET
  90. ;.....
  91. ;
  92. ;
  93. ; Reinitialize the modem and hang up the phone by dropping DTR and
  94. ; leaving it inactive.
  95. ;
  96. MDQUIT:     IF    IMODEM        ; If using a smartmodem
  97.     CALL    IMQUIT
  98.      ENDIF            ; IMODEM
  99. ;.....
  100. ;
  101. ;
  102. MDSTOP:    MVI    A,1FH        ; Turn off transmitter
  103.     STA    TRXCTL
  104.     MVI    A,0        ; Hang up phone
  105.     STA    PHCTL
  106.     RET
  107. ;.....
  108. ;
  109. ;
  110. ; The following routine sets the baudrate.  BYE5 asks for the maximim
  111. ; speed you have available.
  112. ;
  113. SET1200    EQU    $        ; 1200 bps not supported
  114. SET2400    EQU    $        ; 2400 bps not supported
  115. ;
  116. SETINV:    ORI    0FFH        ; Make sure the Zero flag isn't set
  117.     RET
  118. ;.....
  119. ;
  120. ;
  121. SET300:    CALL    MDINP        ; Set for 300 baud
  122.     CALL    MDINP
  123.     MVI    A,22H        ; Set 300 baud
  124.     STA    BAUDPT
  125.     MVI    A,03H        ; Set 8 data bits, no parity, 1 stop bit
  126.     STA    MDPORT        ; 03H = 1 stop, 0DH = 2 stop bits
  127.     XRA    A
  128.     RET
  129. ;.....
  130. ;
  131. ;                   end
  132. ;-----------------------------------------------------------------------
  133.