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 / B5AM-1.INS < prev    next >
Text File  |  2000-06-30  |  4KB  |  174 lines

  1.  
  2. ; B5AM-1.INS - AMPRO "Little Board" insert for BYE5 - 07/17/85
  3. ;
  4. ;        DART I/O and CTC timer 2.000 MHz
  5. ;
  6. ; Note:  This is an insert, not an overlay.
  7. ;
  8. ; This version is for the AMPRO "Little Board" using channel "B" of the
  9. ; Z80 DART.  The Z80-CTC is used as the baud rate generator.
  10. ;
  11. ;       The AMPRO computer does not implement DTR or DCD
  12. ;       (CTS and RTS are used instead - however they take
  13. ;       the CTS to the AMPRO pin 20!)
  14. ;
  15. ;       Make up a RS232 cable per the instructions below:
  16. ;
  17. ;            Modem       Ampro
  18. ;            -----       -----
  19. ;            pin 2    -  pin 3
  20. ;            pin 3    -  pin 2
  21. ;            pin 7    -  pin 7
  22. ;            pin 8    -  pin 20
  23. ;            pin 20    -  pin 5
  24. ;
  25. ; Note: These pin assignments assume that your Little Board RS232 female
  26. ; connector is wired the same as the Ampro assembled computers.
  27. ;
  28. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  29. ;
  30. ; 07/17/85  Written for use with BYE5        - Irv Hoff
  31. ; 02/08/84  Initial Version            - Jerry Haigwood
  32. ;
  33. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  34. ;
  35. ;-----------------------------------------------------------------------
  36. ;
  37. ;
  38. PORT    EQU    88H        ; Data port
  39. MDCTL1    EQU    PORT+4        ; Status/control port
  40. BRPORT    EQU    50H        ; Baud rate port
  41. ;
  42. ;
  43. BD300    EQU    47D0H        ; 62400/300  (first half is CTC command)
  44. BD1200    EQU    4734H        ; 62400/1200
  45. BD2400    EQU    471AH        ; 62400/2400
  46. ;
  47. ;
  48. ;-----------------------------------------------------------------------
  49. ;
  50. ; See if we still have a carrier - if not, return with the zero flag set
  51. ;
  52. MDCARCK:MVI    A,10H        ; Reset status
  53.     OUT    MDCTL1
  54.     IN    MDCTL1        ; Get status
  55.     ANI    20H        ; Check for data carrier
  56.     RET
  57. ;.....
  58. ;
  59. ;
  60. ; Disconnect and wait for an incoming call
  61. ;
  62. MDINIT:    MVI    A,18H        ; Reset channel
  63.     OUT    MDCTL1
  64.     MVI    A,4        ; Setup to write register 4
  65.     OUT    MDCTL1
  66.     MVI    A,84H        ;*1 stop, 8 bits, no parity, 32x
  67.     OUT    MDCTL1
  68.     MVI    A,5        ; Setup to write register 5
  69.     OUT    MDCTL1
  70.     MVI    A,68H        ; Clear RTS causing hangup
  71.     OUT    MDCTL1
  72.     PUSH    B        ; Save in case it's being used elsewhere
  73.     MVI    B,20        ; 2 seconds delay to drop any carrier
  74. ;
  75. OFFTI:    CALL    DELAY        ; 0.1 second delay
  76.     DCR    B
  77.     JNZ    OFFTI        ; Keep looping until finished
  78.     POP    B        ; Restore bc
  79.     MVI    A,3        ; Setup to write register 3
  80.     OUT    MDCTL1
  81.     MVI    A,0C1H        ; Initialize receive register
  82.     OUT    MDCTL1
  83.     MVI    A,5        ; Setup to write register 5
  84.     OUT    MDCTL1
  85.     MVI    A,0EAH        ; Turn on RTS so modem can answer phone
  86.     OUT    MDCTL1
  87. ;
  88.      IF    IMODEM        ; If using intelligent modem
  89.     CALL    IMINIT        ; Go initialize
  90.      ENDIF            ; IMODEM
  91. ;
  92.     RET
  93. ;.....
  94. ;
  95. ;
  96. ; Input a character from the modem port
  97. ;
  98. MDINP:    IN    PORT        ; Get character
  99.     RET
  100. ;.....
  101. ;
  102. ;
  103. ; Check the status to see if a character is available.    If not, return
  104. ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  105. ;
  106. MDINST:    IN    MDCTL1        ; Get status
  107.     ANI    01H        ; Check receive ready bit
  108.     RZ            ; Return if none
  109.     ORI    0FFH        ; Otherwise, set the proper flag
  110.     RET
  111. ;.....
  112. ;
  113. ;
  114. ; Send a character to the modem
  115. ;
  116. MDOUTP:    OUT    PORT        ; Send it
  117.     RET
  118. ;.....
  119. ;
  120. ;
  121. ; See if the output is ready for another character
  122. ;
  123. MDOUTST:IN    MDCTL1
  124.     ANI    04H        ; Check transmit ready bit
  125.     RET
  126. ;.....
  127. ;
  128. ;
  129. ; Reinitialize the modem and hang up the phone by dropping DTR and
  130. ; leaving it inactive.
  131. ;
  132. MDQUIT:     IF    IMODEM        ; If using a smartmodem
  133.     CALL    IMQUIT        ; Tell it to shut down
  134.      ENDIF            ; IMODEM
  135. ;
  136. ;
  137. ; Called by the main program after caller types BYE
  138. ;
  139. MDSTOP:    MVI    A,5        ; Setup to write register 5
  140.     OUT    MDCTL1
  141.     MVI    A,68H        ; Clear RTS causing shutdown
  142.     OUT    MDCTL1
  143.     RET
  144. ;.....
  145. ;
  146. ;
  147. ; The following routine sets the baudrate.  BYE5 asks for the maximum
  148. ; speed you have available.
  149. ;
  150. SETINV:    ORI    0FFH        ; Make sure zero flag is not set
  151.     RET            ; Return
  152. ;.....
  153. ;
  154. ;
  155. SET300:    LXI    H,BD300        ; Get 300 bps parameters in 'HL'
  156.     JMP    LOADBD        ; Go load them
  157. ;
  158. SET1200:LXI    H,BD1200
  159.     JMP    LOADBD
  160. ;
  161. SET2400:LXI    H,BD2400
  162. ;
  163. LOADBD:    MOV    A,H        ; CTC command word
  164.     OUT    BRPORT
  165.     MOV    A,L        ; Baudrate
  166.     OUT    BRPORT
  167.     XRA    A
  168.     RET
  169. ;.....
  170. ;
  171. ;                   end
  172. ;-----------------------------------------------------------------------
  173.