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

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