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 / M7MM-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  11KB  |  349 lines

  1.  
  2. ; M7MM-1.ASM -- Morrow Multi-I/O overlay for MDM7xx     11/11/83
  3. ;
  4. ; This overlay adapts the MDM7xx program to use a Morrow Mult-I/O board
  5. ; and an external modem.  The Mult-I/O board supports several users at
  6. ; the same port address in a fashion similar to bank selecting main
  7. ; memory.  This program includes an initialization routine to select
  8. ; the baud rate but does not change the user (group) number which is
  9. ; set to group 1.
  10. ;
  11. ; You could look at other overlay files to see how the GOODBYE and/or
  12. ; SETUPR areas are handled.  You could then adapt one of those, if ap-
  13. ; propriate for your equipment in this overlay.  Some examples:
  14. ;
  15. ;     "DP"  Datapoint 1560 overlay using 8251 I/O and CTC timers for
  16. ;           setting baud rates
  17. ;     "H8"  Heath H89 overlay for 8250 I/O and programmable baud rates
  18. ;     "HZ"  Zenith 120 overlay for 2661B initialization and baud rates
  19. ;     "XE"  Xerox 820II overlay for Z80-SIO intialization, etc.
  20. ;
  21. ; Edit this file for your preferences then follow the "TO USE:" example
  22. ; shown below.
  23. ;
  24. ;    TO USE: First edit this file filling in answers for your own
  25. ;        equipment.  Then assemble with ASM.COM or equivalent
  26. ;        assembler.  Then use DDT to overlay the the results
  27. ;        of this program to the original .COM file:
  28. ;
  29. ;        A>DDT MDM7xx.COM
  30. ;        DDT VERS 2.2
  31. ;        NEXT  PC
  32. ;        4300 0100
  33. ;        -IM7MM-1.HEX        (note the "I" command)
  34. ;        -R            ("R" loads in the .HEX file)
  35. ;        NEXT  PC
  36. ;        4300 0000
  37. ;        -G0            (return to CP/M)
  38. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  39. ;
  40. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  41. ;
  42. ; 11/11/83 - Renamed to M7MM-1.ASM, no changes    - Irv Hoff
  43. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  44. ; 07/07/83 - Adapted for Morrow Multi-I/O    - G. Smith
  45. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  46. ; 07/01/83 - Revised to work with MDM710    - Irv Hoff
  47. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  48. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  49. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  50. ; 04/04/83 - First version of this file        - Irv Hoff
  51. ;
  52. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  53. ;
  54. BELL:        EQU    07H        ;bell
  55. CR:        EQU    0DH        ;carriage return
  56. ESC:        EQU    1BH        ;escape
  57. LF:        EQU    0AH        ;linefeed
  58. TAB:        EQU    09H        ;tab
  59. BDOS:        EQU    0005H
  60. ;
  61. YES:        EQU    0FFH
  62. NO:        EQU    0
  63. ;
  64. ;
  65. ; Change the following information to match your equipment
  66. ;
  67. BASE:        EQU    0F0H        ;Base address for Mult-I/O board
  68. GROUP:        EQU    1        ;Group selection code
  69. GRP$CTL:    EQU    BASE+7        ;Group selection port address
  70. DLL:        EQU    BASE        ;ACE baud rate divisor (LSB)
  71. DLM:        EQU    BASE+1        ;ACE baud rate divisor (MSB)
  72. IER:        EQU    BASE+1        ;ACE interrupt enable register
  73. LCR:        EQU    BASE+3        ;ACE line control register
  74. LSR:        EQU    BASE+5        ;ACE line status register
  75. RBR:        EQU    BASE        ;ACE receive buffer register
  76. THR:        EQU    BASE        ;ACE transmit hold register
  77. DLAB:        EQU    80H        ;Divisor latch access bit
  78. THRE:        EQU    20H        ;MODSNDB
  79. DR:        EQU    1        ;MODRCVB
  80. WLS0:        EQU    1        ;Word length select bit 0
  81. WLS1:        EQU    2        ;word length select bit 1
  82. STB:        EQU    4        ;stop bit count (2 stops)
  83. IMASK:        EQU    0        ;Interrupt mask -- disable all
  84. ;
  85. MODDCDB:    EQU    4        ;CARRIER DETECT BIT
  86. MODDCDA:    EQU    0        ;VALUE WHEN ACTIVE
  87. MODRCVB:    EQU    1        ;BIT TO TEST FOR RECEIVE
  88. MODRCVR:    EQU    1        ;VALUE WHEN READY
  89. MODSNDB:    EQU    20H        ;BIT TO TEST FOR SEND
  90. MODSNDR:    EQU    20H        ;VALUE WHEN READY
  91. ;
  92. ;
  93.         ORG    100H
  94. ;
  95. ;
  96. ; Change the clock speed to suit your system
  97. ;
  98.         DS    3    ;(for  "JMP   START" instruction)
  99. ;
  100. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  101. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  102. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  103. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  104.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  105. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  106.                 ;6=2400 7=4800 8=9600 9=19200 default
  107. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  108.                 ;default time to send character in ter-
  109.                 ;minal mode file transfer for slow BBS.
  110. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  111.                 ;default time for extra wait after CRLF
  112.                 ;in terminal mode file transfer
  113. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  114. SETUPTST:    DB    NO    ;yes=user-added Setup routine        10BH
  115. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  116. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  117.                 ;no=resend a record after a valid-NAK
  118. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  119. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  120. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  121. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  122. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  123. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  124.                 ;terminal mode (added by remote echo)
  125. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  126. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  127.                 ;write logon sequence at location LOGON
  128. SAVCCP:        DB    NO    ;no=do not save CCP            116H
  129. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  130.                 ;no=external command if EXTCHR precedes
  131. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  132. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  133. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  134.                 ;sending a file in terminal mode
  135. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  136.                 ;sending a file in terminal mode
  137. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  138. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  139. EXTRA1:        DB    0    ;for future expansion            11EH
  140. EXTRA2:        DB    0    ;for future expansion            11FH
  141. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  142. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  143. LOGCHR:        DB    'L'-40H    ;^O = Send logon            122H
  144. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  145. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  146. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  147. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  148. EXTCHR:     DB    '^'-00H ; ^ = Send next character        127H
  149. ;
  150. ;
  151.         DS    2        ;                128H
  152. ;
  153. ;
  154. IN$MODCTL1:    CALL    MOD$SEL     ;in modem control port        12AH
  155.         IN    LSR
  156.         RET
  157. ;.....
  158. ;
  159. ;
  160.         DS    4
  161. ;
  162. OUT$MODDATP:    PUSH    PSW        ;out modem data port        134H
  163.         CALL    MOD$SEL
  164.         POP    PSW
  165.         OUT    THR
  166.         RET
  167. ;.....
  168. ;
  169. ;
  170.         DS    2
  171. ;
  172. IN$MODDATP:    CALL    MOD$SEL     ;in modem data port        13EH
  173.         IN    RBR
  174.         RET
  175. ;.....
  176. ;
  177. ;
  178.         DS    4
  179. ;
  180. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  181.  
  182. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  183. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  184. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  185.         DS    6        ;                156H
  186. ;
  187. OUT$MODCTL1:    RET !    NOP !    NOP    ;out modem control port #2    15AH
  188. OUT$MODCTL2:    RET !    NOP !    NOP    ;out modem control port #1    15DH
  189. ;
  190. LOGONPTR:    DW    LOGON        ;for user message.        160H
  191.         DS    6        ;                162H
  192. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  193. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  194.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  195.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  196.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  197. JMP$SETUPR:    JMP    SETUPR        ;                177H
  198. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  199. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  200. JMP$BREAK:    JMP    SENDBRK        ;                180H
  201. ;
  202. ;
  203. ; Do not change the following six lines.
  204. ;
  205. JMP$ILPRT:    DS    3        ;                183H
  206. JMP$INBUF    DS    3        ;                186H
  207. JMP$INLNCOMP:    DS    3        ;                189H
  208. JMP$INMODEM    DS    3        ;                18CH
  209. JMP$NXTSCRN:    DS    3        ;                18FH
  210. JMP$TIMER    DS    3        ;                192H
  211. ;
  212. ;
  213. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  214. ; SCRNTEST to YES at 010AH (above).
  215. ;
  216. CLREOS:        CALL    JMP$ILPRT    ;                195H
  217.         DB    16,0,0,0,0    ;Vector MT code for CLREOS    198H
  218.         RET            ;                19DH
  219. ;
  220. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  221.         DB    4,0,0,0,0    ;Vector MT code for CLRSCRN    1A1H
  222.         RET            ;                1A6H
  223.     
  224. ;
  225. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  226.         DB    'Computer with Morrow MIO board -- User #1'
  227.         DB    CR,LF,0
  228.         RET
  229. ;.....
  230. ;
  231. ;
  232. ;-----------------------------------------------------------------------
  233. ;
  234. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  235. ;     end of your last routine should terminate by 0400H (601 bytes
  236. ;     available after start of SYSVER) if using the Hayes Smartmodem
  237. ;     or by address 0C00H (2659 bytes) otherwise.
  238. ;
  239. ;-----------------------------------------------------------------------
  240. ;
  241. ; You can put in a message at this location which can be called up with
  242. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  243. ; desired.  End with a 0.
  244. ;
  245. LOGON:        DB    'How are you today?',CR,LF,0
  246. ;.....
  247. ;
  248. ;
  249. ; Add your own routine here to send a break tone to reset some time-share
  250. ; computers, if desired.
  251. ;
  252. SENDBRK:    RET
  253. ;.....
  254. ;
  255. ;
  256. ; Add your own routine here to put DTR low and/or send a break tone.
  257. ; Check other routines such as MDM709DP.ASM which is using this feature.
  258. ;
  259. GOODBYE:    RET
  260. ;.....
  261. ;
  262. ;
  263. ; You can use this area for any special initialization or setup you may
  264. ; wish to include.  Each must stop with a RET.    You can check the other
  265. ; available overlays for ideas how to write your own routines if that
  266. ; may be of some help.
  267. ;
  268. INITMOD:  LXI    D,BAUD$MSG    ;Point to baud selection message
  269.       MVI    C,9        ;BDOS print string cmd
  270.       CALL    BDOS        ;Use BDOS to print baud message
  271.       LXI    D,BAUD$BUF    ;point to 1 char input buffer
  272.       MVI    C,10        ;BDOS cmd to fill buffer from CON:
  273.       CALL    BDOS
  274.       LDA    CHOICE        ;Get the character from the buffer
  275.       SUI    31H        ;Subtract ASCII bias
  276.       JC    INITMOD     ;Input must be > zero
  277.       CPI    4        ;And less than 4
  278.       JNC    INITMOD     ;Now we have 0,1,2,or3 in 'A' Register.
  279.       RLC            ;Mult by 2 for table offset
  280.       STA    CHOICE        ;save for later
  281.       MVI    A,GROUP     ;select group (user) number
  282.       OUT    GRP$CTL
  283.       MVI    A,DLAB        ;Set data latch access bit
  284.       OUT    LCR
  285.       LDA    CHOICE        ;get back offset into baud table
  286.       LXI    H,INITBLE    ;point to table base
  287.       ADD    L        ;add offset
  288.       MOV    L,A
  289.       MOV    A,M        ;get low order byte for baud rate
  290.       OUT    DLL
  291.       INX    H        ;point to next table entry
  292.       MOV    A,M        ;and send it to baud register
  293.       OUT    DLM
  294.       MVI    A,WLS0+WLS1+STB ;8 bit data word & 2 stop bits
  295.       OUT    LCR
  296.       IN    RBR        ;clear flags
  297.       MVI    A,IMASK     ;set interrupt status (all disabled)
  298.       OUT    IER
  299.       RET
  300. ;.....
  301. ;
  302. ;
  303. SETUPR:      RET
  304. ;.....
  305. ;
  306. ;
  307. MOD$SEL:  MVI    A,GROUP     ;Group select code
  308.       OUT    GRP$CTL     ;Group select register
  309.       MVI    A,WLS0+WLS1+STB ;make sure DLAB is clear
  310.       OUT    LCR
  311.       RET
  312. ;.....
  313. ;
  314. ;
  315. ; If using the Hayes Smartmodem this is unavailable without a special
  316. ; change.
  317. ;
  318. SPCLMENU: RET
  319. ;
  320. ;
  321. BAUD$MSG: DB    CR,LF,TAB,'SELECT BAUD RATE (MIO user 1)'
  322.       DB    CR,LF,TAB,TAB,'1. 300'
  323.       DB    CR,LF,TAB,TAB,'2. 1200'
  324.       DB    CR,LF,TAB,TAB,'3. 4800'
  325.       DB    CR,LF,TAB,TAB,'4. 9600','$'
  326. ;
  327. BAUD$BUF: DB    01,00
  328. CHOICE:   DB    00
  329. ;.....
  330. ;
  331. ;
  332. ; The initialization table is nothing more than a list of bytes to
  333. ; be send to the baud rate registers, in the same order as the choices
  334. ; in the baud message above.  Note the MSB,LSB order within each entry.
  335. ;
  336. INITBLE:  DB    80H,01        ;300 baud divisor = 0180H
  337.       DB    60H,0        ;1200 baud divisor = 0C0H
  338.       DB    18H,0        ;4800 baud divisor = 018H
  339.       DB    0CH,0        ;9600 baud divisor = 00CH
  340. ;.....
  341. ;
  342. ;
  343. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  344. ;                 0C00H (without Smartmodem)
  345. ;.....
  346. ;
  347.       END
  348. ;
  349.