home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / term / mcimail3.lbr / MCI-MDM.AQM / MCI-MDM.ASM
Assembly Source File  |  1985-07-20  |  10KB  |  306 lines

  1.  
  2. ; M7MD-1.ASM - Morrow Micro Decision overlay file for MDM7xx.  11/11/83
  3. ;
  4. ;
  5. ;                     SPECIAL CONFIGURATION 
  6. ;
  7. ;                              FOR
  8. ;
  9. ;                        M C I   M A I L 
  10. ;
  11. ;
  12. ;               Alterations from normal Modem730
  13. ;                overlay for Morrow Designs MD2
  14. ;                    by David Brown  6/25/84
  15. ;
  16. ;FOLLOWING CHANGES MADE FOR THIS PURPOSE:
  17. ;
  18. ;    XOFFTST    changed to YES
  19. ;    XONWAIT changed to NO
  20. ;    LF Removed following signon message
  21. ;    -- Remember: No LF for MCI MAIL!
  22. ;
  23. ;    Also delays were changed to 1 between characters
  24. ;                                   5 at end of line 
  25. ;
  26. ;
  27. ; You will want to look this file over carefully. There are a number of
  28. ; options that you can use to configure the program to suit your taste.
  29. ; This file adapts the Morrow Micro Decision computer to the modem pro-
  30. ; gram.  While this computer has two serial ports, one is used for the
  31. ; CRT/keyboard and the other for the printer.  To use this overlay, you
  32. ; must set the internal dip switches for 1200 baud for the printer port.
  33. ; Then connect the modem in place of the printer.
  34. ;
  35. ; Edit this file for your preferences then follow the "TO USE:" example
  36. ; shown below.
  37. ;
  38. ; Use the "SET" command to change the baudrate when desired.  It starts
  39. ; out at 300 baud when the program is first called up.
  40. ;
  41. ;    TO USE: First edit this file filling in answers for your own
  42. ;        equipment.  Then assemble with ASM.COM or equivalent
  43. ;        assembler.  Then use DDT to overlay the the results
  44. ;        of this program to the original .COM file:
  45. ;
  46. ;        A>DDT MDM7xx.COM
  47. ;        DDT VERS 2.2
  48. ;        NEXT  PC
  49. ;        4300 0100
  50. ;        -IM7MD-1.HEX        (note the "I" command)
  51. ;        -R            ("R" loads in the .HEX file)
  52. ;        NEXT  PC
  53. ;        4300 0000
  54. ;        -G0            (return to CP/M)
  55. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  56. ;
  57. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  58. ;
  59. ; 11/11/83 - Renamed to M7MD-1.ASM, no changes    - Irv Hoff
  60. ; 07/21/83 - Renamed for use with MDM712    - Irv Hoff
  61. ; 07/01/83 - Revised for use with MDM711    - Irv Hoff
  62. ; 06/22/83 - Revised for use with MDM710    - Irv Hoff
  63. ; 06/22/83 - Altered MDM708DP for Morrow
  64. ;         Micro Decision computers using
  65. ;         an external modem            - Irv Hoff
  66. ;
  67. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  68. ;
  69. BELL:        EQU    07H        ;bell
  70. CR:        EQU    0DH        ;carriage return
  71. ESC:        EQU    1BH        ;escape
  72. LF:        EQU    0AH        ;linefeed
  73. ;
  74. YES:        EQU    0FFH
  75. NO:        EQU    0
  76. ;
  77. ;
  78. PORT:        EQU    0FEH        ;Morrow MD printer port
  79. MODCTL1:    EQU    PORT+1        ;Modem status port
  80. MODDATP:    EQU    PORT        ;Modem data port
  81. MODCTL2:    EQU    PORT+1        ;Modem control port
  82. ;
  83. ;
  84.         ORG    100H
  85. ;
  86.         DS    3    ;(for  "JMP   START" instruction)
  87. ;
  88. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  89. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  90. TOUCHPULSE:    DB    'T'    ;T=Touch, P=Pulse (Smartmodem-only)    105H
  91. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  92.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  93. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  94.                 ;6=2400 7=4800 8=9600 9=19200 default
  95. BYTDLY:        DB    1    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  96.                 ;default time to send character in ter-
  97.                 ;minal mode file transfer for slow BBS.
  98. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  99.                 ;default time for extra wait after CRLF
  100.                 ;in terminal mode file transfer
  101. NOOFCOL:    DB    3    ;number of DIR columns shown        10AH
  102. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  103. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  104. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  105.                 ;no=resend a record after a valid NAK
  106. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  107. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  108. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  109. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  110. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  111. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  112.                 ;terminal mode (added by remote echo)
  113. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  114. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  115.                 ;write logon sequence at location LOGON
  116. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  117. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  118.                 ;no=external command if EXTCHR precedes
  119. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  120. LSTTST:        DB    NO    ;no=using modem on printer port        119H
  121. XOFFTST:    DB    YES    ;yes=checks for XOFF from remote while    11AH
  122.                 ;sending a file in terminal mode
  123. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  124.                 ;sending a file in terminal mode
  125. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  126. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  127. EXTRA1:        DB    0    ;for future expansion            11EH
  128. EXTRA2:        DB    0    ;for future expansion            11FH
  129. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  130. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from phone line    121H
  131. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  132. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  133. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  134. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  135. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  136. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  137. ;
  138. ;
  139.         DS    2        ;                128H
  140. ;
  141. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  142.         DS    7
  143. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  144.         DS    7
  145. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  146.         DS    31
  147. ;
  148. LOGONPTR:    DW    LOGON        ;for user message.        160H
  149.         DS    6        ;                162H
  150. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  151. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  152.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  153.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  154.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  155. JMP$SETUPR:    JMP    SETUPR        ;                177H
  156. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  157. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  158. JMP$BREAK:    JMP    SENDBRK        ;                180H
  159. ;
  160. ;
  161. ; Do not change the following six lines.
  162. ;
  163. JMP$ILPRT:    DS    3        ;                183H
  164. JMP$INBUF    DS    3        ;                186H
  165. JMP$INLNCOMP:    DS    3        ;                189H
  166. JMP$INMODEM    DS    3        ;                18CH
  167. JMP$NXTSCRN:    DS    3        ;                18FH
  168. JMP$TIMER:    DS    3        ;                192H
  169. ;
  170. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  171. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  172. ; The SCRNTST option must be set "YES" for these to work.  These are now
  173. ; set for the Freedom 50 or Freedom 100 terminal.  (Morrow occasionally
  174. ; ships the ADM-22 as well.)
  175. ;
  176. CLREOS:        CALL    JMP$ILPRT    ;                195H
  177.         DB    ESC,59H,0,0,0    ;                198H
  178.         RET            ;                19DH
  179. ;
  180. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  181.         DB    1EH,ESC,59H,0,0    ;                1A1H
  182.         RET            ;                1A6H
  183. ;
  184. ;
  185. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  186.         DB    'Version for:   M C I   M A I L'
  187.         DB    CR,LF,0
  188.         RET
  189. ;.....
  190. ;
  191. ;
  192. ;-----------------------------------------------------------------------
  193. ;
  194. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  195. ;     end of your last routine should terminate by 0400H (601 bytes
  196. ;     available after start of SYSVER) if using the Hayes Smartmodem
  197. ;     or by address 0C00H (2659 bytes) otherwise.
  198. ;
  199. ;-----------------------------------------------------------------------
  200. ;
  201. ; You can put in a message at this location which can be called up with
  202. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  203. ; desired.  End with a 0.
  204. ;
  205. ;
  206. LOGON:      DB    'DBROWN',CR,0
  207. ;.....
  208. ;
  209. ;
  210. ;=======================================================================
  211. ;
  212. ; This routine allows a 300 ms. break tone to be sent to reset some
  213. ; time-share computer.
  214. ;
  215. SENDBRK:  MVI    A,1FH        ;SEND BREAK TONE
  216.       JMP    GOODBYE1
  217. ;...
  218. ;
  219. ;
  220. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  221. ; length of time to disconnect some modems such as the Bell 212A, etc.
  222. ;
  223. GOODBYE:  MVI    A,15H        ;SEND BREAK, TURN OFF DTR
  224. ;
  225. GOODBYE1: OUT    MODCTL1        ;SEND TO STATUS PORT
  226.       MVI    B,3        ;WAIT 300 MS.
  227.       CALL    JMP$TIMER
  228.       MVI    A,07H        ;NORMAL SEND/RECEIVE WITH DTR
  229.       OUT    MODCTL1        ;SEND TO STATUS PORT
  230.       RET
  231. ;.....
  232. ;
  233. ;
  234. ; Morrow MD  initialization -- sets the 8251A for 8 bits, 1 stop pulse,
  235. ; DTR high, requires dip switches be set internally to 1200 baud then
  236. ; divides by 64 for 300, or by 16 for 1200 baud via "SET" command.  Set
  237. ; at present to default to 300 baud.
  238. ;
  239. INITMOD:  MVI    A,1        ;TRANSFER TIME FOR 300 BAUD
  240.       STA    MSPEED    
  241.       MVI    A,087H        ;INSURE OUT OF MODE
  242.       OUT    MODCTL1        ;MODEM STATUS PORT
  243.       OUT    MODCTL1        ;SLIGHT EXTRA DELAY
  244.       MVI    A,40H        ;INITIALIZE USART
  245.       OUT    MODCTL1        ;MODEM STATUS PORT
  246. ;
  247. INITMOD1: MVI    A,4FH        ;DEFAULT TO DIVIDE BY 64 FOR 300 BAUD
  248.       OUT    MODCTL1        ;MODEM STATUS PORT
  249.       MVI    A,17H        ;DTR, RCV, XMT, ERROR RESET
  250.       OUT    MODCTL1        ;MODEM STATUS PORT
  251.       IN    PORT        ;CLEAR DATA PORT
  252.       RET
  253. ;.....
  254. ;
  255. ;
  256. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  257.       CALL    JMP$ILPRT
  258.       DB    'Input Baud Rate (300, 1200): ',0
  259.       CALL    JMP$INBUF
  260.       LXI    D,BAUDBUF+2
  261.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  262.       DB    '300',0
  263.       JNC    OK300        ;GO IF GOT MATCH
  264.       CALL    JMP$INLNCOMP
  265.       DB    '1200',0
  266.       JNC    OK1200
  267.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  268.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  269.       JMP    SETUPR        ;TRY AGAIN
  270. ;
  271. OK300:      MVI    A,1        ;MSPEED 300 BAUD VALUE
  272.       MVI    B,4FH        ;DIVIDE BY 64 FOR 300 BAUD
  273.       JMP    LOADBD        ;GO LOAD THEM
  274. ;
  275. OK1200:      MVI    A,5
  276.       MVI    B,4EH        ;DIVIDE BY 16 FOR 1200 BAUD
  277. ;
  278. ;
  279. LOADBD:      STA    INITMOD+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  280.       MOV    A,B        ;GET BAUDRATE BYTE
  281.       STA    INITMOD1+1    ;STORE IN INITMOD
  282.       JMP    INITMOD        ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  283. ;
  284. ;
  285. BAUDBUF:  DB    10,0
  286.       DS    10
  287. ;.....
  288. ;
  289. ;
  290. ;           (END OF INITMOD AND SETUP ROUTINES)
  291. ;=======================================================================
  292. ;        
  293. ;
  294. ; These routines can be used for your equipment, be sure to end with RET
  295. ;
  296. SPCLMENU: RET
  297. ;        
  298. ;=======================================================================
  299. ;
  300. ;
  301. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  302. ;                 0C00H (without Smartmodem).
  303. ;
  304.       END
  305. ;
  306.