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 / XMDP-1.AQM / XMDP-1.ASM
Assembly Source File  |  2000-06-30  |  8KB  |  234 lines

  1.  
  2. ; XMDP-1.ASM - XMODEMxx PATCH FILE FOR DATAPOINT 1560  11/17/83
  3. ; This file adapts XMODEMxx to the Datapoint 1560.  To use, first edit
  4. ; any options desired into XMODEMxx.ASM, then assemble (can use ASM.COM)
  5. ; and load to get XMODEMxx.COM.  Then edit this file as needed (check
  6. ; the CONOUT routine if you want to locally see file transfer time and
  7. ; the record count while programs are being sent).  Then assemble (can
  8. ; use ASM.COM) and merge via DDT or SID:
  9. ;
  10. ;    B>DDT XMODEMxx.COM
  11. ;    DDT VERS 2.2
  12. ;    NEXT  PC
  13. ;    1180 0100
  14. ;    -IXMDP-1.HEX        (note the 'I' command)
  15. ;    -R            ('R' loads in the .HEX file)
  16. ;    NEXT  PC
  17. ;    1180 0000
  18. ;    -G0            (return to CP/M)
  19. ;    B>SAVE 16 XMODEMxx.COM  (now have a modified .COM file)
  20. ;
  21. ; NOTE: Save 21 (rather than 16) if LOGCAL is YES
  22. ;
  23. ;=======================================================================
  24. ;
  25. ; 11/17/83 - Renamed to XMDP-1.ASM    - Irv Hoff
  26. ; 10/22/83 - Updated to XMODEM77    - Irv Hoff
  27. ; 04/04/83 - Updated to XMODEM74    - Irv Hoff
  28. ; 03/27/83 - Updated to XMODEM73    - Irv Hoff
  29. ; 03/17/83 - Updated to XMODEM72    - Irv Hoff
  30. ; 03/15/83 - Updated to XMODEM71    - Irv Hoff
  31. ;
  32. ; 03/07/83  Added instructions on how to adapt this file to XMODEM70.COM.
  33. ;        Standardized the format.  Added automatic MSPEED from "BYE"
  34. ;        program.  Added CONOUT information.
  35. ;                    - Irv Hoff
  36. ;
  37. ;=======================================================================
  38. YES:    EQU    0FFH
  39. NO:    EQU    0
  40. ;
  41. ;=======================================================================
  42. ;
  43. MODCTLP: EQU    029H        ;first control/status port
  44. MODDATP: EQU    MODCTLP-1    ;data in port
  45. MODSNDB: EQU    1        ;bit to test for send
  46. MODSNDR: EQU    1        ;value when ready
  47. MODRCVB: EQU    2        ;bit to test for receive
  48. MODRCVR: EQU    2        ;value when ready
  49. MODDCDB: EQU    4        ;carrier detect bit
  50. MODDCDA: EQU    0        ;value when active
  51. ;
  52.  
  53. LSPEED:    EQU    YES        ;yes if using 'BYE' with speed selection
  54.                 ;no if using 'SPEED' manual selection
  55. MSPEED:    EQU    3CH        ;location of baud rate factor (set by
  56.                 ;'BYE').  set location in 'BYE' to agree.
  57.                 ;3dh and 3eh often used by newer ver-
  58.                 ;sions of 'ZCPR'.
  59. XSPEED:    EQU    5        ;speed for file time transfer without
  60.                 ;auto-set.  use one of the following:
  61.                 ;0=110 1=300 2=450 3=600 4=710 5=1200
  62. BASE:    EQU    100H        ;start of cp/m normal program area
  63. ;
  64. ;-------------------------------------------------------------------
  65. ;
  66. ; Jump table: The jump table must be in exactly the same sequence as the
  67. ; one in XMODEM.
  68. ;
  69. ;
  70.      ORG    BASE+3        ;start after 'JMP BEGIN'
  71. ;
  72. ;
  73. CONOUT:     JMP    0E1D4H        ;must be 00000h if not used, see below
  74.                 ;(may be changed to  jmp  crtout, if
  75.                 ;routine below is used)
  76. PMINIT:     JMP    MINIT        ;initialization routine (if needed)
  77. PUNINIT: JMP    UNINIT        ;undo whatever 'MINIT' did (or return)
  78. PSENDR:     JMP    SENDR        ;send character (via pop psw)
  79. PCAROK:     JMP    CAROK        ;test for carrier
  80. PMDIN:     JMP    MDIN        ;receive data byte
  81. PGETCHR: JMP    GETCHR        ;get character from modem
  82. PRCVRDY: JMP    RCVRDY        ;check receive ready
  83. PSNDRDY: JMP    SNDRDY        ;check send ready
  84. PSPEED:     JMP    SPEED        ;get speed value for file transfer time
  85. PEXTRA1: JMP    EXTRA1        ;extra for custom routine
  86. PEXTRA2: JMP    EXTRA2        ;extra for custom routine
  87. PEXTRA3: JMP    EXTRA3        ;extra for custom routine
  88. ;
  89. ;=======================================================================
  90. ;
  91. ; -- To Display the Record Count on the CRT During Program Transfers --
  92. ;
  93. ;    The CRTOUT routine below may be used if you know the ports used
  94. ; by your CRT for status and data.  (Cannot be used with memory mapped
  95. ; displays.)  If using the CRTOUT routine, skip rest of this discussion.
  96. ;
  97. ;    This one addition requires some work on the part of the user.
  98. ; When "BYE" is added, CP/M is normally moved lower to accomodate the
  99. ; new program above CP/M.  Whenever BYE is called to enable the RCPM
  100. ; capability, it steals some of the addresses contained in the BIOS jump
  101. ; vector table.  In order to display on the CRT during program transfers
  102. ; you need to get into the BIOS console output routine directly, else
  103. ; what is being displayed also tries to go out the modem.  This is a big
  104. ; NO-NO at that time.  (This cannot be done automatically by XMODEM,
  105. ; since BYE has already taken the address we need to find, by the time
  106. ; XMODEM is automatically activated by the remote station.)
  107. ;
  108. ;    So with the disk containing BYE, but prior to activating BYE, do
  109. ; this:
  110. ;        1) Cold reboot to move CP/M (and BIOS) to the new area
  111. ;            needed when BYE is activated on the same disk.
  112. ;        2) Use DDT and dump the area from 0000H to 0002H.  This
  113. ;                   gives the warm reboot address in BIOS.
  114. ;        3) Add 9 Bytes to that address to get your console out-
  115. ;             put jump vector.
  116. ;        4) Pick off the address contained in the jump vector and
  117. ;             install that in "CONOUT", below.  Example of one
  118. ;             system in use:
  119. ;
  120. ;            FIRST, COLD REBOOT WITH DISK CONTAINING "BYE"
  121. ;
  122. ;      0000  C3 03 E0    (location of warm reboot on disk with BYE
  123. ;
  124. ;            PRIOR TO ACTIVATING BYE BUT ON SAME DISK
  125. ;
  126. ;      E003  C3 E9 E0    (BIOS warm reboot jump vector on this disk)
  127. ;      E006  C3 00 E9    (BIOS get console status routine)
  128. ;      E009  C3 B7 E1    (BIOS console input routine)
  129. ;      E00C  C3 D4 E1    (BIOS console output routine)
  130. ;
  131. ;        The address we need is thus E1D4.  Put that below, in
  132. ;        our example it would be:    CONOUT   JMP   0E1D4H
  133. ;
  134. ;
  135. ;    CONOUT:      JMP    00000H    ;If you wish to show the record count
  136. ;                ;during program transfer, fill in this
  137. ;                ;address at 'CONOUT' above.
  138. ;
  139. ;                    - Irv Hoff
  140. ;
  141. ;=======================================================================
  142. ;
  143. ; ---> CAROK - check for presence of carrier.  RET with Z = carrier on
  144. ;
  145. CAROK:    XRA    A
  146.     RET
  147. ;
  148. ;=======================================================================
  149. ;
  150. ; ---> CRTOUT - allows direct output to the CRT, in place of the CONOUT
  151. ;        address.  Do not use with memory mapped displays.  Change
  152. ;        the above to  CONOUT  JMP  CTROUT then change the follow-
  153. ;        ing if your ports are different -- your port may not be
  154. ;        the same and your 'ready bit' to check may be different.
  155. ;
  156. CRTOUT:    IN    20H        ;console status port
  157.     ANI    04H        ;see if ready to send another char.
  158.     JZ    CRTOUT        ;loop until ready
  159.     MOV    A,C        ;get the character
  160.     OUT    21H        ;output to console data port
  161.     RET
  162. ;
  163. ;=======================================================================
  164. ;
  165. EXTRA1:    RET            ;for later use
  166. EXTRA2:    RET            ;for later use
  167. EXTRA3:    RET            ;for later use
  168. ;
  169. ;=======================================================================
  170. ;
  171. ; ---> GETCHR - get a character, same as MDIN
  172. ; ---> MDIN - - get a character, same as GETCHR
  173. ;
  174. GETCHR:
  175. MDIN:    IN    MODDATP        ;get character from data in port
  176.     RET
  177. ;
  178. ;=======================================================================
  179. ;
  180. MINIT:    RET            ;no initialization required
  181. ;
  182. ;=======================================================================
  183. ;
  184. ; ---> RCVRDY - check receive ready.  RET with Z = character available.
  185. ;            Return with error code in A-reg.
  186. ;
  187. RCVRDY:    IN    MODCTLP        ;get modem status
  188.     ANI    MODRCVB        ;isolate ready bit
  189.     CPI    MODRCVR        ;test it
  190.     RET
  191. ;
  192. ;=======================================================================
  193. ;
  194. ; ---> SENDR - send character.  (Comes here via a "JZ SENDR" so no prob-
  195. ;              lem with the stack because of the "POP PSW".
  196. ;
  197. SENDR:    POP    PSW        ;get the character back
  198.     OUT    MODDATP        ;send it to the modem output
  199.     RET
  200. ;
  201. ;=======================================================================
  202. ;
  203. ; ---> SNDRDY - check if ready to send.
  204. ;
  205. SNDRDY:    IN    MODCTLP        ;get status byte
  206.     ANI    MODSNDB        ;isolate ready bit
  207.     CPI    MODSNDR        ;ready to send?
  208.     RET
  209. ;
  210. ;=======================================================================
  211. ;
  212. ; ---> SPEED - sets the time shown for program transfer.
  213. ;
  214. SPEED:     IF    LSPEED
  215.     LDA    MSPEED        ;get index for baud rate from 'BYE'
  216.      ENDIF
  217. ;
  218.      IF     NOT LSPEED
  219.     MVI    A,XSPEED    ;get index for baud rate from 'XSPEED'
  220.      ENDIF
  221. ;
  222.     RET
  223. ;
  224. ;=======================================================================
  225. ;
  226. UNINIT:    RET            ;not initialized, so no 'un-initialize'
  227. ;
  228. ;=======================================================================
  229. ;
  230. ;
  231.     END
  232.