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 / M7-2710.AQM / M7-2710.ASM
Assembly Source File  |  2000-06-30  |  11KB  |  346 lines

  1.  
  2. ; M7-2710.ASM -- California Computer Systems 2710 Serial I/O
  3. ;
  4. ;                        By Dennis Recla  04/11/84
  5. ;
  6. ;
  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 places particular emphasis on using the CCS 2710 board
  10. ; with 8250 serial I/O at location 78H.  Much of the information contained 
  11. ; here is not in the main file.  If not using the CCS 2710 Serial I/O
  12. ; some of the routines here will illustrate what you could do with your
  13. ; unit.
  14. ;
  15. ; Use the "SET" command to change baudrate when desired.
  16. ;
  17. ; Edit this file for your preferences then follow the "TO USE:" example
  18. ; shown below.
  19. ;
  20. ;
  21. ;    TO USE: First edit this file filling in answers for your own
  22. ;        equipment.  Then assemble with ASM.COM or equivalent
  23. ;        assembler.  Then use DDT to overlay the the results
  24. ;        of this program to the original .COM file:
  25. ;
  26. ;        A>DDT MDM7xx.COM
  27. ;        DDT VERS 2.2
  28. ;        NEXT  PC
  29. ;        4X00 0100
  30. ;        -IM7-2710.HEX        (note the "I" command)
  31. ;        -R            ("R" loads in the .HEX file)
  32. ;        NEXT  PC
  33. ;        4X00 0000
  34. ;        -G0            (return to CP/M)
  35. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  36. ;
  37. ;                       ^
  38. ;                      Value may vary with version of MDM7xx
  39. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  40. ;        M7-2710.ASM             Dennis Recla  04/11/84
  41. ;
  42. ;
  43. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  44. ;
  45. BELL:        EQU    07H        ;bell
  46. CR:        EQU    0DH        ;carriage return
  47. ESC:        EQU    1BH        ;escape
  48. LF:        EQU    0AH        ;linefeed
  49. ;
  50. YES:        EQU    0FFH
  51. NO:        EQU    0
  52. ;
  53. ;
  54. ; Change the value at MODDATP if it does not match what you are using.
  55. ;
  56. MODDATP:    EQU    078H        ;data port for CCS 2710 Board
  57. MODCTL1:    EQU    MODDATP+5    ;status port for CCS 2710
  58. MODRCVB:    EQU    1        ;bit to test for received data
  59. MODRCVR:    EQU    1        ;modem receive ready
  60. MODSNDB:    EQU    20H        ;bit to test for ready to send
  61. MODSNDR:    EQU    20H        ;modem send ready bit
  62. ;
  63. ;
  64.         ORG    100H
  65. ;
  66. ; Change the clock speed if needed, to match your system
  67. ;
  68.         DS    3    ;(for  "JMP   START" instruction)
  69. ;
  70. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  71. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  72. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  73. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  74.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  75. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  76.                 ;6=2400 7=4800 8=9600 9=19200 default
  77. BYTDLY:        DB    8    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  78.                 ;default time to send character in ter-
  79.                 ;minal mode file transfer for slow BBS.
  80. CRDLY:        DB    8    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  81.                 ;default time for extra wait after CRLF
  82.                 ;in terminal mode file transfer
  83. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  84. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  85. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  86. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  87.                 ;no=resend a record after a valid NAK
  88. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  89. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  90. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  91. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  92. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  93. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  94.                 ;terminal mode (added by remote echo)
  95. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  96. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  97.                 ;write logon sequence at location LOGON
  98. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  99. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  100.                 ;no=external command if EXTCHR precedes
  101. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  102. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  103. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  104.                 ;sending a file in terminal mode
  105. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  106.                 ;sending a file in terminal mode
  107. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  108. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  109. EXTRA1:        DB    0    ;for future expansion            11EH
  110. EXTRA2:        DB    0    ;for future expansion            11FH
  111. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  112. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  113. LOGCHR:        DB    'O'-40H    ;^O = Send logon            122H
  114. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  115. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  116. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  117. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  118. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  119. ;
  120. ;
  121.         DS    2        ;                128H
  122. ;
  123. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port             12AH
  124.         DS    7
  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 rcv. bit when ready    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    12        ;PMMI only calls        154H
  134. ;
  135. ;
  136. LOGONPTR:    DW    LOGON        ;for user message.        160H
  137.         DS    6        ;                162H
  138. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  139. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  140.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    16EH
  141.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    171H
  142.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    174H
  143. JMP$SETUPR:    JMP    SETUPR        ;                177H
  144. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  145. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  146. JMP$BREAK:    JMP    SENDBRK        ;                180H
  147. ;
  148. ;
  149. ; Do not change the following six lines.
  150. ;
  151. JMP$ILPRT:    DS    3        ;                183H
  152. JMP$INBUF    DS    3        ;                186H
  153. JMP$INLNCOMP:    DS    3        ;                189H
  154. JMP$INMODEM    DS    3        ;                18CH
  155. JMP$NXTSCRN:    DS    3        ;                18FH
  156. JMP$TIMER    DS    3        ;                192H
  157. ;
  158. ;
  159. ; The following clear the screen for the Televideo 950 terminal
  160. ;
  161. CLREOS:        CALL    JMP$ILPRT    ;                195H
  162.         DB    ESC,'t',0,0,0,0,0,0,0    ;            198H
  163.         RET            ;                19DH
  164. ;
  165. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  166.         DB    ESC,'*',0,0,0,0,0,0,0    ;            1A1H
  167.         RET            ;                1A6H
  168. ;
  169. ;
  170. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  171.         DB    'Version for CCS 2710 @ 78H with 8250 I/O'
  172.         DB    CR,LF,0
  173.         RET
  174. ;.....
  175. ;
  176. ;
  177. ;-----------------------------------------------------------------------
  178. ;
  179. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  180. ;     end of your last routine should terminate by 0400H (601 bytes
  181. ;     available after start of SYSVER) if using the Hayes Smartmodem
  182. ;     or by address 0C00H (2659 bytes) otherwise.
  183. ;
  184. ;-----------------------------------------------------------------------
  185. ;
  186. ; You can put in a message at this location which can be called up with
  187. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  188. ; desired.  End with a 0.
  189. ;
  190. LOGON:      DB    'Hello ...Hello...  Anyone there ???',CR,LF,0
  191. ;.....
  192. ;
  193. ;
  194. ; This routine sends a 300 ms. break tone to reset some time-share
  195. ; computers.
  196. ;
  197. SENDBRK:  MVI    A,40H        ;SET BREAK TONE
  198.       OUT    MODDATP+3
  199.       JMP    GOODBYE1    ;SEND A 300 MS. BREAK TONE
  200. ;.....
  201. ;
  202. ;
  203. ; This routine sends a 300 ms. break tgone and set DTR low for the same
  204. ; length of time to disconnect some modems such as the Bell 212A, etc.
  205. ;
  206. GOODBYE:  XRA    A
  207.       OUT    MODDATP+4    ;SET DTR AND RTS LOW
  208.       MVI    A,40H        ;SET BREAK TONE
  209.       OUT    MODDATP+3
  210. ;
  211. GOODBYE1: MVI    B,3        ;WAIT 300 MS.
  212.       CALL    JMP$TIMER
  213.       MVI    A,03H        ;RESET TO NORMAL 8 BITS
  214.       OUT    MODDATP+3
  215.       MVI    A,01H
  216.       OUT    MODDATP+4    ;RESET DTR HIGH
  217.       RET
  218. ;.....
  219. ;
  220. ;
  221. ; The following is used to initialize the CCS 2710 8250 I/O port
  222. ;
  223. INITMOD:  MVI    A,1        ;default transfer speed to 300 baud
  224.       STA    MSPEED
  225.       DI            ;turn off interrupts for init.
  226.       XRA    A
  227.       OUT    MODDATP+1    ;interrupt enable register
  228.       MVI    A,80H        ;insure out of mode to set baud rate
  229.       OUT    MODDATP+3    ;line control register
  230.       OUT    MODDATP+3
  231. ;
  232. LSPSPD:      MVI    A,80H        ;default 'LSP' speed for 300 baud
  233.       OUT    MODDATP        ;register for 'LSP' speed if enabled
  234. ;
  235. MSPSPD:      MVI    A,01H        ;default 'MSP' speed for 300 baud
  236.       OUT    MODDATP+1    ;register for 'MSP' speed if enabled
  237. ;
  238.       MVI    A,03H        ;8-level, 1 stop bit, no parity
  239.       OUT    MODDATP+3    ;line control register
  240.       MVI    A,01H        ;set 'DTR' for proper modem output level
  241.       OUT    MODDATP+4    ;modem control register
  242.       EI            ;restore interrupts to normal
  243.       RET
  244. ;.....
  245. ;
  246. ;
  247. ; The following routine changes the baud rate for the CCS 2710 with the SET
  248. ; command.
  249. ;
  250. SETUPR:      LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  251.       CALL    JMP$ILPRT
  252.       DB    'Input Baud Rate (300, 450, 600, 1200, 2400, 4800, 9600): ',0
  253.       CALL    JMP$INBUF
  254.       LXI    D,BAUDBUF+2
  255.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  256.       DB    '300',0
  257.       JNC    OK300        ;go if got match
  258.       CALL    JMP$INLNCOMP
  259.       DB    '450',0
  260.       JNC    OK450
  261.       CALL    JMP$INLNCOMP
  262.       DB    '600',0
  263.       JNC    OK600
  264.       CALL    JMP$INLNCOMP
  265.       DB    '1200',0
  266.       JNC    OK1200
  267.       CALL  JMP$INLNCOMP
  268.       DB    '2400',0
  269.       JNC   OK2400
  270.       CALL  JMP$INLNCOMP
  271.       DB    '4800',0
  272.       JNC   OK4800
  273.       CALL    JMP$INLNCOMP
  274.       DB    '9600',0
  275.       JNC    OK9600
  276.       CALL    JMP$ILPRT    ;all matches failed - tell operator
  277.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  278.       JMP    SETUPR        ;try again
  279. ;
  280. OK300:      MVI    A,1        ;MSPEED 300 baud value
  281.       LHLD    BD300        ;get 300 baud parameters in HL
  282.       JMP    LOADBD        ;go load them
  283. ;
  284. OK450:      MVI    A,2
  285.       LHLD    BD450
  286.       JMP    LOADBD
  287.  
  288. OK600:      MVI    A,3
  289.       LHLD    BD600
  290.       JMP    LOADBD
  291. ;
  292. OK1200:      MVI    A,5
  293.       LHLD    BD1200
  294.       JMP    LOADBD
  295. ;
  296. OK2400:   MVI   A,6
  297.       LHLD  BD2400
  298.       JMP   LOADBD
  299. ;
  300. OK4800:   MVI   A,7
  301.       LHLD  BD4800
  302.       JMP   LOADBD
  303. ;
  304. OK9600:      MVI    A,8
  305.       LHLD    BD9600
  306. ;
  307. LOADBD:      STA    INITMOD+1    ;store speed to show transfer time 
  308.       MOV    A,L        ;get least significant baud rate byte
  309.       STA    LSPSPD+1    ;store in INITMOD
  310.       MOV    A,H        ;get most signifcant baud rate byte
  311.       STA    MSPSPD+1    ;store in INITMOD
  312.       JMP    INITMOD        ;reset CCS 2710 Serial I/O 8250
  313. ;
  314. ;
  315. ; Table of baud rate parameters
  316. ;
  317. BD300:      DW    0180H
  318. BD450:      DW    0100H
  319. BD600:      DW    00C0H
  320. BD1200:      DW    0060H
  321. BD2400:   DW    0030H
  322. BD4800:   DW    0018H
  323. BD9600:      DW    000CH
  324. ;
  325. BAUDBUF:  DB    14,0
  326.       DS    14
  327. ;
  328. ;-----------------------------------------------------------------------
  329. ;
  330. ; This routine can be used for your equipment, be sure to end with RET
  331. ; If using the Hayes Smartmodem this is unavailable without a special
  332. ; change.
  333. ;
  334. SPCLMENU: RET
  335. ;
  336. ;-----------------------------------------------------------------------
  337. ;
  338. ;
  339. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  340. ;                 0C00H (without Smartmodem)
  341. ;
  342.       END
  343. ;
  344.