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 / M7MOL-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  9KB  |  304 lines

  1. ; M7MOL-2.ASM  -- Overlay file for MOLECULAR SuperMicro series. 
  2. ;
  3. ; Use the "SET" command to change baudrate when desired.
  4. ;
  5. ; Edit this file for your preferences then follow the "TO USE:" example
  6. ; shown below.
  7. ;
  8. ;
  9. ;    TO USE: First edit this file filling in answers for your own
  10. ;        equipment.  Then assemble with ASM.COM or equivalent
  11. ;        assembler.  Then use DDT to overlay the the results
  12. ;        of this program to the original .COM file:
  13. ;
  14. ;        A>DDT MDM7xx.COM
  15. ;        DDT VERS 2.2
  16. ;        NEXT  PC
  17. ;        4x00 0100
  18. ;        -IM7MOL-2.HEX        (note the "I" command)
  19. ;        -R            ("R" loads in the .HEX file)
  20. ;        NEXT  PC
  21. ;        4x00 0000
  22. ;        -G0            (return to CP/M)
  23. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  24. ;            ^
  25. ;                       May vary depending upon version of MDM7xx
  26. ;
  27. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  28. ;
  29. ; 04/30/84 - Renamed and revised for MDM7xx.COM - Dennis Recla
  30. ; 12/07/83 - Revised for MOLECULAR SuperMicros  - Gene Head
  31. ;
  32. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  33. ;
  34. BELL:        EQU    07H        ;bell
  35. CR:        EQU    0DH        ;carriage return
  36. ESC:        EQU    1BH        ;escape
  37. LF:        EQU    0AH        ;linefeed
  38. ;
  39. YES:        EQU    0FFH
  40. NO:        EQU    0
  41. ;
  42. ;
  43. ; Change the value at MODDATP if it does not match what you are using.
  44. ;
  45. MODDATP:    EQU    062H        ;data port for Multi I/O
  46. MODCTL1:    EQU    MODDATP+1    ;status port for Multi I/O
  47. MODCTL2:    EQU    31H        ;speed control port
  48. MODRCVB:    EQU    1H        ;bit to test for received data
  49. MODRCVR:    EQU    1H        ;modem receive ready
  50. MODSNDB:    EQU    4H        ;bit to test for ready to send
  51. MODSNDR:    EQU    4H        ;modem send ready bit
  52. ;
  53. ;
  54.         ORG    100H
  55. ;
  56. ; Change the clock speed if needed, to match your system
  57. ;
  58.         DS    3    ;(for  "JMP   START" instruction)
  59. ;
  60. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  61. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  62. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  63. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  64.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  65. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  66.                 ;6=2400 7=4800 8=9600 9=19200 default
  67. BYTDLY:        DB    9    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  68.                 ;default time to send character in ter-
  69.                 ;minal mode file transfer for slow BBS.
  70. CRDLY:        DB    9    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  71.                 ;default time for extra wait after CRLF
  72.                 ;in terminal mode file transfer
  73. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  74. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  75. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  76. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  77.                 ;no=resend a record after a valid NAK
  78. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  79. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  80. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  81. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  82. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  83. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  84.                 ;terminal mode (added by remote echo)
  85. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  86. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  87.                 ;write logon sequence at location LOGON
  88. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  89. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  90.                 ;no=external command if EXTCHR precedes
  91. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  92. LSTTST:        DB    YES    ;yes=allow toggling of printer on/off    119H
  93. XOFFTST:    DB    YES    ;yes=checks for XOFF from remote while    11AH
  94.                 ;sending a file in terminal mode
  95. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  96.                 ;sending a file in terminal mode
  97. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  98. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  99. EXTRA1:        DB    0    ;for future expansion            11EH
  100. EXTRA2:        DB    0    ;for future expansion            11FH
  101. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  102. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  103. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  104. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  105. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  106. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  107. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  108. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  109. ;
  110. ;
  111.         DS    2        ;                128H
  112. ;
  113. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port             12AH
  114.         DS    7
  115. OUT$MODDATP:    OUT     MODDATP ! RET    ;out modem data port        134H
  116.         DS    7
  117. IN$MODDATP:    IN    MODDATP    ! RET    ;input modem data port        13EH
  118.         DS      7
  119. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    148H
  120. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  121. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    14EH
  122. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  123.         DS    12        ;PMMI only calls        154H
  124. ;
  125. ;
  126. LOGONPTR:    DW    LOGON        ;for user message.        160H
  127.         DS    6        ;                162H
  128. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  129. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  130.         DS    9        ;                16EH
  131. JMP$SETUPR:    JMP    SETUPR        ;                177H
  132. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  133. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  134. JMP$BREAK:    JMP    SENDBRK        ;                180H
  135. ;
  136. ;
  137. ; Do not change the following six lines.
  138. ;
  139. JMP$ILPRT:    DS    3        ;                183H
  140. JMP$INBUF    DS    3        ;                186H
  141. JMP$INLNCOMP:    DS    3        ;                189H
  142. JMP$INMODEM    DS    3        ;                18CH
  143. JMP$NXTSCRN:    DS    3        ;                18FH
  144. JMP$TIMER    DS    3        ;                192H
  145. ;
  146. ;
  147. ; The following clear the screen for the H19 terminal
  148. ;
  149. CLREOS:        CALL    JMP$ILPRT    ;                195H
  150.         DB    ESC,'J',0,0,0    ;                198H
  151.         RET            ;                19DH
  152. ;
  153. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  154.         DB    ESC,'E',0,0,0    ;                1A1H
  155.         RET            ;                1A6H
  156. ;
  157. ;
  158. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  159.         DB    'For Molecular Super Micro'
  160.         DB    CR,LF
  161.         DB    'List Device must not be set to local'
  162.         DB    CR,LF,0
  163.         RET
  164. ;.....
  165. ;
  166. ;
  167. ;-----------------------------------------------------------------------
  168. ;
  169. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  170. ;     end of your last routine should terminate by 0400H (601 bytes
  171. ;     available after start of SYSVER) if using the Hayes Smartmodem
  172. ;     or by address 0C00H (2659 bytes) otherwise.
  173. ;
  174. ;-----------------------------------------------------------------------
  175. ;
  176. ; You can put in a message at this location which can be called up with
  177. ; CTL-L if TRANLOGON has been set TRUE.  You can put in several lines if
  178. ; desired.  End with a 0.
  179. ;
  180. LOGON:      DB    0
  181. ;.....
  182. ;
  183. ;
  184. ; This routine sends a 300 ms. break tone to reset some time-share
  185. ; computers.
  186. ;
  187. SENDBRK:  MVI    A,15H
  188.       OUT    MODCTL1
  189.       MVI    A,7FH
  190.       OUT    MODCTL1
  191.       LXI    B,300H
  192. BREAK0:      MVI    A,0DCH
  193. BREAK1:      DCR    A
  194.       NOP
  195.       JNZ    BREAK1
  196.       DCX    B
  197.       MOV    A,B
  198.       ORA    C
  199.       JNZ    BREAK0
  200.       MVI    A,15H
  201.       OUT    MODCTL1
  202.       MVI    A,6FH
  203.       OUT    MODCTL1
  204.       RET
  205.  
  206. ;.....
  207. ;
  208. ;
  209. ; This routine sends a 300 ms. break tgone and set DTR low for the same
  210. ; length of time to disconnect some modems such as the Bell 212A, etc.
  211. ;
  212. GOODBYE:  RET
  213. ;.....
  214. ;
  215. ;
  216. ; The following is used to initialize the Multi I/O 8250 port
  217. ;
  218. INITMOD:  MVI    A,1        ;select write register one
  219.       OUT    MODCTL1
  220.       XRA    A        ;turn off interupts
  221.       OUT   MODCTL1
  222.       MVI    A,4        ;select write register 4
  223.       OUT   MODCTL1        
  224.       MVI    A,44H        ;select 8 bit xsfr
  225.       OUT   MODCTL1    
  226.       MVI    A,3        ;select write register 3
  227.       OUT   MODCTL1
  228.       MVI    A,0C1H        ;8-bit receive - receive enable
  229.       OUT   MODCTL1
  230.       MVI    A,5        ;select write register 5
  231.       OUT   MODCTL1
  232.       MVI    A,0EAH        ;8-bit transmit -transmit enable
  233.       OUT   MODCTL1
  234.       MVI    A,10H        ;reset interupts - select register 0
  235.         OUT   MODCTL1
  236.       RET
  237. ;
  238. ;
  239. ; The following routine changes the baud rate for the Multi I/O with the SET
  240. ; command.
  241. ;
  242. SETUPR:      LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  243.       CALL    JMP$ILPRT
  244.       DB    'Input Baud Rate (300, 1200, 2400, 4800, 9600): ',0
  245.       CALL    JMP$INBUF
  246.       LXI    D,BAUDBUF+2
  247.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  248.       DB    '300',0
  249.       LXI    H,BD300
  250.       JNC    LOADBD        ;go if got match
  251.       CALL    JMP$INLNCOMP
  252.       DB    '1200',0
  253.       LXI    H,BD1200
  254.       JNC    LOADBD
  255.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  256.       DB    '2400',0
  257.       LXI    H,BD2400
  258.       JNC    LOADBD        ;go if got match
  259.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  260.       DB    '4800',0
  261.       LXI    H,BD4800    
  262.       JNC    LOADBD        ;go if got match
  263.       CALL    JMP$INLNCOMP
  264.       DB    '9600',0
  265.       LXI    H,BD9600
  266.       JNC    LOADBD
  267.       CALL    JMP$ILPRT    ;all matches failed - tell operator
  268.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  269.       JMP    SETUPR        ;try again
  270. ;
  271. LOADBD:      CALL    INITMOD
  272.       MOV   A,H
  273.       OUT    MODCTL2
  274.       MOV    A,L
  275.       OUT    MODCTL2
  276.       RET
  277. ;
  278. ; Table of baud rate parameters
  279. ;
  280. BD300:      EQU    0734H
  281. BD1200:      EQU    4768H
  282. BD2400:   EQU    4734H
  283. BD4800:      EQU   471AH
  284. BD9600:      EQU    470DH
  285. ;
  286. BAUDBUF:    DB    10,0
  287.         DS    10
  288.  
  289. ;-----------------------------------------------------------------------
  290. ;
  291. ; This routine can be used for your equipment, be sure to end with RET
  292. ; If using the Hayes Smartmodem this is unavailable without a special
  293. ; change.
  294. ;
  295. SPCLMENU: RET
  296. ;
  297. ;-----------------------------------------------------------------------
  298. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  299. ;                 0C00H (without Smartmodem)
  300. ;
  301.       END
  302. ;
  303.  
  304.