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 / M7TT-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  11KB  |  353 lines

  1. ; M7TT-2.ASM -- TELETEK SYSTEMASTER overlay file for MDM7xx.  04/30/83
  2. ;
  3. ; You will want to look this file over carefully. There are a number of
  4. ; options that you can use to configure the program to suit your taste.
  5. ; This file adapts the Teletek Systemaster S100 single board computer
  6. ; to MDM7xx.
  7. ;
  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. ;        -IM7TT-2.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. ;            May vary depending upon version of MDM7xx.COM
  32. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  33. ;
  34. ; 04/30/84 - Renamed and revised for MDM7xx    - Dennis Recla
  35. ; 10/17/83 - Modified M712XE for Teletek 
  36. ;         Systemaster SBC                  - Bruce Beauchamp
  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    00H        ;Teletex 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    NO    ;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    9    ;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    9    ;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    YES    ;yes=user-added Setup routine        10BH
  81. SCRNTEST:    DB    YES    ;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    'D'-40H    ;^D = Disconnect from the phone line    121H
  110. LOGCHR:        DB    'I'-40H    ;^I = Send logon (used to init. modem)  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. ; --> FOR QUME QVT 102 (TELEVIDEO 910) 
  165. ;
  166. ;
  167. CLREOS:        CALL    JMP$ILPRT    ;                195H
  168.         DB    1BH,59H,0,0,0    ;                198H
  169.         RET            ;                19DH
  170. ;
  171. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  172.         DB    1BH,2BH,0,0,0    ;                1A1H
  173.         RET            ;                1A6H
  174. ;
  175. ;
  176. SYSVER:        CALL    CLRSCRN        ;                1A7H
  177.         CALL     JMP$ILPRT
  178.         DB    '    Teletek Systemaster SBC'
  179.         DB    CR,LF 
  180.         DB      '    Qume QVT-102 terminal'
  181.         DB    CR,LF,LF
  182.         DB    'Enter M for command menus'
  183.         DB    CR,LF
  184.         DB    'Press TAB in terminal mode to set modem'
  185.         DB    CR,LF,LF,LF,0
  186.         RET
  187. ;.....
  188. ;
  189. ;
  190. ;-----------------------------------------------------------------------
  191. ;
  192. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  193. ;     end of your last routine should terminate by 0400H (601 bytes
  194. ;     available after start of SYSVER) if using the Hayes Smartmodem
  195. ;     or by address 0C00H (2659 bytes) otherwise.
  196. ;
  197. ;-----------------------------------------------------------------------
  198. ;
  199. ; You can put in a message at this location which can be called up with
  200. ; CTL-I if TRANLOGON has been set TRUE.  You can put in several lines if
  201. ; desired.  End with a 0.
  202. ;
  203. ;    Note: This feature is used to initialize the Smartmodem
  204. ;    -------------------------------------------------------
  205. ;
  206. LOGON:        DB    'AT S7=25 S10=15 S11=55 X1 M1',CR,LF,0
  207. ;.....                       \     \      \      \  \_speaker on:M1 off:M0
  208. ;                  \     \      \         \_1200 baud sign on
  209. ;                              \     \      \______fast tone dial speed
  210. ;                               \     \__________1.5s. delay before hangup
  211. ;                                \               if carrier interrupted
  212. ;                                 \__________25s. delay before hangup if
  213. ;                         no carrier is detected
  214. ;
  215. ;
  216. ; This routine allows a 300 ms. break tone to be sent to reset some
  217. ; time-shar computers.
  218. ;
  219. SENDBRK:  MVI    A,5
  220.       OUT    MODCTL1
  221.       MVI    A,0F8H        ;SEND A BREAK TONE
  222.       JMP    GOODBYE1
  223. ;.....
  224. ;
  225. ;
  226. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  227. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  228. ;
  229. GOODBYE:  MVI    A,5
  230.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  231.       MVI    A,68H        ;TURN OFF DTR
  232. ;
  233. GOODBYE1: OUT    MODCTL1
  234.       MVI    B,3        ;WAIT FOR 300 MS.
  235.       CALL    JMP$TIMER
  236.       MVI    A,5
  237.       OUT    MODCTL1
  238.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  239.       OUT    MODCTL1
  240.       RET
  241. ;.....
  242. ;
  243. ;    
  244. ; TELETEK SIO A port initialization and CTC timer setup routine
  245. ;
  246. INITMOD:  MVI    A,00H        ;SELECT REGISTER
  247.       OUT    MODCTL1
  248.       MVI    A,18H        ;THROW OUT OF MODE
  249.       OUT    MODCTL1
  250.       MVI    A,04H        ;SELECT REGISTER
  251.       OUT    MODCTL1
  252.       MVI    A,44H        ;SET ASCII PARAMETERS
  253.       OUT    MODCTL1
  254.       MVI    A,03H        ;SELECT REG.
  255.       OUT    MODCTL1
  256.       MVI    A,0C1H        ;ENABLE RECEIVE
  257.       OUT    MODCTL1
  258.       MVI    A,05H        ;SELECT REG.
  259.       OUT    MODCTL1
  260.       MVI    A,0EAH        ;ENABLE SEND, 'DTR', 'RTS'
  261.       OUT    MODCTL1
  262. ;
  263. INITMOD1: MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  264.       STA    MSPEED
  265.       MVI    A,47H        ;DEFAULT TO 300 BAUD
  266.       OUT    08H        ;SEND TO 'CTC' TIMER
  267. ;
  268. INITMOD2: MVI    A,00H        ;INITIALIZE TO 300 BAUD
  269.       OUT    08H
  270.       RET
  271. ;.....
  272. ;
  273. ;
  274. ; Setup routine to allow changing modem speed with the SET command.
  275. ;
  276. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  277.       CALL    JMP$ILPRT
  278.       DB    'Input Baud Rate (300, 600, 1200, 9600 ,19200): ',0
  279.       CALL    JMP$INBUF
  280.       LXI    D,BAUDBUF+2
  281.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  282.       DB    '300',0
  283.       JNC    OK300        ;GO IF GOT MATCH
  284.       CALL    JMP$INLNCOMP
  285.       DB    '600',0
  286.       JNC    OK600
  287.       CALL    JMP$INLNCOMP
  288.       DB    '1200',0
  289.       JNC    OK1200
  290.       CALL    JMP$INLNCOMP
  291.       DB    '9600',0
  292.       JNC    OK9600
  293.       CALL    JMP$INLNCOMP
  294.       DB    '19200',0
  295.       JNC    OK19200
  296.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  297.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  298.       JMP    SETUPR        ;TRY AGAIN
  299. ;
  300. OK300:      MVI    A,1
  301.       LHLD    BD300
  302.       JMP    LOADBD
  303. ;
  304. OK600:      MVI    A,3
  305.       LHLD    BD600
  306.       JMP    LOADBD
  307. ;
  308. OK1200:      MVI    A,5
  309.       LHLD    BD1200
  310.       JMP    LOADBD
  311. ;
  312. OK9600:      MVI    A,8
  313.       LHLD    BD9600
  314.       JMP    LOADBD
  315. ;
  316. OK19200:  MVI    A,10
  317.       LHLD    BD19200
  318. ;
  319. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  320.       MOV    A,L        ;GET BAUDRATE BYTE
  321.       STA    INITMOD2+1    ;SEND TO 'CTC' TIMER FOR NEW BAUDRATE
  322.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  323. ;
  324. ;
  325. ; TABLE OF BAUDRATE PARAMETERS - Change as needed for hardware
  326. ;
  327. BD300:      DW    0
  328. BD600:      DW    128    
  329. BD1200:      DW    64
  330. BD9600:      DW    8
  331. BD19200:  DW    4
  332. ;
  333. BAUDBUF:  DB    10,0
  334.       DS    10
  335. ;
  336. ;-----------------------------------------------------------------------
  337. ;
  338. ; The following routine can be used as an auxiliary menu for notes of
  339. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  340. ; this is unavailable without a special address change.
  341. ;
  342. SPCLMENU: RET
  343. ;
  344. ;-----------------------------------------------------------------------
  345. ;
  346. ;
  347. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  348. ;                 0C00H (without Smartmodem)
  349. ;
  350.       END
  351. ;
  352.