home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols200 / vol217 / m8in-1.a86 < prev    next >
Text File  |  1994-07-13  |  11KB  |  397 lines

  1. ; M8IN-1.A86 -- Overlay file for the CompuPro I3/I4.  09/14/84
  2. ;
  3. ; This overlay adapts the MDM8xx program to the CompuPro Interfacer 3 or
  4. ; Interfacer 4 serial cards using the 2651 USART chip.
  5. ;
  6. ; You will want to look this file over carefully. There are a number of
  7. ; options that you can use to configure the program to suit your taste.
  8. ; This file places particular emphasis on using an external modem that
  9. ; is connected to a serial port.  This includes acoustic modems as well
  10. ; as "intelligent" modems such as the Hayes Smartmodem, Racal-Vadic, Bell
  11. ; Dataphone 212A, etc.
  12. ;
  13. ; This overlay is capable of setting the baud rate, disconnecting the
  14. ; modem, and sending breaks.
  15. ;
  16. ;
  17. ;    TO USE: First edit this file filling in answers for your own
  18. ;        equipment.  Then assemble with ASM86.CMD or equivalent
  19. ;        assembler.  Then use M8CNFG to overlay the the results
  20. ;        of this program to the original MDM8xx.H86 file:
  21. ;
  22. ;            ASM86 M8IN-1
  23. ;            REN M8OVL.H86=M8IN-1.H86
  24. ;            M8CNFG
  25. ;            GENCMD MDM 8080 CODE[MFF0]
  26. ;
  27. ;         Now run MDM.  Have Fun
  28. ;
  29. ;
  30. ; =   =      =   =      =   =      =   =      =   =      =   =      =   =      =   =      =   =
  31. ;
  32. ; 09/19/84 - Original version for MDM8xx    - Alex Soya
  33. ; 04/04/83 - First version of this file        - Irv Hoff
  34. ;
  35. ; =   =      =   =      =   =      =   =      =   =      =   =      =   =      =   =      =
  36. ;
  37. BELL    EQU    07H            ;bell
  38. CR    EQU    0DH            ;carriage return
  39. ESC    EQU    1BH            ;escape
  40. LF    EQU    0AH            ;linefeed
  41. ;
  42. YES    EQU    0FFH
  43. NO    EQU    0
  44. ;
  45. ; Change the following to match your equipment
  46. ;
  47. ; =   =      =   =      =   =      =   =      =   =      =   =      =   =      =   =      =
  48. ;
  49. BASE    EQU    010H            ;base port of CompuPro I3 or I4 cards
  50. UPORT    EQU    BASE+7            ;user (chip select) port
  51. MDM    EQU    6            ;chip that controls modem port
  52. ;
  53. ;
  54. ;
  55. DPORT    EQU    BASE            ;data port
  56. SPORT    EQU    BASE+1            ;status port
  57. MPORT    EQU    BASE+2            ;mode port
  58. CPORT    EQU    BASE+3            ;control port
  59. ;
  60. TBMT    EQU    01H            ;transmit buffer empty
  61. DAV    EQU    02H            ;data available
  62. ;
  63.     ORG    100H
  64. ;
  65. ; Change the clock speed to suit your system
  66. ;
  67.     RS    3            ;(for  "JMP   START" instruction)
  68. ;
  69. PMMIMODEM    DB    NO        ;yes=PMMI S-100 Modem            103H
  70. SMARTMODEM    DB    YES        ;yes=HAYES Smartmodem, no=non-PMMI    104H
  71. TOUCHPULSE    DB    'T'        ;T=touch, P=pulse (Smartmodem-only)    105H
  72. CLOCK        DB    80        ;clock speed in MHz x10, 25.5 MHz max.    106H
  73.                     ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  74. MSPEED        DB    1        ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  75.                     ;6=2400 7=4800 8=9600 9=19200 default
  76. BYTDLY        DB    5        ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  77.                     ;default time to send character in ter-
  78.                     ;minal mode file transfer for slow BBS.
  79. CRDLY        DB    5        ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  80.                     ;default time for extra wait after CRLF
  81.                     ;in terminal mode file transfer
  82. NOOFCOL        DB    5        ;number of DIR columns shown        10AH
  83. SETUPTST    DB    YES        ;yes=user-added Setup routine        10BH
  84. SCRNTEST    DB    YES        ;Cursor control routine            10CH
  85. ACKNAK        DB    YES        ;yes=resend a record after any non-ACK    10DH
  86.                     ;no=resend a record after a valid-NAK
  87. BAKUPBYTE    DB    NO        ;yes=change any file same name to .BAK    10EH
  88. CRCDFLT        DB    YES        ;yes=default to CRC checking        10FH
  89. TOGGLECRC    DB    YES        ;yes=allow toggling of CRC to Checksum    110H
  90. CONVBKSP    DB    NO        ;yes=convert backspace to rub        111H
  91. TOGGLEBK    DB    YES        ;yes=allow toggling of bksp to rub    112H
  92. ADDLF        DB    NO        ;no=no LF after CR to send file in    113H
  93.                     ;terminal mode (added by remote echo)
  94. TOGGLELF    DB    YES        ;yes=allow toggling of LF after CR    114H
  95. TRANLOGON    DB    YES        ;yes=allow transmission of logon    115H
  96.                     ;write logon sequence at location LOGON
  97. RESERVED    DB    NO        ; Resevered for future release        116H
  98. LOCONEXTCHR    DB    NO        ;yes=local command if EXTCHR precedes    117H
  99.                     ;no=external command if EXTCHR precedes
  100. TOGGLELOC    DB    YES        ;yes=allow toggling of LOCONEXTCHR    118H
  101. LSTTST        DB    YES        ;yes=printer available on printer port    119H
  102. XOFFTST        DB    NO        ;yes=checks for XOFF from remote while    11AH
  103.                     ;sending a file in terminal mode
  104. XONWAIT        DB    NO        ;yes=wait for XON after CR while    11BH
  105.                     ;sending a file in terminal mode
  106. TOGXOFF        DB    YES        ;yes=allow toggling of XOFF checking    11CH
  107. IGNORCTL    DB    NO        ;yes=CTL-chars above ^M not displayed    11DH
  108. EXTRA1        DB    0        ;for future expansion            11EH
  109. EXITCHR        DB    'E'-40H        ;^E = Exit to main menu            11FH
  110. BRKCHR        DB    '@'-40H        ;^@ = Send 300 ms. break tone        120H
  111. NOCONNCT    DB    'N'-40H        ;^N = Disconnect from the phone line    121H
  112. LOGCHR        DB    'L'-40H        ;^L = Send logon            122H
  113. LSTCHR        DB    'P'-40H        ;^P = Toggle printer            123H
  114. UNSAVE        DB    'R'-40H        ;^R = Close input text buffer        124H
  115. TRANCHR        DB    'T'-40H        ;^T = Transmit file to remote        125H
  116. SAVECHR        DB    'Y'-40H        ;^Y = Open input text buffer        126H
  117. EXTCHR        DB    '^'-40H        ;^^ = Send next character        127H
  118. ;
  119. ;
  120.     RS    3            ;                128H
  121. ;
  122. IN@MODCTL1:
  123.     JMP    IMCTL1            ;in modem control port        12BH
  124.     DB    0,0,0,0,0,0,0        ; spares
  125. ;
  126. OUT@MODDATP:
  127.     JMP    OMDP            ;out modem data port        135H
  128.     DB    0,0,0,0,0,0,0        ; spares
  129. ;
  130. IN@MODDATP:
  131.     JMP    IMDP            ;in modem data port        13FH
  132.     DB    0,0,0,0,0,0,0        ; spares
  133. ;
  134. ANI@MODRCVB:    AND AL,DAV        ;bit to test for receive ready    149H
  135.         RET
  136. ;
  137. CPI@MODRCVR:    CMP AL,DAV        ;value of rcv. bit when ready    14CH
  138.         RET
  139. ;
  140. ANI@MODSNDB:    AND AL,TBMT        ;bit to test for send ready    14FH
  141.         RET
  142. ;
  143. CPI@MODSNDR:    CMP AL,TBMT        ;value of send bit when ready    152H
  144.         RET
  145. ;
  146.     RS    6            ;                156H
  147. ;
  148. OUT@MODCTL1:    RET 
  149.     RS    2            ;out modem control port #2    15BH
  150. ;
  151. OUT@MODCTL2:    RET 
  152.     RS    2            ;out modem control port #1    15EH
  153. ;
  154. LOGONPTR DW    (Offset LOGON)        ;for user message.        161H
  155.     RS    6            ;                163H
  156. JMP@GOODBYE:JMP GOODBYE            ;                169H
  157. JMP@INITMOD:JMP INITMOD            ;go to user written routine    16CH
  158.     RET
  159.     NOP                ;(by-passes PMMI routine)    170H
  160.     NOP
  161.     RET
  162.     NOP                ;(by-passes PMMI routine)    173H
  163.     NOP
  164.     RET
  165.     NOP                ;(by-passes PMMI routine)    176H
  166.     NOP
  167. JMP@SETUPR:    JMP  SETUPR        ;                178H
  168. JMP@SPCLMENU:  JMP  SPCLMENU        ;                17BH
  169. JMP@SYSVER:    JMPS SYSVER        ;make sure this is SHORT Jump    17EH
  170. JMP@BREAK:     JMP  SENDBRK        ;                180H
  171.  
  172. ;
  173. ; Do not change the following eight lines.
  174. ;
  175. JMP@ILPRT:
  176.         RS    3        ;                183H
  177. JMP@INBUF:
  178.         RS    3        ;                186H
  179. JMP@INLNCOMP:
  180.         RS    3        ;                189H
  181. JMP@INMODEM:
  182.         RS    3        ;                18CH
  183. JMP@NXTSCRN:
  184.         RS    3        ;                18FH
  185. JMP@TIMER:
  186.         RS    3        ;                192H
  187. JMP@CTYPE:
  188.         RS    3        ;                195H
  189. JMP@KEYIN:
  190.         RS    3        ;                198H
  191. ;
  192. ;
  193. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  194. ; SCRNTEST to YES at 010AH (above).
  195. ;
  196. CLREOS: CALL    JMP@ILPRT        ;                19BH
  197.     DB    ESC,'Y',0,0,0        ;                19EH
  198.     RET                ;                1A3H
  199. ;
  200. CLRSCRN:CALL    JMP@ILPRT        ;                1A4H
  201.     DB    ESC,'*',0,0,0        ;                1A7H
  202.     RET                ;                1ACH
  203. ;
  204. SYSVER: CALL    JMP@ILPRT        ;                1ADH
  205.     DB    'Version for CompuPro '
  206.     DB    'Interfacer-3 or 4 (port ',MDM+'0',')'
  207.     DB    CR,LF,0
  208.     RET
  209. ;.....
  210. ;
  211. ;
  212. ;-----------------------------------------------------------------------
  213. ;
  214. ; NOTE:     You can change the SYSVER message to be longer or shorter.  The
  215. ;     end of your last routine should terminate by 0600H if using the
  216. ;     Hayes Smartmodem or by address 0C00H otherwise.
  217. ;
  218. ;-----------------------------------------------------------------------
  219. ;
  220. ; You can put in a message at this location which can be called up with
  221. ; CTL-O if TRANLOGON has been set TRUE.     You can use several lines if
  222. ; desired.  End with a 0.
  223. ;
  224. LOGON    DB    'It has been a long day, so now it'
  225.     DB    ' is time for a beer!',CR,LF,0
  226. ;
  227. ;.....
  228. ;
  229. ;
  230. ;
  231. ;
  232. ; Add your own routine here to read a byte from your Modem Control port
  233. ;
  234. IMCTL1: MOV    AL,MDM        ; Select Interfacer 3/4 Port
  235.     OUT    UPORT,AL
  236.     IN    AL,SPORT
  237.     RET
  238. ;
  239. ;....
  240. ;
  241. ;
  242. ; Add your own routine here to send a byte in AL to Modem Data Port
  243. ;
  244. OMDP:    PUSH    AX        ; Save Data while Selecting Port
  245.     MOV    AL,MDM
  246.     OUT    UPORT,AL
  247.     POP    AX
  248.     OUT    DPORT,AL
  249.     RET
  250. ;
  251. ;
  252. ;....
  253. ;
  254. ; Add your own routine here to read Modem Data Port into AL
  255. ;
  256. IMDP:    MOV    AL,MDM        ; Select Uart first
  257.     OUT    UPORT,AL
  258.     IN    AL,DPORT    ; Now get Data
  259.     RET
  260.  
  261.  
  262. ; Add your own routine here to send a break tone to reset some time-
  263. ; share computers, if desired.
  264. ;
  265. SENDBRK:MOV    AL,MDM            ;select chip
  266.     OUT    UPORT,AL
  267.     MOV    AL,2FH            ;send break for 300ms
  268.     JMPS    GOODBYE1
  269. ;.....
  270. ;
  271. ;
  272. ; Add your own routine here to put DTR low and/or send a break tone.
  273. ; Check other routines such as MDM711DP.ASM which is using this feature.
  274. ;
  275. GOODBYE:MOV    AL,MDM            ;select chip
  276.     OUT    UPORT,AL
  277.     XOR    AL,AL            ;turn off DTR
  278. ;
  279. GOODBYE1:
  280.     OUT    CPORT,AL
  281.     MOV    CH,3            ;turn off DTR for 300 ms.
  282.     CALL    JMP@TIMER
  283.     MOV    AL,27H            ;turn DTR back on
  284.     OUT    CPORT,AL
  285.     RET
  286. ;.....
  287. ;
  288. ;
  289. ; You can use this area for any special initialization or setup you may
  290. ; wish to include.  Each must stop with a RET.    You can check the other
  291. ; available overlays for ideas how to write your own routines if that
  292. ; may be of some help.
  293. ;
  294. INITMOD:MOV    AL,MDM            ;select chip
  295.     OUT    UPORT,AL
  296. ;
  297. INITMOD1:
  298.     MOV    AL,4EH            ;select 8 data bits, no parity, 1 stop
  299.     OUT    MPORT,AL
  300. ;
  301. INITMOD2:
  302.     MOV    BL,Byte Ptr MSPEED    ;Get Baud rate
  303.     DEC    BL            ; adjust for table offset
  304.     XOR    BH,BH            ; make 16 bit
  305.     MOV    AL, Byte Ptr BDTBL[BX]
  306.     OUT    MPORT,AL
  307.     MOV    AL,27H            ;turn on DTR etc.
  308.     OUT    CPORT,AL
  309.     RET
  310. ;.....
  311. ;
  312. ;
  313. ; Use the 'SET' command to select a desired baud rate
  314. ;
  315. SETUPR: MOV    DX,(Offset BAUDBUF)    ;point to new input buffer
  316.     CALL    JMP@ILPRT
  317.     DB    'Input Baud Rate (300, 600, 1200, 4800, 9600, 19200): ',0
  318.     CALL    JMP@INBUF
  319.     MOV    DX,(Offset BAUDBUF)+2
  320.     CALL    JMP@INLNCOMP        ;compare BAUDBUF+2 with characters below
  321.     DB    '300',0
  322.     JNB    OK300            ;go if got match
  323.     CALL    JMP@INLNCOMP
  324.     DB    '600',0
  325.     JNB    OK600
  326.     CALL    JMP@INLNCOMP
  327.     DB    '1200',0
  328.     JNB    OK1200
  329.     CALL    JMP@INLNCOMP
  330.     DB    '4800',0
  331.     JNB    OK4800
  332.     CALL    JMP@INLNCOMP
  333.     DB    '9600',0
  334.     JNB    OK9600
  335.     CALL    JMP@INLNCOMP
  336.     DB    '19200',0
  337.     JNB    OK19200
  338.     CALL    JMP@ILPRT        ;all matches failed, tell operator
  339.     DB    '++ Incorrect entry ++',CR,LF,BELL,0
  340.     JMP    SETUPR            ;try again
  341. ;
  342. OK300:    MOV    AL,1            ;MSPEED 300 baud value
  343.     JMPS    LOADBD            ;go load everything
  344. ;
  345. OK600:    MOV    AL,3
  346.     JMPS    LOADBD
  347. ;
  348. OK1200: MOV    AL,5
  349.     JMPS    LOADBD
  350. ;
  351. OK4800: MOV    AL,7
  352.     JMPS    LOADBD
  353. ;
  354. OK9600: MOV    AL,8
  355.     JMPS    LOADBD
  356. ;
  357. OK19200:MOV    AL,9
  358. ;
  359. LOADBD: MOV    Byte Ptr MSPEED,AL    ;chnage time-to-send to match baudrate
  360.     JMP    INITMOD            ;reinitialize to new baudrate, then done
  361. ;...
  362. ;
  363. BDRTE    DB    0        ; keeps selected uart Baud Rate Value
  364.  
  365. ; TABLE OF BAUDRATE PARAMETERS
  366. ;
  367. BD300    EQU    35H            ;300  baud
  368. BD450    EQU    0            ;450  baud NOT SUPPORTED
  369. BD600    EQU    36H            ;600  baud
  370. BD710    EQU    0            ;710  baud NOT SUPPORTED
  371. BD1200    EQU    37H            ;1200 baud
  372. BD2400    EQU    0            ;2400 baud NOT SUPPORTED
  373. BD4800    EQU    3CH            ;4800 baud
  374. BD9600    EQU    3EH            ;9600 baud
  375. BD19200 EQU    3FH            ;19200 baud
  376. ;
  377. BAUDBUF DB    10,0
  378.     RS    10
  379.  
  380. BDTBL    DB BD300,BD450,BD600,BD710,BD1200,BD2400,BD4800,BD9600,BD19200
  381. ;
  382. ;           (END OF INITMOD AND SETUP ROUTINES)
  383. ;=======================================================================
  384. ;
  385. ;
  386. ; If using the Hayes Smartmodem this is unavailable without a special
  387. ; change.
  388. ;
  389. SPCLMENU:RET
  390. ;
  391. ;
  392. ; NOTE:     MUST TERMINATE PRIOR TO 0600H (with Smartmodem)
  393. ;                 0C00H (without Smartmodem)
  394. ;.....
  395. ;
  396.     END
  397.