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 / XMOX-2.AQM / XMOX-2.ASM
Assembly Source File  |  2000-06-30  |  8KB  |  233 lines

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