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 / M7DP-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  294 lines

  1.  
  2. ; M7DP-1.ASM -- Datapoint 1560 overlay file for MDMxx2.  11/11/83
  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 Datapoint 1560 computer to the modem program.
  7. ; Much of the information contained here is not in the main file.
  8. ;
  9. ; Edit this file for your preferences then follow the "TO USE:" example
  10. ; shown below.
  11. ;
  12. ; Use the MDM7xx "SET" command to change the baudrate when desired.  It
  13. ; starts 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. ;        4300 0100
  24. ;        -IM7DP-1.HEX        (note the "I" command)
  25. ;        -R            ("R" loads in the .HEX file)
  26. ;        NEXT  PC
  27. ;        4300 0000
  28. ;        -G0            (return to CP/M)
  29. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  30. ;
  31. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  32. ;
  33. ; 11/11/83 - Renamed to M7DP-1.ASM, no changes    - Irv Hoff
  34. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  35. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  36. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  37. ; 05/25/83 - Updated to work with MDM709    - Irv Hoff
  38. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  39. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  40. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  41. ; 02/27/83 - Updated to work with MDM705    - Irv Hoff
  42. ; 02/17/83 - Modified MDM703CF for Datapoint
  43. ;         1560 computers using an exter-
  44. ;         nal modem                - Irv Hoff
  45. ;
  46. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  47. ;
  48. BELL:        EQU    07H        ;bell
  49. CR:        EQU    0DH        ;carriage return
  50. ESC:        EQU    1BH        ;escape
  51. LF:        EQU    0AH        ;linefeed
  52. ;
  53. YES:        EQU    0FFH
  54. NO:        EQU    0
  55. ;
  56. ;
  57. PORT:        EQU    028H        ;Datapoint 1560 Modem Data Port
  58. MODCTL1:    EQU    PORT+1        ;Modem status port
  59. MODCTL2:    EQU    PORT+1        ;Modem control port
  60. MODDATP:    EQU    PORT        ;Modem data port
  61. ;
  62. ;
  63.         ORG    100H
  64. ;
  65.         DS    3    ;(for  "JMP   START" instruction)
  66. ;
  67.  
  68. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  69. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem            104H
  70. TONEPULSE:    DB    'T'    ;T=tone, P=Pulse (Smartmodem-only)    105H
  71. CLOCK:        DB    37    ;clock speed in MHz x10, 25.5 MHz max.    106H
  72.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  73. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  74.                 ;6=2400 7=4800 8=9600 9=19200 default
  75. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  76.                 ;default time to send character in ter-
  77.                 ;minal mode file transfer for slow BBS.
  78. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  79.                 ;default time for extra wait after CRLF
  80.                 ;in terminal mode file transfer
  81. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  82. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  83. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  84. ACKNAK:        DB    YES    ;yes=resend a record after a non-ACK    10DH
  85.                 ;no=resend a record only after NAK
  86. BAKKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  87. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  88. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  89. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  90. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  91. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  92.                 ;terminal mode (added by remote echo)
  93. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  94. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  95.                 ;write logon sequence at location LOGON
  96. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  97. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  98.                 ;no=external command if EXTCHR precedes
  99. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  100. LSTTST:        DB    YES    ;yes=printer available on printer port    19H
  101. XOFFTST:    DB    NO    ;yes=chcks for XOFF from remote    while    11AH
  102.                 ;sending a file in terminal mode
  103. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  104.                 ;sending a file in terminal mode
  105. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  106. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  107. EXTRA1:        DB    0    ;for future expansion            11EH
  108. EXTRA2:        DB    0    ;for future expansion            11FH
  109. BRKCHR        DB    '@'-40H    ;Send a 300 ms. break tone        120H
  110. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from phone line    121H
  111. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  112. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  113. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  114. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  115. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  116. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  117. ;
  118. ;
  119.         DS    2        ;                128H
  120. ;
  121. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  122.         DS    7
  123. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  124.         DS    7
  125. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  126.         DS    31
  127. ;
  128. LOGONPTR:    DW    LOGON        ;for user message.        160H
  129.         DS    6        ;                162H
  130. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  131. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  132.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  133.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  134.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  135. JMP$SETUPR:    JMP    SETUPR        ;                177H
  136. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  137. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  138. JMP$BREAK:    JMP    SENDBRK        ;                180H
  139. ;
  140. ;
  141. ; Do not change the following six lines.
  142. ;
  143. JMP$ILPRT:    DS    3        ;                183H
  144. JMP$INBUF    DS    3        ;                186H
  145. JMP$INLNCOMP:    DS    3        ;                189H
  146. JMP$INMODEM    DS    3        ;                18CH
  147. JMP$NXTSCRN:    DS    3        ;                18FH
  148. JMP$TIMER:    DS    3        ;                192H
  149. ;
  150. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  151. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  152. ;
  153. CLREOS:        CALL    JMP$ILPRT    ;                195H
  154.         DB    ESC,79H,0,0,0    ;                198H
  155.         RET            ;                19DH
  156. ;
  157. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  158.         DB    ESC,3AH,0,0,0    ;                1A1H
  159.         RET            ;                1A6H
  160. ;
  161. ;
  162. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  163.         DB    'Version for Datapoint 1560 modem port 28H'    
  164.         DB    CR,LF,0
  165.         RET
  166. ;.....
  167. ;
  168. ;
  169. ;-----------------------------------------------------------------------
  170. ;
  171. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  172. ;     end of your last routine should terminate by 0400H (601 bytes
  173. ;     available after start of SYSVER) if using the Hayes Smartmodem
  174. ;     or by address 0C00H (2659 bytes) otherwise.
  175. ;
  176. ;-----------------------------------------------------------------------
  177. ;
  178. ; You can put in a message at this location which can be called up with
  179. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  180. ; desired.  End with a 0.
  181. ;
  182. ;
  183. LOGON:      DB    'This is a Datapoint 1560 computer',CR,LF,0
  184. ;
  185. ;=======================================================================
  186. ;
  187. ; This routine allows a 300 ms. break tone to be sent to reset some
  188. ; time-share computers.
  189. ;
  190. SENDBRK:  MVI    A,1FH
  191.       JMP    GOODBYE1
  192. ;.....
  193. ;
  194. ;
  195. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  196. ; length of time to disconnect some modems such as the Bell 212A, etc.
  197. ;
  198. GOODBYE:  MVI    A,15H        ;SEND BREAK, TURN OFF DTR
  199. ;
  200. GOODBYE1: OUT    MODCTL1        ;SEND TO STATUS PORT
  201.       MVI    B,3        ;DELAY ABOUT 300 MS.
  202.       CALL    JMP$TIMER
  203.       MVI    A,07H        ;NORMAL SEND/RECEIVE WITH DTR
  204.       OUT    MODCTL1        ;SEND TO STATUS PORT
  205.       RET
  206. ;
  207. ;
  208. ; Datapoint 1560 initialization -- sets CTC timers 20H and 1AH for
  209. ; baudrate in/out.
  210. ;
  211. INITMOD:  MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  212.       STA    MSPEED
  213.       MVI    A,47H
  214.       OUT    20H
  215.       OUT    1AH
  216. ;
  217. INITMOD1: MVI    A,20H        ;DEFAULT TO 300 BAUD
  218.       OUT    20H
  219.       OUT    1AH
  220.       RET
  221. ;.....
  222. ;
  223. ;
  224. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  225.       CALL    JMP$ILPRT
  226.       DB    'Input Baud Rate (300, 450, 1200, 9600): ',0
  227.       CALL    JMP$INBUF
  228.       LXI    D,BAUDBUF+2
  229.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  230.       DB    '300',0
  231.       JNC    OK300        ;GO IF GOT MATCH
  232.       CALL    JMP$INLNCOMP
  233.       DB    '450',0
  234.       JNC    OK450
  235.       CALL    JMP$INLNCOMP
  236.       DB    '1200',0
  237.       JNC    OK1200
  238.       CALL    JMP$INLNCOMP
  239.       DB    '9600',0
  240.       JNC    OK9600
  241.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  242.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  243.       JMP    SETUPR        ;TRY AGAIN
  244. ;
  245. OK300:      MVI    A,1        ;MSPEED 300 BAUD VALUE
  246.       LHLD    BD300        ;GET 300 BAUD PARAMETERS IN 'HL'
  247.       JMP    LOADBD        ;GO LOAD THEM
  248. ;
  249. OK450:      MVI    A,2
  250.       LHLD    BD450
  251.       JMP    LOADBD
  252. ;
  253. OK1200:      MVI    A,5
  254.       LHLD    BD1200
  255.       JMP    LOADBD
  256. ;
  257. OK9600:      MVI    A,8
  258.       LHLD    BD9600
  259. ;
  260. LOADBD:      STA    INITMOD+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  261.       MOV    A,L        ;GET BAUDRATE BYTE
  262.       STA    INITMOD1+1    ;STORE IN INITMOD
  263.       JMP    INITMOD        ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  264. ;
  265. ;
  266. ; TABLE OF BAUDRATE PARAMETERS
  267. ;
  268. BD300:      DW    0020H        ;9600/300  CONVERTED TO HEX VALUE
  269. BD450:      DW    0015H        ;9600/450  CONVERTED TO HEX VALUE
  270. BD1200:      DW    0008H        ;9600/1200 CONVERTED TO HEX VALUE
  271. BD9600:      DW    0001H        ;9600/9600 CONVERTED TO HEX VALUE    
  272. ;
  273. BAUDBUF:  DB    10,0
  274.       DS    10
  275. ;
  276. ;           (END OF INITMOD AND SETUP ROUTINES)
  277. ;=======================================================================
  278. ;        
  279. ;
  280. ; These routines can be used for your equipment, be sure to end with RET
  281. ; If using the Hayes Smartmodem this is unavailable without a special
  282. ; change.
  283. ;
  284. SPCLMENU: RET
  285. ;        
  286. ;=======================================================================
  287. ;
  288. ;
  289. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  290. ;                 0BC0H (without Smartmodem)
  291. ;
  292.       END
  293. ;
  294.