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 / M7SG-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  15KB  |  370 lines

  1.  
  2. ;======================================================================
  3. ; M7SG-1.ASM -- Systems Group System 2800 overlay file for MDM700.COM
  4. ;======================================================================
  5. ;
  6. ; Set up for CPC-2810 controller port C (28h).  See alternate equate.
  7. ;
  8. ; Adapted 12/30/84 by Dave McCrady, Edmonton RCP/M.  For use with
  9. ; MODM700.  It may work with earlier versions of MODEM7, but has not
  10. ; been tested with any.
  11. ;
  12. ; You will want to look this file over carefully. There are a number of
  13. ; options that you can use to configure the program to suit your taste.
  14. ; This file adapts the Systems 2800 computer to the modem program.  Much
  15. ; of the information contained here is not in the MDM7xx.ASM file.
  16. ;
  17. ; Edit this file for your preferences then follow the "TO USE:" example
  18. ; shown below.
  19. ;
  20. ; Use the "SET" command to change the baudrate when desired.  It starts
  21. ; out at 300 baud when the program is first called up.  See comments at
  22. ; the label INITMOD1: and INITMOD2: to change this to 1200 baud default
  23. ; start-up if desired.
  24. ;
  25. ;       TO USE: First edit this file filling in answers for your own
  26. ;               equipment.  Then assemble with ASM.COM or equivalent
  27. ;               assembler.  Then use DDT to overlay the the results
  28. ;               of this program to the original .COM file:
  29. ;
  30. ;               A>DDT MODM700.COM
  31. ;               DDT VERS 2.2
  32. ;               NEXT  PC
  33. ;               4A00 0100
  34. ;               -IM7SG-1.HEX            (note the "I" command)
  35. ;               -R                      ("R" loads in the .HEX file)
  36. ;               NEXT  PC
  37. ;               4A00 0000
  38. ;               -G0                     (return to CP/M)
  39. ;               A>SAVE 73 MODM700.COM    (now have a modified .COM file)
  40. ;
  41. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  42. ;
  43. ; Revisions/changes:
  44. ;
  45. ;  12/30/84 -- Adapted from Kaypro overlay (M7KP-2.ASM) -- Dave McCrady
  46. ;
  47. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  48. ;
  49. BELL:           EQU     07H             ;bell
  50. CR:             EQU     0DH             ;carriage return
  51. ESC:            EQU     1BH             ;escape
  52. LF:             EQU     0AH             ;linefeed
  53. ;
  54. YES:            EQU     0FFH
  55. NO:             EQU     0
  56. ;
  57. ;
  58. ;Comment out the port you don't want ... (same CTC counter is
  59. ;used for both)
  60. ;
  61. PORT:           EQU     28H             ;Systems Group serial port C
  62. ;PORT:          EQU     2AH             ;Systems Group serial port D
  63. ;
  64. MODCTL1:        EQU     PORT+1          ;Modem control port
  65. MODDATP:        EQU     PORT            ;Modem data port
  66. MODCTL2:        EQU     PORT+1          ;Modem control port
  67. MODRCVB:        EQU     01H             ;Your bit to test for receive
  68. MODRCVR:        EQU     01H             ;Your value when receive ready
  69. MODSNDB:        EQU     04H             ;Your bit to test for send
  70. MODSNDR:        EQU     04H             ;Your value when send ready             
  71. ;
  72. ;
  73.                 ORG     100H
  74. ;
  75. ;
  76. ; Change the clock speed as needed for your system.
  77. ;
  78.                 DS      3       ;(for  "JMP   START" instruction)
  79. ;
  80. PMMIMODEM:      DB      NO      ;yes=PMMI S-100 Modem                   103H
  81. SMARTMODEM:     DB      yes     ;yes=HAYES Smartmodem, no=non-PMMI      104H
  82. TOUCHPULSE:     DB      'T'     ;T=touch, P=pulse (Smartmodem-only)     105H
  83. CLOCK:          DB      20      ;clock speed in MHz x10, 25.5 MHz max.  106H
  84.                                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  85. MSPEED:         DB      3       ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  86.                                 ;6=2400 7=4800 8=9600 9=19200 default
  87. BYTDLY:         DB      5       ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  88.                                 ;default time to send character in ter-
  89.                                 ;minal mode file transfer for slow BBS.
  90. CRDLY:          DB      5       ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  91.                                 ;default time for extra wait after CRLF
  92.                                 ;in terminal mode file transfer
  93. NOOFCOL:        DB      5       ;number of DIR columns shown            10AH
  94. SETUPTST:       DB      YES     ;yes=user-added Setup routine           10BH
  95. SCRNTEST:       DB      YES     ;Cursor control routine                 10CH
  96. ACKNAK:         DB      YES     ;yes=resend a record after any non-ACK  10DH
  97.                                 ;no=resend a record after a valid NAK
  98. BAKUPBYTE:      DB      NO      ;yes=change any file same name to .BAK  10EH
  99. CRCDFLT:        DB      YES     ;yes=default to CRC checking            10FH
  100. TOGGLECRC:      DB      YES     ;yes=allow toggling of CRC to Checksum  110H
  101. CONVBKSP:       DB      NO      ;yes=convert backspace to rub           111H
  102. TOGGLEBK:       DB      NO      ;yes=allow toggling of bksp to rub      112H
  103. ADDLF:          DB      NO      ;no=no LF after CR to send file in      113H
  104.                                 ;terminal mode (added by remote echo)
  105. TOGGLELF:       DB      YES     ;yes=allow toggling of LF after CR      114H
  106. TRANLOGON:      DB      YES     ;yes=allow transmission of logon        115H
  107.                                 ;write logon sequence at location LOGON
  108. SAVCCP:         DB      YES     ;yes=do not overwrite CCP               116H
  109. LOCONEXTCHR:    DB      NO      ;yes=local command if EXTCHR precedes   117H
  110.                                 ;no=external command if EXTCHR precedes
  111. TOGGLELOC:      DB      YES     ;yes=allow toggling of LOCONEXTCHR      118H
  112. LSTTST:         DB      YES     ;yes=printer available on printer port  119H
  113. XOFFTST:        DB      NO      ;yes=chcks for XOFF from remote while   11AH
  114.                                 ;sending a file in terminal mode
  115. XONWAIT:        DB      NO      ;yes=wait for XON after CR while        11BH
  116.                                 ;sending a file in terminal mode
  117. TOGXOFF:        DB      YES     ;yes=allow toggling of XOFF checking    11CH
  118. IGNORCTL:       DB      YES     ;yes=CTL-chars above ^M not displayed   11DH
  119. EXTRA1:         DB      0       ;for future expansion                   11EH
  120. EXTRA2:         DB      0       ;for future expansion                   11FH
  121. BRKCHR:         DB      '@'-40H ;^@ = Send a 300 ms. break tone         120H
  122. NOCXNNCT:       DB      'N'-40H ;^N = Disconnect from the phone line    121H
  123. LOGCHR:         DB      'L'-40H ;^L = Send logon                        122H
  124. LSTCHR:         DB      'P'-40H ;^P = Toggle printer                    123H
  125. UNSAVE:         DB      'R'-40H ;^R = Close input text buffer           124H
  126. TRANCHR:        DB      'T'-40H ;^T = Transmit file to remote           125H
  127. SAVECHR:        DB      'Y'-40H ;^Y = Open input text buffer            126H
  128. EXTCHR:         DB      '^'-40H ;^^ = Send next character               127H
  129. ;
  130. ;
  131.                 DS      2               ;                               128H
  132. ;
  133. IN$MODCTL1:     MVI     A,10H           ;channel 0, reset interrupts.   12AH
  134.                 OUT     MODCTL1
  135.                 IN      MODCTL1         ;get the status bits
  136.                 RET
  137.                 DS      3
  138. ;
  139. OUT$MODDATP:    OUT     MODDATP ! RET   ;out modem data port            134H
  140.                 DS      7
  141. IN$MODDATP:     IN      MODDATP ! RET   ;in modem data port             13EH
  142.                 DS      7
  143. ANI$MODRCVB:    ANI     MODRCVB ! RET   ;bit to test for receive ready  148H
  144. CPI$MODRCVR:    CPI     MODRCVR ! RET   ;value of receive bit when rdy  14BH
  145. ANI$MODSNDB:    ANI     MODSNDB ! RET   ;bit to test for send ready     14EH
  146. CPI$MODSNDR:    CPI     MODSNDR ! RET   ;value of send bit when ready   151H
  147.                 DS      6
  148. ;
  149. OUT$MODCTL1:    OUT     MODCTL1 ! RET   ;out modem control port         15AH
  150. OUT$MODCTL2:    OUT     MODCTL2 ! RET   ;out modem status port          15DH
  151. ;
  152. ;
  153. LOGONPTR:       DW      LOGON           ;for user message.              160H
  154.                 DS      6               ;                               162H
  155. JMP$GOODBYE:    JMP     GOODBYE         ;                               168H
  156. JMP$INITMOD:    JMP     INITMOD         ;go to user written routine     16BH
  157.                 RET  !  NOP  !  NOP     ;(by-passes PMMI routine)       16EH
  158.                 RET  !  NOP  !  NOP     ;(by-passes PMMI routine)       171H
  159.                 RET  !  NOP  !  NOP     ;(by-passes PMMI routine)       174H
  160. JMP$SETUPR:     JMP     SETUPR          ;                               177H
  161. JMP$SPCLMENU:   JMP     SPCLMENU        ;                               17AH
  162. JMP$SYSVER:     JMP     SYSVER          ;                               17DH
  163. JMP$BREAK:      JMP     SENDBRK         ;                               180H
  164. ;
  165. ;
  166. ; Do not change the following six lines.
  167. ;
  168. JMP$ILPRT:      DS      3               ;                               183H
  169. JMP$INBUF       DS      3               ;                               186H
  170. JMP$INLNCOMP:   DS      3               ;                               189H
  171. JMP$INMODEM     DS      3               ;                               18CH
  172. JMP$NXTSCRN:    DS      3               ;                               18FH
  173. JMP$TIMER:      DS      3               ;                               192H
  174. ;
  175. ;
  176. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  177. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  178. ;
  179. CLREOS:         CALL    JMP$ILPRT       ;Heath/Zenith 19                195H
  180.                 DB      01BH,'J',0,0,0  ;                               198H
  181.                 RET                     ;                               19DH
  182. ;
  183. CLRSCRN:        CALL    JMP$ILPRT       ;Heath/Zenith 19                19EH
  184.                 DB      01BH,'E',0,0,0  ;                               1A1H
  185.                 RET                     ;                               1A6H
  186. ;
  187. ;
  188. SYSVER:         CALL    JMP$ILPRT       ;                               1A7H
  189.                 DB      'Version for Systems Group '
  190.                 db      'CPC-2810 controller, serial port C'
  191.                 db      cr,lf,lf
  192.                 db      'Initial baud rate set for 300'
  193.                 DB      CR,LF,0
  194.                 RET
  195. ;.....
  196. ;
  197. ;
  198. ;-----------------------------------------------------------------------
  199. ;
  200. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  201. ;        end of your last routine should terminate by 0380H (473 bytes
  202. ;        available after start of SYSVER) if using the Hayes Smartmodem
  203. ;        or by address 0B80H (2521 bytes) otherwise.
  204. ;
  205. ;-----------------------------------------------------------------------
  206. ;
  207. ; You can put in a message at this location which can be called up with
  208. ; CTL-O if TRANLOGON has been set YES.  You can put in several lines if
  209. ; desired.  End with a 0.
  210. ;
  211. ; For members using the PRO-COM DATABASE, fill in the appropriate
  212. ; firstname;lastname;user id#  be sure to end it with  CR,0
  213. ;
  214. LOGON:    DB    'This is a Systems Group System 2800',CR,0
  215. ;.....
  216. ;
  217. ;
  218. ; This routine allows a 300 ms. break tone to be sent to reset some
  219. ; time-share computers.
  220. ;
  221. SENDBRK:  MVI   A,5
  222.           OUT   MODCTL1
  223.           MVI   A,0F8H          ;SEND A BREAK TONE              
  224.           JMP   GOODBYE1
  225. ;.....
  226. ;
  227. ;
  228. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  229. ; length of time to disconnect some modems such as the Bell 212A, etc.
  230. ;
  231. GOODBYE:  MVI   A,5
  232.           OUT   MODCTL1         ;SEND TO THE STATUS PORT
  233.           MVI   A,68H           ;TURN OFF DTR
  234. ;
  235. GOODBYE1: OUT   MODCTL1
  236.           MVI   B,3             ;DELAY 300 MS.
  237.           CALL  JMP$TIMER
  238.           MVI   A,5
  239.           OUT   MODCTL1
  240.           MVI   A,0E8H          ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  241.           OUT   MODCTL1
  242.           RET
  243. ;.....
  244. ;
  245. ;
  246. ; Systems Group initialization -- sets CTC timer 2EH for send and receive
  247. ; baudrate.
  248. ;
  249. ;
  250. INITMOD:  MVI   A,2EH           ;SELECT REG.
  251.           OUT   MODCTL1
  252.           MVI   A,18H           ;THROW OUT OF MODE
  253.           OUT   MODCTL1
  254.           MVI   A,04H           ;SELECT REG.
  255.           OUT   MODCTL1
  256.           MVI   A,44H           ;SET ASCII PARAMETERS
  257.           OUT   MODCTL1
  258.           MVI   A,03H           ;SELECT REG.
  259.           OUT   MODCTL1
  260.           MVI   A,0C1H          ;ENABLE RECEIVE
  261.           OUT   MODCTL1
  262.           MVI   A,05H           ;SELECT REG.
  263.           OUT   MODCTL1
  264.           MVI   A,0EAH          ;ENABLE SEND, DTR, RTS
  265.           OUT   MODCTL1
  266. ;
  267. ; If you desire MDM7xx to start at 1200 baud rather than 300, change
  268. ; the MVI  A,1  to   MVI  A,5
  269. ;
  270. INITMOD1: MVI   A,1             ;SET FILE TRANSFER TIME
  271.           STA   MSPEED
  272.           MVI   A,47H
  273.           OUT   2EH             ;SEND TO 'CTC' TIMER
  274. ;
  275. ;
  276. ; Also change this MVI  A,80H  to  MVI  A,20H  for 1200 baud default
  277. ;
  278. INITMOD2: MVI   A,80H           ;INITIALIZE TO 300 BAUD
  279.           OUT   2EH             ;SEND TO 'CTC' TIMER
  280.           RET
  281. ;.....
  282. ;
  283. ;
  284. ; Sets the modem speed via the SET command.
  285. ;
  286. SETUPR:   LXI   D,BAUDBUF       ;POINT TO NEW INPUT BUFFER
  287.           CALL  JMP$ILPRT
  288.           DB    'Input Baud Rate (300, 600, 1200, 2400, 4800, 9600): ',0
  289.           CALL  JMP$INBUF
  290.           LXI   D,BAUDBUF+2
  291.           CALL  JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  292.           DB    '300',0
  293.           JNC   OK300           ;GO IF GOT MATCH
  294.           CALL  JMP$INLNCOMP
  295.           DB    '600',0
  296.           JNC   OK600
  297.           CALL  JMP$INLNCOMP
  298.           DB    '1200',0
  299.           JNC   OK1200
  300.           CALL  JMP$INLNCOMP
  301.           DB    '2400',0
  302.           JNC   OK2400
  303.           CALL  JMP$INLNCOMP
  304.           DB    '4800',0
  305.           JNC   OK4800
  306.           CALL  JMP$INLNCOMP
  307.           DB    '9600',0
  308.           JNC   OK9600
  309.           CALL  JMP$ILPRT       ;ALL MATCHES FAILED, TELL OPERATOR
  310.           DB    '++ Incorrect entry ++',CR,LF,BELL,0
  311.           JMP   SETUPR          ;TRY AGAIN
  312. ;
  313. OK300:    MVI   A,1
  314.           LHLD  BD300
  315.           JMP   LOADBD
  316. ;
  317. OK600:    MVI   A,3
  318.           LHLD  BD600
  319.           JMP   LOADBD
  320. ;
  321. OK1200:   MVI   A,5
  322.           LHLD  BD1200
  323.           JMP   LOADBD
  324. ;
  325. OK2400:   MVI   A,6
  326.           LHLD  BD2400
  327.           JMP   LOADBD
  328. ;
  329. OK4800:   MVI   A,7
  330.           LHLD  BD4800
  331.           JMP   LOADBD
  332. ;
  333. OK9600:   MVI   A,8
  334.           LHLD  BD9600
  335. ;
  336. LOADBD:   STA   INITMOD1+1      ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  337.           MOV   A,L             ;GET BAUDRATE BYTE
  338.           STA   INITMOD2+1      ;SEND TO 'CTC' FOR NEW BAUDRATE
  339.           JMP   INITMOD1        ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  340. ;
  341. ;
  342. ; TABLE OF BAUDRATE PARAMETERS
  343. ;
  344. BD300:    DW    80h
  345. BD600:    DW    40h
  346. BD1200:   DW    20h
  347. BD2400:   DW    10h
  348. BD4800:   DW    08h
  349. BD9600:   DW    04h
  350. ;
  351. BAUDBUF:  DB    10,0
  352.           DS    10
  353. ;
  354. ;-----------------------------------------------------------------------
  355. ;
  356. ; The following routine can be used as an auxiliary menu for notes of
  357. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  358. ; this is unavailable without a spcial address change.
  359. ;
  360. SPCLMENU: RET
  361. ;
  362. ;-----------------------------------------------------------------------
  363. ;
  364. ;
  365. ; NOTE:  MUST TERMINATE PRIOR TO 0380H (with Smartmodem)
  366. ;                                0B80H (without Smartmodem)
  367. ;
  368.           END
  369. ;
  370.