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 / M7CD-2.AQM / M7CD-2.ASM
Assembly Source File  |  2000-06-30  |  13KB  |  404 lines

  1. ; M7CD-2.ASM    MODIFIED TO INIT AND CHANGE BAUD RATES ON THE TUART
  2. ;        SECOND PORT AT 20H
  3. ;               6/24/84 BY CARL AHLERS
  4. ; M7CD-1.ASM -- OVERLAY FOR CROMEMCO CDOS 2.54 OR GREATER COPIED
  5. ;               FROM M7GP-1.ASM DATED 11/11/83 BY FORD BUCKNER
  6. ; This is setup for use with a TUART board on PORT 50 driving a
  7. ; US ROBOTICS 212a modem.
  8. ;
  9. ; M7GP-1.ASM -- General purpose overlay file for MDM7xx.  11/11/83
  10. ;
  11. ;
  12. ; You will want to look this file over carefully. There are a number of
  13. ; options that you can use to configure the program to suit your taste.
  14. ; This file places particular emphasis on using an external modem that
  15. ; does not match one of the other special overlays.  You would use the
  16. ; normal CP/M "Configure" program to set the modem to whatever baud rate
  17. ; you would normally use (such as 300 or 1200, etc.)  Then perhaps just
  18. ; make a second .COM file if you need both 300 and 1200 and do not wish
  19. ; to write your own initialization or "set baud" routine.
  20. ;
  21. ; You could look at other overlay files to see how the GOODBYE and/or
  22. ; SETUPR areas are handled.  You could then adapt one of those, if ap-
  23. ; propriate for your equipment in this overlay.  Some examples:
  24. ;
  25. ;     "DP"  Datapoint 1560 overlay using 8251 I/O and CTC timers for
  26. ;           setting baud rates
  27. ;     "H8"  Heath H89 overlay for 8250 I/O and programmable baud rates
  28. ;     "HZ"  Zenith 120 overlay for 2661B initialization and baud rates
  29. ;     "XE"  Xerox 820II overlay for Z80-SIO intialization, etc.
  30. ;
  31. ; Edit this file for your preferences then follow the "TO USE:" example
  32. ; shown below.
  33. ;
  34. ;    TO USE: First edit this file filling in answers for your own
  35. ;        equipment.  Then assemble with ASM.COM or equivalent
  36. ;        assembler.  Then use DDT to overlay the the results
  37. ;        of this program to the original .COM file:
  38. ;
  39. ;        A>DDT MDM7xx.COM
  40. ;        DDT VERS 2.2
  41. ;        NEXT  PC
  42. ;        4300 0100
  43. ;        -IM7GP-1.HEX        (note the "I" command)
  44. ;        -R            ("R" loads in the .HEX file)
  45. ;        NEXT  PC
  46. ;        4300 0000
  47. ;        -G0            (return to CP/M)
  48. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  49. ;
  50. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  51. ;
  52. ; 06/24/84 - Renamed to M7CD-2.asm              - Carl Ahlers
  53. ; 11/27/83 - Renamed to M7CD-1.asm              - Ford Buckner
  54. ; 11/11/83 - Renamed to M7GP-1.ASM, no changes    - Irv Hoff
  55. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  56. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  57. ; 07/01/83 - Revised to work with MDM710    - Irv Hoff
  58. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  59. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  60. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  61. ; 04/04/83 - First version of this file        - Irv Hoff
  62. ;
  63. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  64. ;
  65. BELL:        EQU    07H        ;bell
  66. CR:        EQU    0DH        ;carriage return
  67. ESC:        EQU    1BH        ;escape
  68. LF:        EQU    0AH        ;linefeed
  69. ;
  70. YES:        EQU    0FFH
  71. NO:        EQU    0
  72. ;
  73. ;
  74. ; Change the following information to match your equipment
  75. ;
  76. PORT:        EQU    050H
  77. MODCTL1:    EQU    PORT        ;MODEM CONTROL PORT
  78. MODDATP:    EQU    PORT+1        ;MODEM DATA IN PORT
  79. MODDATO:    EQU    PORT+1        ;MODEM DATA OUT PORT
  80. MODCMDP:    EQU    PORT+2        ;MODEM COMMAND PORT
  81. MODMASK:    EQU    PORT+3        ;MODEM INTERRUPT PORT
  82. MODCTL2:    EQU    PORT+4        ;2ND MODEM CONTROL PORT
  83. BAUDRP:        EQU    PORT         ;BAUD RATE PORT
  84. ;
  85. PORT@:        EQU    020H
  86. MODCTL1@:    EQU    PORT@        ;MODEM CONTROL PORT
  87. MODDATP@:    EQU    PORT@+1        ;MODEM DATA IN PORT
  88. MODDATO@:    EQU    PORT@+1        ;MODEM DATA OUT PORT
  89. MODCMDP@:    EQU    PORT@+2        ;MODEM COMMAND PORT
  90. MODMASK@:    EQU    PORT@+3        ;MODEM INTERRUPT PORT
  91. MODCTL2@:    EQU    PORT@+4        ;2ND MODEM CONTROL PORT
  92. BAUDRP@:    EQU    PORT@        ;BAUD RATE PORT
  93. ;
  94. MODDCDB:    EQU    2        ;CARRIER DETECT BIT
  95. MODDCDA:    EQU    2        ;VALUE WHEN ACTIVE
  96. MODRCVB:    EQU    40H             ;BIT TO TEST FOR RECEIVE
  97. MODRCVR:    EQU    40H        ;VALUE WHEN READY
  98. MODSNDB:    EQU    80H        ;BIT TO TEST FOR SEND
  99. MODSNDR:    EQU    80H        ;VALUE WHEN READY
  100. ;
  101. STOPBIT:    EQU    80H        ;SETS MSB=1 FOR ONE STOP BIT
  102. BAUDRATE:    EQU    STOPBIT+08H    ;1200 BAUD & ONE STOP BIT
  103. RESET:        EQU    9        ;RESET TU-ART
  104. LOW$RNG:        EQU    0        ;LOW BAUD RATE RANGE
  105. HIGH$RNG:        EQU    10H        ;HIGH BAUD RATE RANGE
  106. ;
  107.         ORG    100H
  108. ;
  109. ;
  110. ; Change the clock speed to suit your system
  111. ;
  112.         DS    3    ;(for  "JMP   START" instruction)
  113. ;
  114. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  115. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  116. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  117. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  118.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  119. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  120.                 ;6=2400 7=4800 8=9600 9=19200 default
  121. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  122.                 ;default time to send character in ter-
  123.                 ;minal mode file transfer for slow BBS.
  124. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  125.                 ;default time for extra wait after CRLF
  126.                 ;in terminal mode file transfer
  127. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  128. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  129. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  130. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  131.                 ;no=resend a record after a valid-NAK
  132. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  133. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  134. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  135. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  136. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  137. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  138.                 ;terminal mode (added by remote echo)
  139. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  140. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  141.                 ;write logon sequence at location LOGON
  142. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  143. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  144.                 ;no=external command if EXTCHR precedes
  145. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  146. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  147. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  148.                 ;sending a file in terminal mode
  149. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  150.                 ;sending a file in terminal mode
  151. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  152. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  153. EXTRA1:        DB    0    ;for future expansion            11EH
  154. EXTRA2:        DB    0    ;for future expansion            11FH
  155. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  156. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  157. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  158. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  159. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  160. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  161. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  162. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  163. ;
  164. ;
  165.         DS    2        ;                128H
  166. ;
  167. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  168.         DS    7
  169. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  170.         DS    7
  171. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  172.         DS    7
  173. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  174.  
  175. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  176. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  177. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  178.         DS    6        ;                156H
  179. ;
  180. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port #2    15AH
  181. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem control port #1    15DH
  182. ;
  183. LOGONPTR:    DW    LOGON        ;for user message.        160H
  184.         DS    6        ;                162H
  185. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  186. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  187.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  188.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  189.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  190. JMP$SETUPR:    JMP    SETUPR        ;                177H
  191. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  192. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  193. JMP$BREAK:    JMP    SENDBRK        ;                180H
  194. ;
  195. ;
  196. ; Do not change the following six lines.
  197. ;
  198. JMP$ILPRT:    DS    3        ;                183H
  199. JMP$INBUF    DS    3        ;                186H
  200. JMP$INLNCOMP:    DS    3        ;                189H
  201. JMP$INMODEM    DS    3        ;                18CH
  202. JMP$NXTSCRN:    DS    3        ;                18FH
  203. JMP$TIMER    DS    3        ;                192H
  204. ;
  205. ;
  206. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  207. ; SCRNTEST to YES at 010AH (above).
  208. ;
  209. CLREOS:        CALL    JMP$ILPRT    ;                195H
  210.         DB    1BH,'J',0,0,0    ;                198H
  211.         RET            ;                19DH
  212. ;
  213. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  214.         DB    1BH,'E',0,0,0    ;                1A1H
  215.         RET            ;                1A6H
  216.     
  217. ;
  218. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  219.         DB    'Cromemco Version with TU-ART & 3102'
  220.         DB    CR,LF,0
  221.         RET
  222. ;.....
  223. ;
  224. ;
  225. ;-----------------------------------------------------------------------
  226. ;
  227. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  228. ;     end of your last routine should terminate by 0400H (601 bytes
  229. ;     available after start of SYSVER) if using the Hayes Smartmodem
  230. ;     or by address 0C00H (2659 bytes) otherwise.
  231. ;
  232. ;-----------------------------------------------------------------------
  233. ;
  234. ; You can put in a message at this location which can be called up with
  235. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  236. ; desired.  End with a 0.
  237. ;
  238. LOGON:        DB    'How are you today?',CR,LF,0
  239. ;
  240. ;
  241. ; This routine allows a 300 ms. break tone to be sent to reset some
  242. ; time-shar computers.
  243. ;
  244. SENDBRK:  RET
  245. ;.....
  246. ;
  247. ;
  248. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  249. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  250. ;
  251. GOODBYE:  RET
  252. ;.....
  253. ;
  254. ;    
  255. ; CROMEMCO TU-ART initialization
  256. ;
  257. INITMOD:  PUSH    B
  258.       MVI    A,RESET
  259.       ADI   LOW$RNG        ;RESET AND SELECT BAUD RATE RANGE
  260.       MOV    B,A
  261.       OUT    MODCMDP@
  262.       MVI    A,BAUDRATE    ;SET BAUD RATE
  263.       MOV    C,A
  264.       OUT    BAUDRP@
  265.       MVI    A,0        ;SET FOR NO INTERUPTS
  266.       OUT    MODMASK@
  267. ;
  268. INITMOD1: MOV    A,B        ;RESET AND SELECT BAUD RATE RANGE
  269.       OUT    MODCMDP
  270. ;
  271. INITMOD2: MOV    A,C        ;SET BAUD RATE
  272.       OUT    BAUDRP
  273. ;
  274. INITMOD3: MVI    A,0        ;SET FOR NO INTERUPTS
  275.       OUT    MODMASK    
  276.       POP     B
  277.       RET
  278. ;.....
  279. ;
  280. ;
  281. ; Setup routine to allow changing modem speed with the SET command.
  282. ;
  283. SETUPR:
  284.       LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  285.       CALL    JMP$ILPRT
  286.       DB    'Input Baud Rate (300,1200,2400,4800,9600,19200): ',0
  287.       CALL    JMP$INBUF
  288.       LXI    D,BAUDBUF+2
  289.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  290.       DB    '300',0
  291.       JNC    OK300        ;GO IF GOT MATCH
  292.       CALL    JMP$INLNCOMP
  293.       DB    '1200',0
  294.       JNC    OK1200
  295.       CALL    JMP$INLNCOMP
  296.       DB    '2400',0
  297.       JNC    OK2400
  298.       CALL    JMP$INLNCOMP
  299.       DB    '4800',0
  300.       JNC    OK4800
  301.       CALL    JMP$INLNCOMP
  302.       DB    '9600',0
  303.       JNC    OK9600
  304.       CALL    JMP$INLNCOMP
  305.       DB    '19200',0
  306.       JNC    OK19200
  307.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  308.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  309.       JMP    SETUPR        ;TRY AGAIN
  310. ;
  311. OK300:      MVI    A,RESET
  312.       ADI    LOW$RNG
  313.       PUSH    B
  314.       MOV    B,A
  315.       LDA    BD300
  316.           MOV    C,A
  317.       MVI    A,1        ;MSPEED VALUE FOR FILE TRANFER TIME
  318.       JMP    LOADBD
  319. ;
  320. OK1200:      MVI    A,RESET
  321.       ADI    LOW$RNG
  322.       PUSH    B
  323.       MOV    B,A
  324.       LDA    BD1200
  325.           MOV    C,A
  326.       MVI    A,5
  327.       JMP    LOADBD
  328. ;
  329. OK2400:      MVI    A,RESET
  330.       ADI    LOW$RNG
  331.       PUSH    B
  332.       MOV    B,A
  333.       LDA    BD2400
  334.       MOV    C,A
  335.       MVI    A,6
  336.       JMP    LOADBD
  337. ;
  338. OK4800:      MVI    A,RESET
  339.       ADI    LOW$RNG
  340.       PUSH    B
  341.       MOV    B,A
  342.       LDA    BD4800
  343.       MOV    C,A
  344.       MVI    A,7
  345.       JMP    LOADBD
  346. ;
  347. OK9600:      MVI    A,RESET
  348.       ADI    LOW$RNG
  349.       PUSH    B
  350.       MOV    B,A
  351.       LDA    BD9600
  352.       MOV    C,A
  353.       MVI    A,8
  354.       JMP    LOADBD
  355. ;
  356. OK19200:  MVI    A,RESET
  357.       ADI    HIGH$RNG
  358.       PUSH    B
  359.       MOV    B,A
  360.       LDA    BD19200
  361.       MOV    C,A
  362.       MVI    A,9
  363. ;
  364. LOADBD:      STA    MSPEED        ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  365.       MOV    A,M        ;GET "MSP" BAUD RATE BYTE
  366.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  367. ;.....
  368. ;
  369. ;
  370. ; Table of baud rate values
  371. ;
  372. ;BD300:      DB    STOPBIT+4H    ;300 baud + STOP BIT
  373. ;BD1200:  DB    STOPBIT+8H    ;1200 baud + STOP BIT
  374. ;BD2400:  DB    STOPBIT+10H    ;2400 baud + STOP BIT
  375. ;BD4800:  DB    STOPBIT+20H    ;4800 baud + STOP BIT
  376. ;BD9600:  DB    STOPBIT+40H    ;9600 baud + STOP BIT
  377. ;BD19200: DB    STOPBIT+10H    ;19200 baud + STOP BIT 
  378. ;
  379. BD300:      DB    84H        ;300 baud & ONE STOP BIT
  380. BD1200:      DB    88H        ;1200 baud & ONE STOP BIT
  381. BD2400:      DB    90H        ;2400 baud & ONE STOP BIT
  382. BD4800:      DB    0A0H        ;4800 baud & ONE STOP BIT
  383. BD9600:      DB    0C0H        ;9600 baud & ONE STOP BIT
  384. BD19200:  DB    90H        ;19200 baud & ONE STOP BIT (USE HIGH RANGE)
  385. ;
  386. BAUDBUF:  DB    10,0
  387.       DS    10
  388. ;.....
  389. ;
  390. ;
  391. ; The following routine can be used as an auxiliary menu for notes of
  392. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  393. ; this is unavailable without a special address change.
  394. ;
  395. SPCLMENU: RET
  396. ;.....
  397. ;
  398. ;
  399. ; NOTE:   MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  400. ;                   0C00H (without Smartmodem)
  401. ;
  402.       END
  403. ;
  404.