home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / MODEMS / MODEM7 / M7MD-1.AQM / M7MD-1.ASM
Assembly Source File  |  2000-06-30  |  10KB  |  283 lines

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