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 / XMLO-10.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  8KB  |  236 lines

  1.  
  2. ; XMLO-10.ASM - XMODEMxx overlay file for the Lobo Max-80 computer  06/15/84
  3. ;
  4. ; This file adapts XMODEMxx to the Lobo Max-80 computer.  To use, edit
  5. ; any options desired into XMODEMxx.ASM, then assemble (can use ASM.COM)
  6. ; and load to get XMODEMxx.COM.  Then edit this file as needed (check
  7. ; the CONOUT routine if you want to locally see file transfer time and
  8. ; the record count while programs are being sent or insure that USECON
  9. ; on ByeII or BYE3 is set YES.)  Then assemble (can use ASM.COM) and
  10. ; merge the .HEX file with XMODEMxx.COM by using MLOAD (part of the
  11. ; MEX modem program distribution and available separately from most
  12. ; RCP/M's):
  13. ;
  14. ;   MLOAD XMODEM.COM=XMODEMxx.COM,XMLO-10.HEX
  15. ;
  16. ; This will create XMODEM.COM, the ready-to-use program.
  17. ;
  18. ;=======================================================================
  19. ;
  20. ; 06/15/84  Rewritten and renamed    - Peter N. Glaskowsky
  21. ; 01/01/84  Updated to XMODEM84        - Irv Hoff
  22. ; 04/04/83  Updated to XMODEM74        - Irv Hoff
  23. ; 03/27/83  Updated to XMODEM73        - Irv Hoff
  24. ; 03/17/83  Updated to XMODEM72        - Irv Hoff
  25. ; 03/15/83  Updated to XMODEM71        - Irv Hoff
  26. ;
  27. ; 03/07/83  Added instructions on how to adapt this file to XMODEM70.COM.
  28. ;        Standardized the format.  Added automatic MSPEED from "BYE"
  29. ;        program.  Added CONOUT information.  Adapted from XM70PMMI.
  30. ;                    - Irv Hoff
  31. ;
  32. ;=======================================================================
  33. ; Define True and False
  34. ;
  35. YES:      EQU    0FFH
  36. NO:      EQU    0
  37. ;
  38. ;=======================================================================
  39. ;
  40. ; Modem & Data Equates
  41. ;
  42. MODDATP:  EQU    0F7E4H        ;data in port for kaypro computers
  43. MODCTLP:  EQU    MODDATP+1    ;control/status port
  44. MODSNDB:  EQU    04H        ;bit to test for send
  45. MODSNDR:  EQU    04H        ;value when ready
  46. MODRCVB:  EQU    01H        ;bit to test for receive
  47. MODRCVR:  EQU    01H        ;value when ready
  48. MODDCDB:  EQU    08H        ;carrier detect bit
  49. MODDCDA:  EQU    08H        ;value when active
  50. MODPARE:  EQU    10H        ;value for parity error
  51. MODOVRE:  EQU    20H        ;value for overrun error
  52. MODFRME:  EQU    40H        ;value for framing error
  53. MODRESI:  EQU   10H        ;reset external status/interrupts
  54. MODERES:  EQU   30H        ;error reset
  55. ;
  56. ;
  57. LSPEED:      EQU    YES        ;true if using by2-17ks or any bye2-xx
  58.                 ;false if using 'SPEED' manual selection
  59. MSPEED:      EQU    3CH        ;location of baud rate factor (set by
  60. ;                ;'BYE')  SET LOCATION IN 'BYE' TO AGREE.
  61. ;                ;3DH AND 3EH OFTEN USED BY NEWER VER-
  62. ;                ;SIONS OF 'ZCPR'.
  63. XSPEED:      EQU    5        ;speed for file time transfer without
  64. ;                ;AUTO-SET.  USE ONE OF THE FOLLOWING:
  65. ;                ;0=110 1=300 2=450 3=600 4=710 5=1200
  66. BASE:      EQU    100H        ;start of cp/m normal program area
  67. ;
  68. ;=======================================================================
  69. ;
  70. ; Jump table: The jump table must be in exactly the same sequence as the
  71. ; one in XMODEM.
  72. ;
  73.       ORG    BASE+3        ;start after 'JMP BEGIN'
  74. ;
  75. CONOUT:   JMP    0C7AEH        ;must be 00000h if not used, see below
  76.                 ;shown for Max-80 with NZCPR V2.1
  77. PMINIT:      JMP    MINIT        ;initialization routine (if needed)
  78. PUNINIT:  JMP    UNINIT        ;undo whatever 'MINIT' did (or return)
  79. PSENDR:      JMP    SENDR        ;send character (via pop psw)
  80. PCAROK:      JMP    CAROK        ;test for carrier
  81. PMDIN:      JMP    MDIN        ;receive data byte
  82. PGETCHR:  JMP    GETCHR        ;get character from modem
  83. PRCVRDY:  JMP    RCVRDY        ;check receive ready
  84. PSNDRDY:  JMP    SNDRDY        ;check send ready
  85. PSPEED:      JMP    SPEED        ;get speed value for file transfer time
  86. PEXTRA1:  JMP    EXTRA1        ;extra for custom routine
  87. PEXTRA2:  JMP    EXTRA2        ;extra for custom routine
  88. PEXTRA3:  JMP    EXTRA3        ;extra for custom routine
  89. ;
  90. ;=======================================================================
  91. ;
  92. ; -- To Display the Record Count on the CRT During Program Transfers --
  93. ;
  94. ;    The CRTOUT routine below may be used if you know the ports used
  95. ; by your CRT for status and data.  (Cannot be used with memory mapped
  96. ; displays.)  If using the CRTOUT routine, skip rest of this discussion.
  97. ;
  98. ;    This one addition requires some work on the part of the user.
  99. ; When "BYE" is added, CP/M is normally moved lower to accomodate the
  100. ; new program above CP/M.  Whenever BYE is called to enable the RCPM
  101. ; capability, it steals some of the addresses contained in the BIOS jump
  102. ; vector table.  In order to display on the CRT during program transfers
  103. ; you need to get into the BIOS console output routine directly, else
  104. ; what is being displayed also tries to go out the modem.  This is a big
  105. ; NO-NO at that time.  (This cannot be done automatically by XMODEM,
  106. ; since BYE has already taken the address we need to find, by the time
  107. ; XMODEM is automatically activated by the remote station.)
  108. ;
  109. ;    So with the disk containing BYE, but prior to activating BYE, do
  110. ; this:
  111. ;        1) Cold reboot to move CP/M (and BIOS) to the new area
  112. ;            needed when BYE is activated on the same disk.
  113. ;        2) Use DDT and dump the area from 0000H to 0002H.  This
  114. ;                   gives the warm reboot address in BIOS.
  115. ;        3) Add 9 Bytes to that address to get your console out-
  116. ;             put jump vector.
  117. ;        4) Pick off the address contained in the jump vector and
  118. ;             install that in "CONOUT", below.  Example of one
  119. ;             system in use:
  120. ;
  121. ;            FIRST, COLD REBOOT WITH DISK CONTAINING "BYE"
  122. ;
  123. ;      0000  C3 03 E0    (location of warm reboot on disk with BYE
  124. ;
  125. ;            PRIOR TO ACTIVATING BYE BUT ON SAME DISK
  126. ;
  127. ;      E003  C3 E9 E0    (BIOS warm reboot jump vector on this disk)
  128. ;      E006  C3 00 E9    (BIOS get console status routine)
  129. ;      E009  C3 B7 E1    (BIOS console input routine)
  130. ;      E00C  C3 D4 E1    (BIOS console output routine)
  131. ;
  132. ;        The address we need is thus E1D4.  Put that below, in
  133. ;        our example it would be:    CONOUT   JMP   0E1D4H
  134. ;
  135. ;
  136. ;    CONOUT:      JMP    00000H    ;If you wish to show the record count
  137. ;                ;during program transfer, fill in this
  138. ;                ;address at 'CONOUT' above.
  139. ;
  140. ;                    - Irv Hoff
  141. ;
  142. ;=======================================================================
  143. ;
  144. ; ---> CAROK - check for presence of carrier.  RET with Z = carrier on
  145. ;
  146. CAROK:
  147.     MVI    A,MODRESI    ;reset external status/interrupts
  148.     STA    MODCTLP
  149.     LDA    MODCTLP        ;get status
  150.     ANI    MODDCDB        ;get carrier detect bit
  151.     CPI    MODDCDA        ;test bit
  152.     RET
  153. ;
  154. ;=======================================================================
  155. ;
  156. EXTRA1:    RET            ;for later use
  157. EXTRA2:    RET            ;for later use
  158. EXTRA3:    RET            ;for later use
  159. ;
  160. ;=======================================================================
  161. ;
  162. ; ---> GETCHR - get a character, same as MDIN
  163. ; ---> MDIN - - get a character, same as GETCHR
  164. ;
  165. GETCHR:
  166. MDIN:    LDA    MODDATP        ;get character from data in port
  167.     RET
  168. ;
  169. ;=======================================================================
  170. ;
  171. MINIT:    RET            ;no initialization required
  172. ;
  173. ;=======================================================================
  174. ;
  175. ; ---> RCVRDY - check receive ready.  RET with Z = character available.
  176. ;            Return with error code in A-reg.
  177. ;
  178. RCVRDY:    LDA    MODCTLP        ;get modem status
  179.     PUSH    B        ;save scratch register
  180.     PUSH    PSW
  181.     MVI    A,1+MODRESI    ;select read register 1
  182.     STA    MODCTLP
  183.     LDA    MODCTLP        ;read the error status
  184.     ANI    MODFRME+MODOVRE+MODPARE
  185.     MOV    B,A        ;save it for a moment
  186.     MVI    A,MODERES
  187.     STA    MODCTLP        ;do an error reset command
  188.     POP    PSW        ;now get modem status back
  189.     ANI    MODRCVB        ;isolate ready bit
  190.     CPI    MODRCVR        ;test it
  191.     MOV    A,B        ;get the error code char. back
  192.     POP    B
  193.     RET
  194. ;
  195. ;=======================================================================
  196. ;
  197. ; ---> SENDR - send character
  198. ;
  199. SENDR:    POP    PSW        ;get the character back
  200.     STA    MODDATP        ;send it to the modem output
  201.     RET
  202. ;
  203. ;=======================================================================
  204. ;
  205. ; ---> SNDRDY - check if ready to send.
  206. ;
  207. SNDRDY:    LDA    MODCTLP        ;get status byte
  208.     ANI    MODSNDB        ;isolate ready bit
  209.     CPI    MODSNDR        ;ready to send?
  210.     RET
  211. ;
  212. ;=======================================================================
  213. ;
  214. ; ---> SPEED - sets the time shown for program transfer.
  215. ;
  216. SPEED:    EQU    $
  217. ;
  218.      IF    LSPEED
  219.     LDA    MSPEED        ;get index for baud rate from 'BYE'
  220.      ENDIF
  221. ;
  222.      IF     NOT LSPEED
  223.     MVI    A,XSPEED    ;get index for baud rate from 'XSPEED'
  224.      ENDIF
  225. ;
  226.     RET
  227. ;
  228. ;=======================================================================
  229. ;
  230. UNINIT:    RET            ;not initialized, so no 'UN-INITIALIZE'
  231. ;
  232. ;=======================================================================
  233. ;
  234.     END
  235.