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

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