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 / MODEMS / XMODEM / XMIN-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  9KB  |  251 lines

  1.  
  2. ; XMIN-1.ASM XMODEMxx PATCH FILE FOR INTERFACER-4 SERIAL BOARD 11/17/83
  3. ;
  4. ; This file adapts XMODEMxx to the CompuPro Interfacer 4 serial board.
  5. ; (Also the Interfacer 3 board). To use, first edit any options desired
  6. ; into XMODEMxx.ASM, then assemble (you can use ASM.COM) and load to get
  7. ; XMODEMxx.COM.  Then edit this file as needed (check the CONOUT routine
  8. ; if you want to locally see file transfer time and the record count
  9. ; while programs are being sent).  Then assemble (you can use ASM.COM)
  10. ; and merge via DDT or SID:
  11. ;
  12. ;    B>DDT XMODEMxx.COM
  13. ;    DDT VERS 2.2
  14. ;    NEXT  PC
  15. ;    1180 0100
  16. ;    -IXMIN-1.HEX        (note the 'I' command)
  17. ;    -R            ('R' loads in the .HEX file)
  18. ;    NEXT  PC
  19. ;    1180 0000
  20. ;    -G0            (return to CP/M)
  21. ;    B>SAVE 16 XMODEMxx.COM  (now have a modified .COM file)
  22. ;
  23. ; NOTE: Save 21 (rather than 16) if LOGCAL is YES
  24. ;
  25. ;=======================================================================
  26. ;
  27. ; 12/27/83 - Added USEDCD, some text        - Paul Train
  28. ; 05/14/83 - Added instructions, formated    - Irv Hoff
  29. ; 03/07/83 - Written                - Paul Traina
  30. ;
  31. ;=======================================================================
  32. ;
  33. ; NOTE:  The 2651 is sort of brain damaged (as are several different I/O
  34. ;     chips.  There is a problem if you have a modem that sends result
  35. ;     codes to the computer.  (Examples:  Hayes Smartmodems, Cermetek
  36. ;     Infomate 212a, Robotics).  If the DCD line is low, the 2651 will
  37. ;     ignore any incoming data from the modem.  In BYE, this causes
  38. ;     no problem, but if you desire to use MDM7 or YAM or COMM7 you
  39. ;     cannot receive any result codes until carrier is actually pre-
  40. ;     sent.  For a long time we used to flip a switch (it was switch
  41. ;     #6 on the Smartmodem) to force DCD true, but I have a better
  42. ;     method.  I tie DCD high, so the 2651 thinks that the carrier is
  43. ;     there and doesn't shutdown.  This leaves the problem of sensing
  44. ;     carrier, so I run pin 8 [DCD] from the modem to pin 6 (or pin
  45. ;     20) [DSR] of the serial port.  Then all that is needed is for
  46. ;     you to change the software to sense DSR for carrier instead of
  47. ;     DCD.  I have been using this method for 6 months now and it 
  48. ;     works >>beautifully<<.  If you wish to use this method of sen-
  49. ;     sing DCD by really checking DSR, then set "USEDCD" to no, else
  50. ;     set "USEDCD" to yes and you can operate the old way.
  51. ;                    - Paul Traina
  52. ;
  53. ;=======================================================================
  54. YES:     EQU    0FFH
  55. NO:     EQU    0
  56. ;
  57. USEDCD:     EQU    NO        ;no, check DSR instead of DCD
  58. ;
  59. MODDATP: EQU    10H        ;data in port
  60. MODDATO: EQU    MODDATP        ;data out port
  61. MODCTLP: EQU    MODDATP+1    ;control/status port
  62. MODCTL2: EQU    MODDATP+1    ;second control/status port
  63. MODUPRT: EQU    MODDATP+7    ;chip select port
  64. MODUSER: EQU    6        ;modem I/O on inter-3 board        
  65. MODSNDB: EQU    1        ;bit to test for send
  66. MODSNDR: EQU    1        ;value when ready
  67. MODRCVB: EQU    2        ;bit to test for receive
  68. MODRCVR: EQU    2        ;value when ready
  69. ;
  70.       IF    USEDCD        ;if using DCD
  71. MODDCDB: EQU    80h        ;carrier detect bit (DCD line from 2651)
  72. MODDCDA: EQU    80h        ;value when active
  73.       ENDIF
  74. ;
  75.       IF    NOT USEDCD
  76. MODDCDB: EQU    80h        ;carrier detect bit (DSR line from 2651)
  77. MODDCDA: EQU    80h        ;value when active
  78.       ENDIF
  79. ;
  80. LSPEED:     EQU    YES        ;yes if using 'BYE' with speed selection
  81.                 ;no if using 'SPEED' manual selection
  82. MSPEED:     EQU    3CH        ;location of baud rate factor (set by
  83.                 ;'BYE')  set location in 'BYE' to agree.
  84.                 ;3dh and 3eh often used by newer ver-
  85.                 ;sions of 'ZCPR'.
  86. XSPEED:     EQU    1        ;speed for file time transfer without
  87.                 ;auto-set.  use one of the following:
  88.                 ;0=110 1=300 2=450 3=600 4=710 5=1200
  89. BASE:     EQU    100H        ;start of CP/M normal program area
  90. ;
  91. ;-------------------------------------------------------------------
  92. ;
  93. ; Jump table: The jump table must be in exactly the same sequence as the
  94. ; one in XMODEM.  Note the ORG of 103H - This jump table has no jump to
  95. ; 'BEGIN'.
  96.  
  97. ;
  98.      ORG    BASE+3        ;start after 'JMP BEGIN'
  99. ;
  100. CONOUT:     JMP    00000H        ;must be 00000H if not used, see below
  101. PMINIT:     JMP    MINIT        ;initialization routine (if needed)
  102. PUNINIT: JMP    UNINIT        ;undo whatever 'MINIT' did (or return)
  103. PSENDR:     JMP    SENDR        ;send character (via pop psw)
  104. PCAROK:     JMP    CAROK        ;test for carrier
  105. PMDIN:     JMP    MDIN        ;receive data byte
  106. PGETCHR: JMP    GETCHR        ;get character from modem
  107. PRCVRDY: JMP    RCVRDY        ;check receive ready
  108. PSNDRDY: JMP    SNDRDY        ;check send ready
  109. PSPEED:     JMP    SPEED        ;get speed value for file transfer time
  110. PEXTRA1: JMP    EXTRA1        ;extra for custom routine
  111. PEXTRA2: JMP    EXTRA2        ;extra for custom routine
  112. PEXTRA3: JMP    EXTRA3        ;extra for custom routine
  113. ;
  114. ;=======================================================================
  115. ;
  116. ; -- To Display the Record Count on the CRT During Program Transfers --
  117. ;    
  118. ;    This one addition requires some work on the part of the user.
  119. ; When "BYE" is added, CP/M is normally moved lower to accomodate the
  120. ; new program above CP/M.  Whenever BYE is called to enable the RCPM
  121. ; capability, it steals some of the addresses contained in the BIOS jump
  122. ; vector table.  In order to display on the CRT during program transfers
  123. ; you need to get into the BIOS console output routine directly, else
  124. ; what is being displayed also tries to go out the modem.  This is a big
  125. ; NO-NO at that time.  (This cannot be done automatically by XMODEM,
  126. ; since BYE has already taken the address we need to find, by the time
  127. ; XMODEM is automatically activated by the remote station.)
  128. ;
  129. ;    So with the disk containing BYE, but prior to activating BYE, do
  130. ; this:
  131. ;        1) Cold reboot to move CP/M (and BIOS) to the new area
  132. ;            needed when BYE is activated on the same disk.
  133. ;        2) Use DDT and dump the area from 0000H to 0002H.  This
  134. ;                   gives the warm reboot address in BIOS.
  135. ;        3) Add 9 Bytes to that address to get your console out-
  136. ;             put jump vector.
  137. ;        4) Pick off the address contained in the jump vector and
  138. ;             install that in "CONOUT", below.  Example of one
  139. ;             system in use:
  140. ;
  141. ;            FIRST, COLD REBOOT WITH DISK CONTAINING "BYE"
  142. ;
  143. ;      0000  C3 03 E0    (location of warm reboot on disk with BYE
  144. ;
  145. ;            PRIOR TO ACTIVATING BYE BUT ON SAME DISK
  146. ;
  147. ;      E003  C3 E9 E0    (BIOS warm reboot jump vector on this disk)
  148. ;      E006  C3 00 E9    (BIOS get console status routine)
  149. ;      E009  C3 B7 E1    (BIOS console input routine)
  150. ;      E00C  C3 D4 E1    (BIOS console output routine)
  151. ;
  152. ;        The address we need is thus E1D4.  Put that below, in
  153. ;        our example it would be:    CONOUT   DW   0E1D4H
  154. ;
  155. ;
  156. ;    CONOUT:      DW    00000H    ;If you wish to show the record count
  157. ;                ;during program transfer, fill in this
  158. ;                ;address at 'CONOUT' above.
  159. ;
  160. ;                    - Irv Hoff
  161. ;
  162. ;=======================================================================
  163. ;
  164. ; ---> CAROK - check for presence of carrier.  RET with Z = carrier on
  165. ;
  166. CAROK:    MVI    A,MODUSER    ;select proper chip
  167.     OUT    MODUPRT
  168.     IN    MODCTLP        ;get status
  169.     ANI    MODDCDB        ;get carrier detect bit
  170.     CPI    MODDCDA        ;test bit
  171.     RET
  172. ;
  173. ;=======================================================================
  174. ;
  175. EXTRA1:    RET            ;for later use
  176. EXTRA2:    RET            ;for later use
  177. EXTRA3:    RET            ;for later use
  178. ;
  179. ;=======================================================================
  180. ;
  181. ; ---> GETCHR - get a character, same as MDIN
  182. ; ---> MDIN - - get a character, same as GETCHR
  183. ;
  184. GETCHR:
  185. MDIN:    MVI    A,MODUSER    ;select proper chip
  186.     OUT    MODUPRT
  187.     MVI    A,MODDATP
  188.     IN    MODDATP        ;get character from data in port
  189.     RET
  190. ;
  191. ;=======================================================================
  192. ;
  193. MINIT:    RET            ;no initialization required
  194. ;
  195. ;=======================================================================
  196. ;
  197. ; ---> RCVRDY - check receive ready.  RET with Z = character available.
  198. ;            Return with error code in A-reg.
  199. ;
  200. RCVRDY:    MVI    A,MODUSER    ;select proper chip
  201.     OUT    MODUPRT
  202.     IN    MODCTLP        ;get modem status
  203.     ANI    MODRCVB        ;isolate ready bit
  204.     CPI    MODRCVR        ;test it
  205.     RET
  206. ;
  207. ;=======================================================================
  208. ;
  209. ; ---> SENDR -- send character (comes here via a "JZ SENDR" so no stack
  210. ;        problems with the "POP PSW" in this routine.
  211. ;
  212. SENDR:    MVI    A,MODUSER    ;select proper chip
  213.     OUT    MODUPRT
  214.     POP    PSW        ;get the character back
  215.     OUT    MODDATO        ;send it to the modem output
  216.     RET
  217. ;
  218. ;=======================================================================
  219. ;
  220. ; ---> SNDRDY - check if ready to send.
  221. ;
  222. SNDRDY:    MVI    A,MODUSER    ;select proper chip
  223.     OUT    MODUPRT
  224.     IN    MODCTLP        ;get status byte
  225.     ANI    MODSNDB        ;isolate ready bit
  226.     XRI    MODSNDR        ;ready to send?
  227.     RET
  228. ;
  229. ;=======================================================================
  230. ;
  231. ; ---> SPEED - sets the time shown for program transfer.
  232. ;
  233. SPEED:     IF    LSPEED
  234.     LDA    MSPEED        ;get index for baud rate from 'BYE'
  235.      ENDIF
  236. ;
  237.      IF     NOT LSPEED
  238.     MVI    A,XSPEED    ;get index for baud rate from 'XSPEED'
  239.      ENDIF
  240. ;
  241.     RET
  242. ;
  243. ;=======================================================================
  244. ;
  245. UNINIT:    RET            ;not initialized, so no 'UN-INITIALIZE'
  246. ;
  247. ;=======================================================================
  248. ;
  249. ;
  250.     END