home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / xmdm90.lbr / XMLB-1.AZM / XMLB-1.ASM
Encoding:
Assembly Source File  |  1993-10-25  |  7.3 KB  |  210 lines

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