home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / modems / modem / cp405src.ark / CP4TYP.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-12-26  |  12.0 KB  |  302 lines

  1. ; CP4TYP.ASM
  2. ;    KERMIT - (Celtic for "FREE")
  3. ;
  4. ;    This is the CP/M-80 implementation of the Columbia University
  5. ;    KERMIT file transfer protocol.
  6. ;
  7. ;    Version 4.0
  8. ;
  9. ;    Copyright June 1981,1982,1983,1984,1985
  10. ;    Columbia University
  11. ;
  12. ; Originally written by Bill Catchings of the Columbia University Center for
  13. ; Computing Activities, 612 W. 115th St., New York, NY 10025.
  14. ;
  15. ; Contributions by Frank da Cruz, Daphne Tzoar, Bernie Eiben,
  16. ; Bruce Tanner, Nick Bush, Greg Small, Kimmo Laaksonen, Jeff Damens, and many
  17. ; others.
  18. ;
  19. ;    This is the header file for building the system-dependent overlay
  20. ;    for KERMIT.  It contains the definitions used to select the target
  21. ;    system, and collects (via INCLUDE or LINK directives) the remaining
  22. ;    code.  If the target system is one of the supported systems
  23. ;    described below, then this is the only file that needs to be
  24. ;    edited.
  25. ;
  26. ; revision history:
  27. ;
  28. ; edit 12 5 Febuary, 1986 by OBSchou
  29. ;    merged in conditionals for Epson PX8 (px8). Code from Tony Addyman
  30. ;    Salford University, England.
  31. ;    Added code from other contibutors for Basic Northstar (basicns), 
  32. ;    Access-Matrix (access), US Micro Sales s1008 (s1008),
  33. ;    Micro Mate (mmate), A.C.E. Discovery (disc).  
  34. ;    These I cannot test: please send comments back if these are buggy.
  35. ;
  36. ; edit 11 29 January 1985 by OBSchou @ multics.lut.ac.uk
  37. ;    added in code for 2651 USART for use with CP/M and a VDU
  38. ;
  39. ; edit 10: 21 November, 1985 by ajcole @ leeds.ai
  40. ;    Merged in support for the following:
  41. ;    North Star Horizon without SIO-4 (horizon)
  42. ;    Comart Communicator (comart)
  43. ;    Cromemco TU-ART interface (cmemco)
  44. ;    TVI912/920 VDUs (tvi912)
  45. ;
  46. ; edit 9 24 October by OBSchou.  Merged code from B Robertson from
  47. ;    Aberdeen University.  He writes:
  48. ;    September 20, 1985 by B Robertson, Aberdeen Univ. Computing Centre.
  49. ;    Add support for Research Machines 380Z, North Star Advantage, Acorn
  50. ;    BBC with Z80 co-processor and APPLE II with Mountain Computers CPS
  51. ;    Multifunction card.
  52. ;
  53. ; edit 8: 11 October, 1985 by OBSchou
  54. ;    tidied up code around Superbrain main/aux port business
  55. ;
  56. ; edit 7: 11 June, 1985 by O B Schou, Loughborough University of Tech.
  57. ;    Loughborough, Leics, England.
  58. ;    Added code for Torch (Second processor to BBC-B) and Cifer 1886
  59. ;    Hopefully this code will work with Torchpacks, and Cifer 26xx
  60. ;    and 28xx series computers.  Edits marked by OBS
  61. ;
  62. ; edit 6: 9-Feb-85 by CJC
  63. ;    Merge Northstar Horizon, Lobo MAX, and Xerox 820 changes:
  64. ;    13-Dec-84 Add Northstar Horizon with SIO-4 board, port 5 at 1200 [CSM]
  65. ;    13-Jan-85 by Vanya J.Cooper Pima Commun. College Tel: 602-884-6809
  66. ;
  67. ;pcc001    27-Dec-84    vjc    modules: cp4sys,cp4typ
  68. ;    Add conditional for Xerox 820.  I thought at first I could
  69. ;    live with the kaypro conditional, but it's enough of a pain
  70. ;    that I added it back in.  The clear-to-end-of-screen char
  71. ;    is different,  breaking many programs in VT52 mode, and the
  72. ;    default escape char control-\, is not at all obvious how
  73. ;    to type on the 820 keyboard.  If you muddle through the
  74. ;    key translation table, it turns out to be control-comma.
  75. ;    Rather than OR xer820 all the occurances of kpII conditionals
  76. ;    I added a bbI conditional for all common code for the big
  77. ;    board I based machines that is automatically turned on by
  78. ;    either kpII or xer820.  This will also make it easier in
  79. ;    the future if another flavor of bigboard is added.
  80. ;
  81. ;pcc010    2-Jan-85    vjc    modules:cp4pkt,cp4typ
  82. ;    Control-C during send or recieve clobbers some of the screen
  83. ;    and doesn't look nice.  Position the cursor to end of screen
  84. ;    before returning to main loop.
  85. ;
  86. ;pcc013    8-Jan-85    vjc    modules:cp4mit,cp4utl,cp4typ
  87. ;    Replace CLOSE command to cancel session logging to SET
  88. ;    LOGGING ON/OFF.  This seems to fit in with the command
  89. ;    structure better.  Default the log file to KERMIT.LOG
  90. ;    incase no previous LOG command.  Logging is also enabled
  91. ;    by LOG command, as before.
  92. ;
  93. ; edit 5: October 13, 1984 by L M Jones, JCC, for New York Botanical Garden
  94. ;    Add support for CPT-85xx series of word processors when running CP/M.
  95. ;
  96. ; edit 4: August 29, 1984 by Bdale Garbee @ CMU
  97. ;    Add support for Digicomp Delphi 100 and Netronics Smartvid terminal.
  98. ;
  99. ; edit 3: July 27, 1984 (CJC)
  100. ;    Shuffle files around for easier assembly by both M80 and LASM.
  101. ;
  102. ; edit 2: June 4, 1984 [Toad Hall]
  103. ;    Added Morrow Decision I (the big S100 bus sucker, not the
  104. ;    little single motherboard one); added Toad Hall TACTrap to deal
  105. ;    with those working through a TAC and its intercept character.
  106. ;
  107. ; edit 1: May, 1984 (CJC)
  108. ;    extracted from CPMBASE.M80 version 3.9; modifications are described
  109. ;    in the accompanying .UPD file.
  110. ;
  111.  
  112. FALSE    EQU    0
  113. TRUE    EQU    NOT FALSE
  114.  
  115. ;
  116. ; Assembler type.  Define the appropriate one TRUE, the rest FALSE.  (We can't
  117. ; use ASM, because it cannot handle multiple input files)
  118. mac80    EQU    FALSE        ; For assembly via MAC80 cross-assembler.
  119. m80    EQU    FALSE        ; For assembly via Microsoft's M80.
  120. lasm    EQU    true        ; For assembly via LASM, a public-domain
  121.                 ; assembler.
  122.  
  123. ;
  124. ;    Address at which the overlay should be loaded.  This will not
  125. ;    change often (no more than once per version of KERMIT); it should
  126. ;    be updated when a new version of KERMIT is released.
  127. ovladr    EQU    3700H        ; [pcc013] value for KERMIT v4.04
  128.  
  129. ;Which CP/M system hardware are we building KERMIT-80 for?
  130. ;One of the following should be TRUE, the rest FALSE:
  131. ;
  132. ;We have basically three "classes" of systems:
  133.  
  134. ;Systems supporting the IO-redirection via I/O-Byte
  135.  
  136. robin    EQU    FALSE        ;DEC VT180 = Generic + VT100 screen control
  137. gener    EQU    FALSE        ;"Generic" Kermit-80, CP/M calls only.
  138.                 ; (terminal required)
  139. dmII    EQU    FALSE        ;"Generic" KERMIT-80 for DECMATE II.
  140. mikko    EQU    FALSE        ;"Generic" KERMIT-80 for MikroMikko
  141. cifer    EQU    FALSE        ; Cifer 1886 using io byte flipping [OBS]
  142. bbc    EQU    FALSE        ;[9] Acorn BBC model B
  143.  
  144. IF robin OR dmII OR gener OR mikko OR cifer OR bbc;[**obs]
  145. iobyt    EQU    TRUE        ;Short conditional for above
  146. inout    EQU    FALSE
  147. ENDIF;robin OR dmII OR gener OR cifer OR bbc
  148.  
  149. ;.. and Systems supporting direct IN / OUT handling of ports
  150. brainm    EQU    FALSE        ;Select Superbrain Main port  **[obs]
  151. braina    EQU    FALSE        ;Select Superbrain AUX port  **[obs]
  152. brain    EQU    brainm OR braina    ;For Intertec SuperBrain. **[obs]
  153. vector    EQU    FALSE        ;For Vector Graphics.
  154. heath    EQU    FALSE        ;For Heath/Zenith H89.
  155. z100    EQU    FALSE        ;For Z-100 under CP/M-85.
  156. trs80lb    EQU    FALSE        ;For Lifeboat 2.25C CP/M Display
  157. trs80pt    EQU    FALSE        ;For Pickles + Trout CP/M Display
  158. telcon    EQU    FALSE        ;For TELCON Zorba portable
  159. kpII    EQU    FALSE        ;Kaypro-II
  160. xer820    EQU    FALSE        ;[pcc001] Xerox 820
  161. bbII    EQU    FALSE        ;BigBoard II (terminal required)
  162. mmdI    EQU    FALSE        ;Morrow Micro Decision I (terminal required)
  163. mdI    EQU    FALSE        ;Morrow Decision I (the big sucker)
  164.                 ; (terminal required) [Toad Hall]
  165. delphi    EQU    FALSE        ;Digicomp Delphi 100 (terminal required)
  166. cpt85xx    EQU    FALSE        ;CPT-85xx word processor w/CPM (set ADM3A TRUE)
  167. pci2651    EQU    FALSE        ; CP/M with 2651 USART.  Needs VDU. [11]
  168. norths    EQU    FALSE        ;[CSM] NorthStar Horizon with HSIO-4 board
  169.                 ; (terminal required)
  170. comart    EQU    FALSE        ;[10] Comart Communicator
  171.                 ; (terminal required)
  172. horizon    EQU    FALSE        ;[10] North Star Horizon (mother-board)
  173.                 ; (terminal required)
  174. cmemco    EQU    FALSE        ;[10] Cromemco (TU-ART)
  175.                 ; (terminal required)
  176. advant    EQU    FALSE        ;[9] North Star Advantage
  177. rm380z    EQU    FALSE        ;[9] Research Machines 380Z
  178.  
  179. trs80    EQU    trs80lb OR trs80pt ; if either, flag TRS-80 system.
  180. bbI    EQU    kpII OR xer820    ;[pcc001] flag for bigboard I
  181.  
  182. access    EQU    FALSE        ; Access Matrix .. uses port J5 [12]
  183. basicns    EQU    FALSE        ; Basic Northstar using printer port (CRT req.)
  184. s1008    EQU    FALSE        ; US Micro Sales s1008
  185. mmate    EQU    FALSE        ; PMC - 101 MicroMate (Crt required)
  186. disc    EQU    FALSE        ; Action Computer Enterprises "Discovery"
  187.                 ; Port B on an 83U user board (CRT required)
  188.  
  189. IF brain OR vector OR heath OR z100 OR trs80 OR telcon OR bbI
  190. inout    EQU    TRUE        ;Short conditional for above
  191. iobyt    EQU    FALSE
  192. ENDIF;brain OR vector OR heath OR z100 OR trs80 OR telcon OR kpII
  193.  
  194. IF bbII OR mmdI OR mdI OR delphi OR cpt85xx OR norths    ;running out of room
  195. inout    EQU    TRUE        ;Short conditional for above
  196. iobyt    EQU    FALSE
  197. ENDIF;bbII OR mmdI OR mdI OR delphi OR cpt85xx OR norths
  198.  
  199. IF advant OR rm380z OR comart OR horizon OR cmemco    ;[9] [10] more room here
  200. inout    EQU    TRUE        ;Short conditional for above
  201. iobyt    EQU    FALSE
  202. ENDIF;advant OR rm380z OR comart OR horizon OR cmemco
  203.  
  204. IF pci2651    ;[11] and even more room
  205. inout    EQU    TRUE        ;Short conditional for above
  206. iobyt    EQU    FALSE
  207. ENDIF    ;pci2651    [11]
  208.  
  209. IF access OR basicns OR s1008 OR mmate OR disc ; [12]
  210. inout    EQU    TRUE        ;Short conditional for above
  211. iobyt    EQU    FALSE
  212. ENDIF ; access OR basicns OR s1008 OR mmate OR disc [12]
  213.  
  214. ;.. and Systems doing neither...
  215. px8    EQU    FALSE        ;[12] For Epson PX-8
  216. osi    EQU    FALSE        ;For Ohio Scientific.
  217. osbrn1    EQU    FALSE        ;For Osborne 1
  218. cpm3    EQU    FALSE        ;"Generic" Kermit-80 for CP/M 3.0 (CP/M Plus)
  219.                 ; (terminal required)
  220. lobo    EQU    FALSE        ;Lobo Max-80
  221. torch    EQU    true        ;[obs] Torch does comms via Beeb as IO processor
  222. apmmdm    EQU    FALSE        ;jb Micromodem II in slot 2
  223. ap6551    EQU    FALSE        ;jb apple with 6551 ACIA in serial interface
  224. apcps    EQU    FALSE        ;[9] Apple with CP multifunction card
  225.  
  226. IF ap6551 OR apcps;[9]
  227.                 ;jb eg. Apple SSC, Videx PSIO, Basis 108
  228. apslot    EQU    2        ;jb set equal to slot containing serial card
  229.                 ;jb  set to 1 for Basis built-in port
  230. ENDIF;jb ap6551 [9] apcps
  231.  
  232. ; flag apple system if either selected
  233. apple    EQU    apmmdm OR ap6551 OR apcps
  234.  
  235. IF osi OR apple OR osbrn1 OR cpm3 OR lobo OR torch OR px8    ; [12]
  236. iobyt    EQU    FALSE
  237. inout    EQU    FALSE
  238. ENDIF;osi OR apple OR osbrn1 OR cpm3 OR lobo OR torch OR px8 [12]
  239.  
  240. ;.. and for Micros, like the MDI, which have "terminals of choice", you must
  241. ;select one of these in addition to selecting the micro itself.
  242. ;Also select a terminal for "gener" and "cpm3": use "crt" for the true generic.
  243. crt    EQU    FALSE        ;Basic CRT, no cursor positioning
  244. adm3a    EQU    FALSE        ;Adm3a Display (or CPT built-in display)
  245. smrtvd    EQU    FALSE        ;Netronics Smartvid terminal.
  246. tvi912    EQU    FALSE        ;[10] TVI912/920
  247. tvi925    EQU    FALSE        ;TVI925 Display
  248.                 ; (works for Freedom 100 also)  [Toad Hall]
  249. vt52    EQU    FALSE        ;VT52 or equivalent (or H19)
  250. vt100    EQU    FALSE        ;VT100 or equivalent
  251.  
  252. ; Toad Hall TAC Trap:  If you're going through a TAC, it will
  253. ; cough on its Intercept Character (usually a @ (* - 40H)).  Sending it
  254. ; twice forces the TAC to recognize it as a valid ASCII character,
  255. ; and it'll send only one on to the host.  If you've SET the TACTrap
  256. ; to OFF, it will be a null character, and nothing will happen.  If you
  257. ; set it on, it will be your selected TAC intercept character (or will
  258. ; default to the common intercept char, '@'.
  259. ; If you never expect to have to work through such a beastie, just set
  260. ; TAC to false and forget all this mess.  [Toad Hall]
  261.  
  262. tac    EQU    FALSE        ; gonna work through a TAC?
  263. tacval    EQU    '@'        ;Typical TAC intercept character
  264.  
  265. ; Processor speed in units of 100KHz
  266. ; for bbII, kpII, cpt85xx, advance, apple,bbc,px8 & rm380z timing loop [12]
  267.  
  268. IF apple OR cpt85xx OR px8;[9] [12]
  269. cpuspd    EQU    20        ; Apple Softcard, CPT-85xx: 2.0 MHz
  270.                 ; ('cause of integral video?)
  271. ENDIF; apple OR cpt85xx OR px8    [12]
  272.  
  273. IF kpII        ;[9]
  274. cpuspd    EQU    25        ; original Kaypro II,Xerox 820: 2.5 MHz
  275. ENDIF;kpII
  276.  
  277. IF brain OR advant OR bbII OR torch OR cifer OR rm380z OR comart OR horizon    ;[9] [22] [10]
  278. cpuspd    EQU    40        ; bbII: 4.0 MHz  [also Kaypro 10]
  279. ENDIF; brain OR advant OR bbII OR torch OR cifer OR rm380z OR comart OR horizon
  280.  
  281. IF disc OR mmate OR s1008 OR access OR basicns ;[29] This is a guess.. Most are 4Mhz
  282. cpuspd    EQU    40        ; bbII: 4.0 MHz  [also Kaypro 10]
  283. ENDIF    ;disc OR mmate OR s1008 OR access OR basicns [29]
  284.  
  285. IF bbc    ;[9]
  286. cpuspd    EQU    60        ; BBC with 6Mhz Z80
  287. ENDIF;bbc
  288. cp4ker    EQU    FALSE        ; building the system-dependent part...
  289.  
  290. IF lasm
  291.     LINK    CP4DEF
  292. ENDIF;lasm  [Toad Hall]
  293.  
  294. ; If we're still here, must be M80 or MAC80.  Collect the rest of
  295. ; the sources.
  296. .sfcond
  297.     INCLUDE    CP4DEF.ASM    ; common definitions
  298.     INCLUDE CP4LNK.ASM    ; linkage area description
  299.     INCLUDE CP4SYS.ASM    ; system-dependent code and tables
  300.     INCLUDE    CP4SY2.ASM    ; New bit.. is half of CP4SYS.ASM
  301.     END
  302.