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 / XMTV-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  7KB  |  212 lines

  1.  
  2. ; XMTV-1.ASM - Patch file for TeleVideo 802 -- 11/17/83
  3. ;
  4. ; This file adapts XMODEMxx to an external modem.  This particular setup
  5. ; uses the TV802 modem port.  To use, first edit any options desired into
  6. ; XMODEMxx.ASM, then assemble (can use ASM.COM) and load which supplies
  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 (can use ASM.COM) and
  10. ; merge via DDT or SID:
  11. ;
  12. ;    B>DDT XMODEMxx.COM
  13. ;    DDT VERS 2.2
  14. ;    NEXT  PC
  15. ;    1180 0100
  16. ;    -IXMTC-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. ; 11/17/83 - Renamed to XMTV-1.ASM    - Irv Hoff
  28. ; 10/22/83 - Updated to XMODEM77    - Irv Hoff
  29. ; 03/27/83 - Updated to XMODEM73    - Irv Hoff
  30. ; 03/17/83 - Updated to XMODEM72    - Irv Hoff
  31. ; 03/15/83 - Updated to XMODEM71    - Irv Hoff
  32. ;
  33. ; 03/07/83  Added instructions on how to adapt this file to XMODEM70.COM.
  34. ;        Standardized the format.  Added automatic MSPEED from "BYE"
  35. ;        program.  Added CONOUT information.  Adapted from XM70PMMI.
  36. ;                    - Irv Hoff
  37. ;
  38. ;=======================================================================
  39. YES:    EQU    0FFH
  40. NO:    EQU    0
  41. ;
  42. ;=======================================================================
  43. ;
  44. MODDATP: EQU    20H        ;data in port
  45. MODDATO: EQU    MODDATP        ;data out port    
  46. MODCTLP: EQU    MODDATP+2    ;control/status port.
  47. MODDCD:     EQU    00001000B    ;value for data carrier detect.
  48. MODDAV:     EQU    00000001B    ;value for data available.
  49. MODBMT:     EQU    00000100B    ;value for output buffer empty.
  50. ;
  51. ;
  52. LSPEED:    EQU    YES        ;yes if using 'BYE' with speed selection
  53.                 ;no if using 'SPEED' manual selection
  54. MSPEED:    EQU    3CH        ;location of baud rate factor (set by
  55.                 ;'BYE')  set location in 'BYE' to agree.
  56.                 ;3dh and 3eh often used by newer ver-
  57.                 ;sions of 'ZCPR'.
  58. XSPEED:    EQU    1        ;speed for file time transfer without
  59.                 ;auto-set.  use one of the following:
  60.                 ;0=110 1=300 2=450 3=600 4=710 5=1200
  61. BASE    EQU    100H        ;start of cp/m normal program area
  62. ;
  63. ;-------------------------------------------------------------------
  64. ;
  65. ; Jump table: The jump table must be in exactly the same sequence as the
  66. ; one in XMODEM.  Note the ORG of 103H - This jump table has no jump to
  67. ; 'BEGIN'.
  68.  
  69. ;
  70.      ORG    BASE+3        ;start after 'JMP BEGIN'
  71. ;
  72. CONOUT:     JMP    0EBBDH        ;televideo 802 conout
  73. PMINIT:     JMP    MINIT        ;initialization routine (if needed)
  74. PUNINIT: JMP    UNINIT        ;undo whatever 'MINIT' did (or return)
  75. PSENDR:     JMP    SENDR        ;send character (via pop psw)
  76. PCAROK:     JMP    CAROK        ;test for carrier
  77. PMDIN:     JMP    MDIN        ;receive data byte
  78. PGETCHR: JMP    GETCHR        ;get character from modem
  79. PRCVRDY: JMP    RCVRDY        ;check receive ready
  80. PSNDRDY: JMP    SNDRDY        ;check send ready
  81. PSPEED:     JMP    SPEED        ;get speed value for file transfer time
  82. PEXTRA1: JMP    EXTRA1        ;extra for custom routine
  83. PEXTRA2: JMP    EXTRA2        ;extra for custom routine
  84. PEXTRA3: JMP    EXTRA3        ;extra for custom routine
  85. ;
  86. ;=======================================================================
  87. ;
  88. ; -- To Display the Record Count on the CRT During Program Transfers --
  89. ;    
  90. ;    This one addition requires some work on the part of the user.
  91. ; When "BYE" is added, CP/M is normally moved lower to accomodate the
  92. ; new program above CP/M.  Whenever BYE is called to enable the RCPM
  93. ; capability, it steals some of the addresses contained in the BIOS jump
  94. ; vector table.  In order to display on the CRT during program transfers
  95. ; you need to get into the BIOS console output routine directly, else
  96. ; what is being displayed also tries to go out the modem.  This is a big
  97. ; NO-NO at that time.  (This cannot be done automatically by XMODEM,
  98. ; since BYE has already taken the address we need to find, by the time
  99. ; XMODEM is automatically activated by the remote station.)
  100. ;
  101. ;    So with the disk containing BYE, but prior to activating BYE, do
  102. ; this:
  103. ;        1) Cold reboot to move CP/M (and BIOS) to the new area
  104. ;            needed when BYE is activated on the same disk.
  105. ;        2) Use DDT and dump the area from 0000H to 0002H.  This
  106. ;                   gives the warm reboot address in BIOS.
  107. ;        3) Add 9 Bytes to that address to get your console out-
  108. ;             put jump vector.
  109. ;        4) Pick off the address contained in the jump vector and
  110. ;             install that in "CONOUT", below.  Example of one
  111. ;             system in use:
  112. ;
  113. ;            FIRST, COLD REBOOT WITH DISK CONTAINING "BYE"
  114. ;
  115. ;      0000  C3 03 E1     (location of warm reboot on disk with BYE
  116. ;
  117. ;            PRIOR TO ACTIVATING BYE BUT ON SAME DISK
  118. ;
  119. ;      E103  C3 3E E1    (BIOS warm reboot jump vector on this disk)
  120. ;      E006  C3 78 EB    (BIOS get console status routine)
  121. ;      E009  C3 95 EB    (BIOS console input routine)
  122. ;      E00C  C3 BD EB    (BIOS console output routine)
  123. ;
  124. ;        The address we need is thus EBBD.  Put that below, in
  125. ;        our example it would be:    CONOUT   JMP   0EBBDH
  126. ;
  127. ;                ; TeleVideo 802/60k memory
  128. ;    CONOUT:      JMP    0EBBDH    ;If you wish to show the record count
  129. ;                ;during program transfer, fill in this
  130. ;                ;address at 'CONOUT' above.
  131. ;
  132. ;                    - Irv Hoff
  133. ;
  134. ;=======================================================================
  135. ;
  136. ; ---> CAROK - check for presence of carrier.  RET with Z = carrier on
  137. ;
  138. CAROK:    IN    MODCTLP        ;get status
  139.     ANI    MODDCD        ;get carrier detect bit
  140.     CPI    MODDCD        ;test bit
  141.     RET
  142. ;
  143. ;=======================================================================
  144. ;
  145. EXTRA1:    RET            ;for later use
  146. EXTRA2:    RET            ;for later use
  147. EXTRA3:    RET            ;for later use
  148. ;
  149. ;=======================================================================
  150. ;
  151. ; ---> GETCHR - get a character, same as MDIN
  152. ; ---> MDIN - - get a character, same as GETCHR
  153. ;
  154. GETCHR:
  155. MDIN:    IN    MODDATP        ;get character from data in port
  156.     RET
  157. ;
  158. ;=======================================================================
  159. ;
  160. MINIT:    RET            ;no initialization required
  161. ;
  162. ;=======================================================================
  163. ;
  164. ; ---> RCVRDY - check receive ready.  RET with Z = character available.
  165. ;            Return with error code in A-reg.
  166. ;
  167. RCVRDY:    IN    MODCTLP        ;get modem status
  168.         ANI     MODDAV
  169.         CPI     MODDAV
  170.         MOV     A,0
  171.     RET
  172. ;
  173. ;=======================================================================
  174. ;
  175. ; ---> SENDR - send character
  176. ;
  177. SENDR:    POP    PSW        ;get the character back
  178.     OUT    MODDATO        ;send it to the modem output
  179.     RET
  180. ;
  181. ;=======================================================================
  182. ;
  183. ; ---> SNDRDY - check if ready to send.
  184. ;
  185. SNDRDY:    IN    MODCTLP        ;get status byte
  186.     ANI    MODBMT        ;isolate ready bit
  187.     CPI    MODBMT        ;ready to send?
  188.     RET
  189. ;
  190. ;=======================================================================
  191. ;
  192. ; ---> SPEED - sets the time shown for program transfer.
  193. ;
  194. SPEED:     IF    LSPEED
  195.     LDA    MSPEED        ;get index for baud rate from 'BYE'
  196.      ENDIF
  197. ;
  198.      IF     NOT LSPEED
  199.     MVI    A,XSPEED    ;get index for baud rate from 'XSPEED'
  200.      ENDIF
  201. ;
  202.     RET
  203. ;
  204. ;=======================================================================
  205. ;
  206. UNINIT:    RET            ;not initialized, so no 'UN-INITIALIZE'
  207. ;
  208. ;=======================================================================
  209. ;
  210. ;
  211.     END