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 / M7TV-6.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  13KB  |  458 lines

  1.  
  2. ; M7TV-5.ASM -- TeleVideo TS-802/803 overlay file for MDM7xx.  08/15/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. ; This file adapts the modem port on the TeleVideo TS-802 or the TS-803
  7. ; to the modem program.
  8. ;
  9. ; Edit this file for your preferences then follow the "TO USE:" example
  10. ; shown below.
  11. ;
  12. ;       NOTE:  If using a TS-803, the RCVREADY equate must be set to
  13. ;           the value of the same label in the body of MDM7.
  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. ;        4A00 0100
  27. ;        -IM7TV-4.HEX        (note the "I" command)
  28. ;        -R            ("R" loads in the .HEX file)
  29. ;        NEXT  PC
  30. ;        4A00 0000
  31. ;        -G0            (return to CP/M)
  32. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  33. ;
  34. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  35. ;
  36. ; 09/08/84  Fixed 2nd trivial 803 error - Tim Chiaretto
  37. ; 08/15/84  Fixed a trivial 803 error   - Irv Hoff
  38. ; 08/08/84  Fixed for 802/803 both, with
  39. ;        information from M7TVI-3    - Irv Hoff
  40. ; 11/11/83  Renamed to M7TV-1.ASM    - Irv Hoff
  41. ; 07/27/83  Renamed to work with MDM711    - Irv Hoff
  42. ; 07/01/83  Revised to work with MDM711    - Irv Hoff
  43. ; 06/22/83  Revised to work with MDM711    - Irv Hoff
  44. ; 05/27/83  Updated to work with MDM709    - Irv Hoff
  45. ; 05/15/83  Revised to work with MDM708    - Irv Hoff
  46. ; 04/27/83  Revised to work with TV802    - Irv Hoff
  47. ; 02/17/83  Modified MDM703CF for Datapoint
  48. ;        1560 computers using an external
  49. ;        modem            - Irv Hoff
  50. ;
  51. ;=======================================================================
  52. ;
  53. YES:        EQU    0FFH
  54. NO:        EQU    0
  55. ;
  56. ;
  57. ; Select one of the following two choices for your computer
  58. ;
  59. TV802:        EQU    NO
  60. TV803:        EQU    YES
  61. ;
  62. ;
  63. ; The following address must be obtained from the body of the main pro-
  64. ; gram, if using a TV803.  Value is immaterial if using a TV802.
  65. ;
  66. RCVREADY:    EQU    1E41H        ;location of label in MDM740
  67. ;
  68. ;=======================================================================
  69. ;
  70. ; Normal equates
  71. ;
  72. BELL:        EQU    07H        ;bell
  73. CR:        EQU    0DH        ;carriage return
  74. ESC:        EQU    1BH        ;escape
  75. LF:        EQU    0AH        ;linefeed
  76. ;
  77. ;
  78. ; Special equates for Televideo computers
  79. ;
  80.          IF    TV802
  81. PORT:        EQU    20H        ;TeleVideo ST-802 data port
  82. BAUDRP:        EQU    08H        ;CTC port for baud rate
  83. MODCTL1:    EQU    PORT+2        ;modem control port
  84. MODCTL2:    EQU    PORT+2        ;modem control port
  85. MODDATP:    EQU    PORT        ;modem data port
  86. MODDCDB:    EQU    4        ;carrier detect bit
  87. MODDCDA:    EQU    0        ;value when active
  88. MODRCVB:    EQU    1        ;bit to test for receive ready
  89. MODRCVR:    EQU    1        ;value when ready
  90. MODSNDB:    EQU    4        ;bit to test for send ready
  91. MODSNDR:    EQU    4        ;value when ready
  92.          ENDIF            ;TV802
  93. ;
  94.          IF    TV803
  95. PORT:        EQU    2FH        ;TeleVideo ST-803 data port
  96. BAUDRP:        EQU    2BH        ;CTC port for baud rate
  97. MODCTL1:    EQU    PORT-2        ;modem control port for input
  98. MODCTL2:    EQU    PORT-1        ;modem control port for output
  99. MODDATP:    EQU    PORT        ;modem data port
  100. MODRCVB:    EQU    80H        ;bit to test for receive ready
  101. MODRCVR:    EQU    80H        ;value when ready
  102. MODSNDB:    EQU    80H        ;bit to test for send ready
  103. MODSNDR:    EQU    80H        ;value when ready
  104.          ENDIF            ;TV803
  105. ;
  106. ;
  107.         ORG    100H
  108. ;
  109.         DS    3    ;(for  "JMP   START" instruction)
  110. ;
  111. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  112. AUTODIAL:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  113. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  114. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  115.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  116. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  117.                 ;6=2400 7=4800 8=9600 9=19200 default
  118. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  119.                 ;default time to send character in ter-
  120.                 ;minal mode file transfer for slow BBS.
  121. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  122.                 ;default time for extra wait after CRLF
  123.                 ;in terminal mode file transfer
  124. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  125. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  126. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  127. RETRY:        DB    NO    ;yes=reset the error limit to try again    10DH
  128.                 ;no=abort after 10 consecutive errors
  129. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  130. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  131. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  132. CONVRUB:    DB    YES    ;yes=convert rub to backspace        111H
  133. TOGGLERUB:    DB    YES    ;yes=allow toggling of rub to backspace    112H
  134. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  135.                 ;terminal mode (added by remote echo)
  136. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  137. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  138.                 ;write logon sequence at location LOGON
  139. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  140. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  141.                 ;no=external command if EXTCHR precedes
  142. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  143. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  144. XOFFTST:    DB    NO    ;yes=check for XOFF from remote while    11AH
  145.                 ;sending a file in terminal mode
  146. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  147.                 ;sending a file in terminal mode
  148. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  149. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  150. EXTRA1:        DB    0    ;for future expansion            11EH
  151. EXTRA2:        DB    0    ;for future expansion            11FH
  152. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  153. NOCONNCT:    DB    'N'-40H    ;^L = Disconnect from the phone line    121H
  154. LOGCHR:        DB    'L'-40H    ;^N = Send logon            122H
  155. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  156. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  157. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  158. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  159. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  160. ;
  161. ;
  162.         DS    2        ;                128H
  163. ;
  164. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  165. ;
  166.          IF    TV802
  167.         DS    7
  168.          ENDIF            ;TV802
  169. ;
  170.          IF    TV803
  171. IN$MODCTL2:    IN    MODCTL2 ! RET    ;out modem control port        15AH
  172.          DS    4
  173.          ENDIF            ;TV803
  174. ;
  175. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  176.         DS    7
  177. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  178.         DS    7
  179. ;
  180. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  181. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rec. bit when ready    14BH
  182. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH    
  183. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  184. ;
  185.          IF    TV802
  186.         DS    6        ;                154H
  187. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port #2    15AH
  188. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem control port #1    15DH
  189.          ENDIF            ;TV802
  190. ;
  191.          IF    TV803
  192.         DS    10        ;                154H
  193.         RET            ;                15EH
  194.         RET            ;                15FH
  195.          ENDIF            ;TV803
  196. ;
  197. LOGONPTR:    DW    LOGON        ;for user message.        160H
  198.          IF    TV802
  199.         DS    6
  200. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  201.          ENDIF            ;TV802
  202. ;
  203.          IF    TV803
  204.         DS    9
  205.          ENDIF            ;TV803
  206. ;
  207. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  208.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  209.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  210.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  211. JMP$SETUPR:    JMP    SETUPR        ;                177H
  212. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  213. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  214. JMP$BREAK:    JMP    SENDBRK        ;                180H
  215. ;
  216. ;
  217. ; Do not change the following six lines
  218. ;
  219. JMP$ILPRT:    DS    3        ;                183H
  220. JMP$INBUF:    DS    3        ;                186H
  221. JMP$INLNCOMP:    DS    3        ;                189H
  222. JMP$INMODEM:    DS    3        ;                18CH
  223. JMP$NXTSCRN:    DS    3        ;                18FH
  224. JMP$TIMER:    DS    3        ;                192H
  225. ;
  226. ;
  227. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  228. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  229. ;
  230. CLREOS:        CALL    JMP$ILPRT    ;                195H
  231.         DB    ESC,79H,0,0,0    ;ESC y - clear to end of screen    198H
  232.         RET            ;                19DH
  233. ;
  234. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  235.         DB    ESC,2AH,0,0,0    ;ESC * clear CRT, home cursor    11AH
  236.         RET            ;                1A6H            
  237. ;
  238. ;
  239. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  240.         DB    'Version for TeleVideo TS-80'
  241. ;
  242.          IF    TV802
  243.         DB    '2, modem port 20H'
  244.          ENDIF            ;TV802
  245. ;
  246.          IF    TV803
  247.         DB    '3, modem port 2FH'
  248.          ENDIF            ;TV803
  249. ;
  250.         DB    CR,LF,0
  251.         RET
  252. ;.....
  253. ;
  254. ;
  255. ;-----------------------------------------------------------------------
  256. ;
  257. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  258. ;     end of your last routine should terminate by 0400H (601 bytes
  259. ;     available after start of SYSVER) if using the Hayes Smartmodem
  260. ;     or by address 0C00H (2659 bytes) otherwise.
  261. ;
  262. ;-----------------------------------------------------------------------
  263. ;
  264. ; You can put in a message at this location which can be called up with
  265. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  266. ; desired.  End with a 0.
  267. ;
  268. ;
  269. LOGON:    DB    'Greetings from a TeleVideo user',CR,LF,0
  270. ;
  271. ;=======================================================================
  272. ;
  273. ;
  274. ; This routine allows a 300 ms. break tone to be sent to reset some
  275. ; time-share computers.
  276. ;
  277. SENDBRK:
  278.      IF    TV802
  279.     MVI    A,5
  280.     OUT    MODCTL1
  281.     MVI    A,0F8H        ;send a break tone
  282.     JMP    GOODBYE1
  283.      ENDIF            ;TV802
  284. ;
  285.      IF    TV803
  286.     RET
  287.      ENDIF            ;TV803
  288. ;.....
  289. ;
  290. ;
  291. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  292. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  293. GOODBYE:
  294.      IF    TV802
  295.     MVI    A,5
  296.     OUT    MODCTL1        ;send to the status port
  297.     MVI    A,068H        ;turn off dtr, send break
  298. ;
  299. GOODBYE1:
  300.     OUT    MODCTL1    
  301.     MVI    B,3        ;wait 300 ms.
  302.     CALL    JMP$TIMER
  303.     MVI    A,5
  304.     OUT    MODCTL1
  305.     MVI    A,0E8H        ;restore to normal, 8 bits, dtr on, etc.
  306.     OUT    MODCTL1
  307.      ENDIF            ;TV802
  308. ;
  309.     RET
  310. ;.....
  311. ;
  312. ;
  313. ; televideo ts-802 baud rate change.  sets ctc at port 08h for baudrate
  314. ; in/out.
  315. ;
  316.      IF    TV802
  317. INITMOD:MVI    A,0        ;select reg.
  318.     OUT    MODCTL1        ;send to the status port
  319.     MVI    A,18H        ;reset the z8sio chip
  320.     OUT    MODCTL1        ;send to the status port
  321.     MVI    A,4        ;select reg.
  322.     OUT    MODCTL1        ;send to the status port
  323.     MVI    A,44H        ;16x, 1-stop, no parity
  324.     OUT    MODCTL1        ;send to the status port
  325.     MVI    A,3        ;select reg.
  326.     OUT    MODCTL1        ;send to the status port
  327.     MVI    A,0C1H        ;enable receive section
  328.     OUT    MODCTL1        ;send to the status port
  329.     MVI    A,5        ;select reg.
  330.     OUT    MODCTL1        ;send to the status port
  331.     MVI    A,0EAH        ;dtr, rts, 8-bits, enable send section
  332.     OUT    MODCTL1        ;send to the status port
  333. ;
  334. INITMOD1:
  335.     MVI    A,1        ;default transfer time to 300 baud
  336.     STA    MSPEED
  337.     MVI    A,47H
  338.     OUT    BAUDRP
  339. ;
  340. INITMOD2:
  341.     MVI    A,80H        ;default to 300 baud
  342.     OUT    BAUDRP
  343.     RET
  344.      ENDIF            ;TV802
  345. ;
  346.      IF    TV803
  347. INITMOD:RET
  348. ;
  349. INITMOD1:
  350.     MVI    A,1        ;default transfer time to 300 baud
  351.     STA    MSPEED
  352. ;
  353. INITMOD2:
  354.     MVI    A,20H        ;default to 300 baud
  355.     OUT    BAUDRP
  356.     RET
  357.      ENDIF            ;TV803
  358. ;.....
  359. ;
  360. ;
  361. SETUPR:    LXI    D,BAUDBUF    ;point to new input buffer
  362.     CALL    JMP$ILPRT
  363.     DB    'Input Baud Rate (300, 450, 600, 1200, 9600): ',0
  364.     CALL    JMP$INBUF
  365.     LXI    D,BAUDBUF+2
  366.     CALL    JMP$INLNCOMP    ;compare baudbuf+2 with characters below
  367.     DB    '300',0
  368.     JNC    OK300        ;go if got match
  369.     CALL    JMP$INLNCOMP
  370.     DB    '450',0
  371.     JNC    OK450
  372.     CALL    JMP$INLNCOMP
  373.     DB    '600',0
  374.     JNC    OK600
  375.     CALL    JMP$INLNCOMP
  376.     DB    '1200',0
  377.     JNC    OK1200
  378.     CALL    JMP$INLNCOMP
  379.     DB    '9600',0
  380.     JNC    OK9600
  381.     CALL    JMP$ILPRT    ;all matches failed, tell operator
  382.     DB    '++ Incorrect entry ++',CR,LF,BELL,0
  383.     JMP    SETUPR        ;try again
  384. ;
  385. OK300:    MVI    A,1        ;mspeed 300 baud value
  386.     LHLD    BD300        ;get 300 baud parameters in 'HL'
  387.     JMP    LOADBD        ;go load them
  388. ;
  389. OK450:    MVI    A,2
  390.     LHLD    BD450
  391.     JMP    LOADBD
  392. ;
  393. OK600:    MVI    A,3
  394.     LHLD    BD600
  395.     JMP    LOADBD
  396. ;
  397. OK1200:    MVI    A,5
  398.     LHLD    BD1200
  399.     JMP    LOADBD
  400. ;
  401. OK9600:    MVI    A,8
  402.     LHLD    BD9600
  403. ;
  404. LOADBD:    STA    INITMOD1+1    ;change time-to-send to match baudrate
  405.     MOV    A,L        ;get baudrate byte
  406.     STA    INITMOD2+1    ;store in initmod
  407.     JMP    INITMOD1    ;reinitialize to new baudrate, then done
  408. ;
  409. ;
  410. ; table of baudrate parameters
  411. ;
  412.      IF    TV802
  413. BD300:    DW    0080H        ;38400/300  converted to hex value
  414. BD450:    DW    0055H        ;38400/450  converted to hex value
  415. BD600:    DW    0040H        ;38400/600  converted to hex value
  416. BD1200:    DW    0020H        ;38400/1200 converted to hex value
  417. BD9600:    DW    0004H        ;38400/9600 converted to hex value
  418.      ENDIF            ;TV802
  419. ;
  420.      IF    TV803
  421. BD300:    DW    0020H        ;9600/300  converted to hex value
  422. BD450:    DW    0016H        ;9600/450  converted to hex value
  423. BD600:    DW    0010H        ;9600/600  converted to hex value
  424. BD1200:    DW    0008H        ;9600/1200 converted to hex value
  425. BD9600:    DW    0001H        ;9600/9600 converted to hex value
  426.      ENDIF            ;TV803
  427. ;
  428. BAUDBUF:DB    10,0
  429.     DS    10
  430. ;
  431. ;           (end of initmod and setup routines)
  432. ;-----------------------------------------------------------------------
  433. ;
  434. ; these routines can be used for your equipment, be sure to end with ret
  435. ; if using the hayes smartmodem this is unavailable without a special
  436. ; address change.
  437. ;
  438. SPCLMENU:RET
  439. ;
  440. ; NOTE:  Must terminate prior to 0400H
  441. ;
  442. ;
  443. ;-----------------------------------------------------------------------
  444. ;
  445. ; This overwrites the first line of the RCVREADY routine in the body of
  446. ; the main program, in order to check IN$MODCTL2 rather than IM$MODCLT1.
  447. ;
  448.       IF    TV803
  449.      ORG    RCVREADY
  450.      CALL    IN$MODCTL2
  451.       ENDIF            ;TV803
  452. ;
  453. ;-----------------------------------------------------------------------
  454. ;
  455.      END
  456. ;
  457.