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 / M7SB-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  9KB  |  297 lines

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