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 / BBSING / MBBS / MBKMDOVL.LBR / KMCS-1.AZM / KMCS-1.ASM
Assembly Source File  |  2000-06-30  |  8KB  |  245 lines

  1. ;
  2. ; ==============================================================
  3. ; KMCS-1.ASM - MB-KMD patch file for Z80 SIO (DART) on a CCS2719
  4. ; ==============================================================
  5. ;
  6. ;
  7. ; =============
  8. ; Introduction:
  9. ; =============
  10. ;
  11. ; This file adapts MB-KMD to run with the Z80 SIO (DART) on a SSC 2719.
  12. ;
  13. ; To use, first edit any options desired into the mainline source code of
  14. ; the transfer program, then assemble with ASM or MAC to produce a HEX file.
  15. ;
  16. ; Then edit this file as needed (check the CONOUT routine if you want to 
  17. ; locally see file transfer time and the record count while programs are 
  18. ; being sent).  Then assemble this overlay with ASM or MAC.
  19. ;
  20. ; Now merge the two .HEX files using MLOAD.COM (available on most RCP/M
  21. ; systems using the command:
  22. ;
  23. ;     MLOAD KMD=MB-KMD,KMCS-1
  24. ;
  25. ; Then place the resulting .COM file on your system where it is accessible
  26. ; from any drive/user area (usually A0:)
  27. ;
  28. ;
  29. ; ===============
  30. ; Update History:
  31. ; ===============
  32. ;
  33. ; 08/21/86 - Edited for inclusion in MBKMDOVL.LBR    - Bob Kramer
  34. ; 08/09/86 - Inspected for MB-KMD compatibility        - Michael Conley
  35. ; 14/06/84 - Changed for CCS2719            - Joe Wright
  36. ; 11/17/83 - Renamed to XMEX-1.ASM            - Irv Hoff
  37. ; 10/22/83 - Updated to XMODEM77            - Irv Hoff
  38. ; 04/04/83 - Updated to XMODEM74            - Irv Hoff
  39. ; 03/27/83 - Updated to XMODEM73            - Irv Hoff
  40. ; 03/17/83 - Updated to XMODEM72            - Irv Hoff
  41. ; 03/15/83 - Updated to XMODEM71            - Irv Hoff
  42. ;
  43. ; 03/07/83  Added instructions on how to adapt this file to XMODEM70.COM.
  44. ;        Standardized the format.  Added automatic MSPEED from "BYE"
  45. ;        program.  Added CONOUT information.  Adapted from XM70PMMI.
  46. ;                            - Irv Hoff
  47. ;
  48. ;
  49. ; ==============
  50. YES:     EQU    0FFH
  51. NO:     EQU    0
  52. ;
  53. MODDATP: EQU    56H        ; Data in port (CCS2719 PORT B)
  54. MODDATO: EQU    MODDATP        ; Data out port
  55. MODCTLP: EQU    MODDATP+1    ; Control/status port
  56. MODSNDB: EQU    4        ; Bit to test for send
  57. MODSNDR: EQU    4        ; Value when ready
  58. MODRCVB: EQU    1        ; Bit to test for receive
  59. MODRCVR: EQU    1        ; Value when ready
  60. MODDCDB: EQU    8        ; Carrier detect bit
  61. MODDCDA: EQU    8        ; Value when active
  62. ;
  63. LSPEED:     EQU    YES        ; Yes,  using 'BYE' with speed selection
  64.                 ; No,  using 'SPEED' manual selection
  65. MSPEED:     EQU    3CH        ; Location of baud rate factor (set by
  66.                 ; 'BYE')  set location in 'BYE' to agree.
  67.                 ; 3DH and 3EH often used by newer versions
  68.                 ; of 'ZCPR'.
  69. XSPEED:     EQU    1        ; Speed for file time transfer without
  70.                 ; auto-set.  use one of the following:
  71.                 ; 0=110 1=300 2=450 3=600 4=710 5=1200
  72. BASE:     EQU    100H        ; Start of CP/M normal program area
  73. ;
  74. ;
  75. ; ===========
  76. ; Jump table:
  77. ; ===========
  78. ;
  79. ; The jump table must be in exactly the same sequence as the one in MB-KMD.
  80. ;  Note the ORG of 103H - This jump table has no jump to 'BEGIN'.
  81. ;
  82.      ORG    BASE+3        ; Start after 'JMP BEGIN'
  83. ;
  84. CONOUT:     JMP    0E857H        ; Must be 00000h if not used, see below
  85. PMINIT:     JMP    MINIT        ; Initialization routine (if needed)
  86. PUNINIT: JMP    UNINIT        ; Undo whatever 'MINIT' did (or return)
  87. PSENDR:     JMP    SENDR        ; Send character (via pop psw)
  88. PCAROK:     JMP    CAROK        ; Test for carrier
  89. PMDIN:     JMP    MDIN        ; Receive data byte
  90. PGETCHR: JMP    GETCHR        ; Get character from modem
  91. PRCVRDY: JMP    RCVRDY        ; Check receive ready
  92. PSNDRDY: JMP    SNDRDY        ; Check send ready
  93. PSPEED:     JMP    SPEED        ; Get speed value for file transfer time
  94. PEXTRA1: JMP    EXTRA1        ; Extra for custom routine
  95. PEXTRA2: JMP    EXTRA2        ; Extra for custom routine
  96. PEXTRA3: JMP    EXTRA3        ; Extra for custom routine
  97. ;
  98. ;
  99. ; ================================================================
  100. ; To Display the Record Count on the CRT During Program Transfers:
  101. ; ================================================================
  102. ;    
  103. ;    This one addition requires some work on the part of the user.  When
  104. ; "BYE" is added,  CP/M is normally moved lower to accomodate the new
  105. ; program above CP/M.  Whenever BYE is called to enable the RCPM capability,
  106. ; it steals some of the addresses contained in the BIOS jump vector table.
  107. ; In order to display on the CRT during program transfers you need to get
  108. ; into the BIOS console output routine directly,  else what is being
  109. ; displayed also tries to go out the modem.  This is a big NO-NO at that
  110. ; time.  (This cannot be done automatically by MB-KMD,  since BYE has
  111. ; already taken the address we need to find,  by the time MB-KMD is auto-
  112. ; matically activated by the remote station.)
  113. ;
  114. ;    So,  with the disk containing BYE, but prior to activating BYE, do
  115. ; this:
  116. ;    1) Cold reboot to move CP/M (and BIOS) to the new area needed
  117. ;            when BYE is activated on the same disk.
  118. ;    2) Use DDT and dump the area from 0000H to 0002H.  This gives
  119. ;         the warm reboot address in BIOS.
  120. ;    3) Add 9 Bytes to that address to get your console output jump
  121. ;         vector.
  122. ;    4) Pick off the address contained in the jump vector and install
  123. ;         that in "CONOUT", below.  Example of one system in use:
  124. ;
  125. ;  FIRST, COLD REBOOT WITH DISK CONTAINING "BYE"
  126. ;
  127. ;      0000  C3 03 E0    (location of warm reboot on disk with BYE
  128. ;
  129. ;  PRIOR TO ACTIVATING BYE BUT ON SAME DISK
  130. ;
  131. ;      E003  C3 E9 E0    (BIOS warm reboot jump vector on this disk)
  132. ;      E006  C3 00 E9    (BIOS get console status routine)
  133. ;      E009  C3 B7 E1    (BIOS console input routine)
  134. ;      E00C  C3 D4 E1    (BIOS console output routine)
  135. ;
  136. ;        The address we need is thus E1D4.  Put that below, in
  137. ;        our example it would be:    CONOUT   JMP   0E1D4H
  138. ;
  139. ;
  140. ;CONOUT:  JMP    00000H        ; If you wish to show the record count
  141. ;                ; during program transfer, fill in this
  142. ;                ; address at 'CONOUT' above.
  143. ;
  144. ;                        - Irv Hoff
  145. ;
  146. ;
  147. ; ==============================
  148. ; --> MDSTS - check modem status
  149. ; ==============================
  150. ;
  151. MDSTS:    MVI    A,10H        ; Reset status/interrupt
  152.     OUT    MODCTLP
  153.     IN    MODCTLP        ; Get rr0
  154.     RET
  155. ;
  156. ;
  157. ; =========================================
  158. ; --> CAROK - check for presence of carrier
  159. ; =========================================
  160. ;
  161. ; RET with Z = carrier on
  162. ;
  163. CAROK:    CALL    MDSTS        ; Get modem status
  164.     ANI    MODDCDB        ; Get carrier detect bit
  165.     CPI    MODDCDA        ; Test bit
  166.     RET
  167. ;
  168. ;
  169. ; ==============
  170. ;
  171. EXTRA1:    RET            ; For later use
  172. EXTRA2:    RET            ; For later use
  173. EXTRA3:    RET            ; For later use
  174. ;
  175. ;
  176. ; ==========================================
  177. ; --> GETCHR - get a character, same as MDIN
  178. ; --> MDIN - get a character, same as GETCHR
  179. ; ==========================================
  180. ;
  181. GETCHR:
  182. MDIN:    IN    MODDATP        ; Get character from data in port
  183.     RET
  184. ;
  185. ;
  186. ; ==============
  187. ;
  188. MINIT:    RET            ; No initialization required
  189. ;
  190. ;
  191. ; ================================
  192. ; --> RCVRDY - check receive ready
  193. ; ================================
  194. ;
  195. ; RET with Z = character available.
  196. ;
  197. RCVRDY:    IN    MODCTLP        ; Check character ready
  198.     ANI    MODRCVB        ; Isolate ready bit
  199.     CPI    MODRCVR        ; Test it
  200.     RET
  201. ;
  202. ;
  203. ; ==========================
  204. ; --> SENDR - send character
  205. ; ==========================
  206. ;
  207. SENDR:    POP    PSW        ; Get the character back
  208.     OUT    MODDATO        ; Send it to the modem output
  209.     RET
  210. ;
  211. ;
  212. ; ===================================
  213. ; --> SNDRDY - check if ready to send
  214. ; ===================================
  215. ;
  216. SNDRDY:    IN    MODCTLP        ; Get status byte
  217.     ANI    MODSNDB        ; Isolate ready bit
  218.     CPI    MODSNDR        ; Ready to send?
  219.     RET
  220. ;
  221. ;
  222. ; ====================================================
  223. ; --> SPEED - sets the time shown for program transfer
  224. ; ====================================================
  225. ;
  226. SPEED:     IF    LSPEED
  227.     LDA    MSPEED        ; Get index for baud rate from 'BYE'
  228.      ENDIF
  229. ;
  230.      IF     NOT LSPEED
  231.     MVI    A,XSPEED    ; Get index for baud rate from 'XSPEED'
  232.      ENDIF
  233. ;
  234.     RET
  235. ;
  236. ;
  237. ; ==============
  238. ;
  239. UNINIT:    RET            ; Not initialized, so no 'UN-INITIALIZE'
  240. ;
  241. ; ==============
  242. ;
  243. ;
  244.     END