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 / M7MDX-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  328 lines

  1.  
  2. ; M7MDX-1.ASM --  SIO MOSTEC MDX-SIO overlay file for MDM7xx.  05/16/84
  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. ;
  7. ; Much of the information contained here is not in the MDM7xx.ASM file.
  8. ;
  9. ; Edit this file for your preferences then follow the "TO USE:" example
  10. ; shown below.
  11. ;
  12. ; Use the "SET" command to change the baudrate when desired.  It starts
  13. ; out at 300 baud when the program is first called up.
  14. ;
  15. ;    TO USE: First edit this file filling in answers for your own
  16. ;        equipment.  Then assemble with ASM.COM or equivalent
  17. ;        assembler.  Then use DDT to overlay the the results
  18. ;        of this program to the original .COM file:
  19. ;
  20. ;        A>DDT MDM7xx.COM
  21. ;        DDT VERS 2.2
  22. ;        NEXT  PC
  23. ;        4x00 0100
  24. ;        -IM7MDX-1.HEX        (note the "I" command)
  25. ;        -R            ("R" loads in the .HEX file)
  26. ;        NEXT  PC
  27. ;        4x00 0000
  28. ;        -G0            (return to CP/M)
  29. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  30. ;                       ^
  31. ;                       This may vary with the version of MDM7xx
  32. ;
  33. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  34. ;
  35. ; 05/16/84 - Version for Mostek MDX-SIO         - Dennis Recla 
  36. ;
  37. ;
  38. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  39. ;
  40. BELL:        EQU    07H        ;bell
  41. CR:        EQU    0DH        ;carriage return
  42. ESC:        EQU    1BH        ;escape
  43. LF:        EQU    0AH        ;linefeed
  44. ;
  45. YES:        EQU    0FFH
  46. NO:        EQU    0
  47. ;
  48. ;
  49. PORT:        EQU    0C0H        ;MOSTEX MDX-SIO serial output port
  50. MODCTL1:    EQU    PORT+1        ;Modem control port
  51. MODDATP:    EQU    PORT        ;Modem data port
  52. MODCTL2:    EQU    PORT+1        ;Modem status port
  53. MODRCVB:    EQU    01H        ;Your bit to test for receive
  54. MODRCVR:    EQU    01H        ;Your value when receive ready
  55. MODSNDB:    EQU    04H        ;Your bit to test for send
  56. MODSNDR:    EQU    04H        ;Your value when send ready        
  57. ;
  58. ;
  59.         ORG    100H
  60. ;
  61. ;
  62. ; Change the clock speed to suit your system
  63. ;
  64.         DS    3    ;(for  "JMP   START" instruction)
  65. ;
  66. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  67. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  68. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  69. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  70.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  71. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  72.                 ;6=2400 7=4800 8=9600 9=19200 default
  73. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  74.                 ;default time to send character in ter-
  75.                 ;minal mode file transfer for slow BBS.
  76. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  77.                 ;default time for extra wait after CRLF
  78.                 ;in terminal mode file transfer
  79. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  80. SETUPTST:    DB    NO    ;yes=user-added Setup routine        10BH
  81. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  82. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  83.                 ;no=resend a record after a valid NAK
  84. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  85. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  86. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  87. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  88. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  89. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  90.                 ;terminal mode (added by remote echo)
  91. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  92. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  93.                 ;write logon sequence at location LOGON
  94. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  95. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  96.                 ;no=external command if EXTCHR precedes
  97. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  98. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  99. XOFFTST:    DB    NO    ;yes=check for XOFF from remote    while    11AH
  100.                 ;sending a file in terminal mode
  101. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  102.                 ;sending a file in terminal mode
  103. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  104. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  105. EXTRA1:        DB    0    ;for future expansion            11EH
  106. EXTRA2:        DB    0    ;for future expansion            11FH
  107. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  108. 20H
  109. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  110. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  111. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  112. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  113. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  114. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  115. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  116. ;
  117. ;
  118.         DS    2        ;                128H
  119. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts    12AH
  120.         OUT    MODCTL1
  121.         IN    MODCTL1        ;get the status bits
  122.         RET
  123.         DS    3
  124. ;
  125. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  126.         DS    7
  127. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  128.         DS    7
  129. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  130. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  131. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  132. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  133.         DS    6        ;                154H
  134. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port     15AH
  135. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  136. ;
  137. ;
  138. LOGONPTR:    DW    LOGON        ;for user message.        160H
  139.         DS    6        ;                162H
  140. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  141. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  142.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  143.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  144.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  145. JMP$SETUPR:    JMP    SETUPR        ;                177H
  146. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  147. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  148. JMP$BREAK:    JMP    SENDBRK        ;                180H
  149. ;
  150. ;
  151. ; Do not change the following six lines.
  152. ;
  153. JMP$ILPRT:    DS    3        ;                183H
  154. JMP$INBUF    DS    3        ;                186H
  155. JMP$INLNCOMP:    DS    3        ;                189H
  156. JMP$INMODEM    DS    3        ;                18CH
  157. JMP$NXTSCRN:    DS    3        ;                18FH
  158. JMP$TIMER:    DS    3        ;                192H
  159. ;
  160. ;
  161. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  162. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  163. ;
  164. CLREOS:        CALL    JMP$ILPRT    ;                195H
  165.         DB    0,0,0,0,0    ;                198H
  166.         RET            ;                19DH
  167. ;
  168. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  169.         DB    0,0,0,0,0    ;                1A1H
  170.         RET            ;                1A6H
  171. ;
  172. ;
  173. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  174.         DB    'Version for MOSTEK MDX-SIO'
  175.         DB    CR,LF,0
  176.         RET
  177. ;.....
  178. ;
  179. ;
  180. ;-----------------------------------------------------------------------
  181. ;
  182. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  183. ;     end of your last routine should terminate by 0400H (601 bytes
  184. ;     available after start of SYSVER) if using the Hayes Smartmodem
  185. ;     or by address 0C00H (2659 bytes) otherwise.
  186. ;
  187. ;-----------------------------------------------------------------------
  188. ;
  189. ; You can put in a message at this location which can be called up with
  190. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  191. ; desired.  End with a 0.
  192. ;
  193. ;
  194. LOGON:        DB    'Hello..Hello   Anyone there ??',CR,LF,0
  195. ;.....
  196. ;
  197. ;
  198. ; This routine allows a 300 ms. break tone to be sent to reset some
  199. ; time-shar computers.
  200. ;
  201. SENDBRK:  MVI    A,5
  202.       OUT    MODCTL1
  203.       MVI    A,0F8H        ;SEND A BREAK TONE
  204.       JMP    GOODBYE1
  205. ;.....
  206. ;
  207. ;
  208. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  209. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  210. ;
  211. GOODBYE:  MVI    A,5
  212.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  213.       MVI    A,68H        ;TURN OFF DTR
  214. ;
  215. GOODBYE1: OUT    MODCTL1
  216.       MVI    B,3        ;WAIT FOR 300 MS.
  217.       CALL    JMP$TIMER
  218.       MVI    A,5
  219.       OUT    MODCTL1
  220.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  221.       OUT    MODCTL1
  222.       RET
  223. ;.....
  224. ;
  225. ;
  226. ;  
  227. ; XEROX 820  initialization -- sets CTC timer 00H for send and receive
  228. ; baudrate.
  229. ;
  230. INITMOD:  MVI    A,0        ;SELECT REGISTER
  231.       OUT    MODCTL1
  232.       MVI    A,18H        ;THROW OUT OF MODE
  233.       OUT    MODCTL1
  234.       MVI    A,04H        ;SELECT REGISTER
  235.       OUT    MODCTL1
  236.       MVI    A,44H        ;SET ASCII PARAMETERS
  237.       OUT    MODCTL1
  238.       MVI    A,03H        ;SELECT REG.
  239.       OUT    MODCTL1
  240.       MVI    A,0C1H        ;ENABLE RECEIVE
  241.       OUT    MODCTL1
  242.       MVI    A,05H        ;SELECT REG.
  243.       OUT    MODCTL1
  244.       MVI    A,0EAH        ;ENABLE SEND, 'DTR', 'RTS'
  245.       OUT    MODCTL1
  246. ;
  247. INITMOD1: MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  248.       STA    MSPEED
  249.       MVI    A,47H        ;DEFAULT TO 300 BAUD
  250.       OUT    00H        ;SEND TO 'CTC' TIMER
  251. ;
  252. INITMOD2: MVI    A,05H        ;INITIALIZE TO 300 BAUD
  253.       OUT    00H
  254.       RET
  255. ;.....
  256. ;
  257. ;
  258. ; Setup routine to allow changing modem speed with the SET command.
  259. ;
  260. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  261.       CALL    JMP$ILPRT
  262.       DB    'Input Baud Rate (300, 600, 1200, 9600): ',0
  263.       CALL    JMP$INBUF
  264.       LXI    D,BAUDBUF+2
  265.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  266.       DB    '300',0
  267.       JNC    OK300        ;GO IF GOT MATCH
  268.       CALL    JMP$INLNCOMP
  269.       DB    '600',0
  270.       JNC    OK600
  271.       CALL    JMP$INLNCOMP
  272.       DB    '1200',0
  273.       JNC    OK1200
  274.       CALL    JMP$INLNCOMP
  275.       DB    '9600',0
  276.       JNC    OK9600
  277.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  278.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  279.       JMP    SETUPR        ;TRY AGAIN
  280. ;
  281. OK300:      MVI    A,1
  282.       LHLD    BD300
  283.       JMP    LOADBD
  284. ;
  285. OK600:      MVI    A,3
  286.       LHLD    BD600
  287.       JMP    LOADBD
  288. ;
  289. OK1200:      MVI    A,5
  290.       LHLD    BD1200
  291.       JMP    LOADBD
  292. ;
  293. OK9600:      MVI    A,8
  294.       LHLD    BD9600
  295. ;
  296. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  297.       MOV    A,L        ;GET BAUDRATE BYTE
  298.       STA    INITMOD2+1    ;SEND TO 'CTC' TIMER FOR NEW BAUDRATE
  299.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  300. ;
  301. ;
  302. ; TABLE OF BAUDRATE PARAMETERS
  303. ;
  304. BD300:      DW    0005H
  305. BD600:      DW    0006H    
  306. BD1200:      DW    0007H
  307. BD9600:      DW    000EH
  308. ;
  309. BAUDBUF:  DB    10,0
  310.       DS    10
  311. ;
  312. ;-----------------------------------------------------------------------
  313. ;
  314. ; The following routine can be used as an auxiliary menu for notes of
  315. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  316. ; this is unavailable without a special address change.
  317. ;
  318. SPCLMENU: RET
  319. ;
  320. ;-----------------------------------------------------------------------
  321. ;
  322. ;
  323. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  324. ;                 0C00H (without Smartmodem)
  325. ;
  326.       END
  327. ;
  328.