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-2830.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  305 lines

  1. ; M7-2830.ASM -- CCS-SYSTEM 320/420 or any S-100 Computer using the
  2. ;                CCS-2830 Dart Board 
  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. ;
  7. ;
  8. ; Edit this file for your preferences then follow the "TO USE:" example
  9. ; shown below.
  10. ;
  11. ; Use the "SET" command to change the baudrate when desired.  It starts
  12. ; out at 1200 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. ;        4x00 0100
  23. ;        -IM7-2830.HEX        (note the "I" command)
  24. ;        -R            ("R" loads in the .HEX file)
  25. ;        NEXT  PC
  26. ;        4x00 0000
  27. ;        -G0            (return to CP/M)
  28. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  29. ;            ^
  30. ;                       This may vary depending upon version of MDM7xx
  31. ;
  32. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  33. ; 04/30/83 - Renamed and revised for MDM7xx    - Dennis Recla
  34. ;
  35. ; 10/29/83 - Modified MDM705XE for CCS-SYSTEM 320/420 and any S-100 type
  36. ;         computers with the CCS-2830 I/O Board and an external 212A
  37. ;            (Bell 212A or Hayes Smartmodem 1200) modem.
  38. ;                        - Harry Kaemmerer
  39. ;          
  40. ;
  41. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  42. ;
  43. BELL:        EQU    07H        ;bell
  44. CR:        EQU    0DH        ;carriage return
  45. ESC:        EQU    1BH        ;escape
  46. LF:        EQU    0AH        ;linefeed
  47. ;
  48. YES:        EQU    0FFH
  49. NO:        EQU    0
  50. ;
  51. MODCTCP:    EQU    20H        ;Modem CTC base port
  52. PORT:        EQU    24H        ;Modem DART/SIO base port
  53. MODCTL1:    EQU    PORT+1        ;Modem control port
  54. MODDATP:    EQU    PORT        ;Modem data port
  55. MODCTL2:    EQU    PORT+1        ;Modem status port
  56. MODRCVB:    EQU    01H        ;Your bit to test for receive
  57. MODRCVR:    EQU    01H        ;Your value when receive ready
  58. MODSNDB:    EQU    04H        ;Your bit to test for send
  59. MODSNDR:    EQU    04H        ;Your value when send ready        
  60. ;
  61.         ORG    100H
  62.         DS    3    ;(for  "JMP   START" instruction)
  63. ;
  64. ; Change the clock speed to suit your system
  65. ;
  66. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  67. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem 1200        104H
  68. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  69. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  70.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  71. MSPEED:        DB    5    ;1=300 5=1200 8=9600             107H
  72. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  73.                 ;default time to send character in ter-
  74.                 ;minal mode file transfer for slow BBS.
  75. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  76.                 ;default time for extra wait after CRLF
  77.                 ;in terminal mode file transfer
  78. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  79. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  80. SCRNTEST:    DB    YES    ;Clear Sreen routine             10CH
  81. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  82.                 ;no=resend a record after a valid NAK
  83. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  84. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  85. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  86. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  87. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  88. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  89.                 ;terminal mode (added by remote echo)
  90. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  91. TRANLOGON:    DB    no    ;yes=allow transmission of logon    115H
  92.                 ;write logon sequence at location LOGON
  93. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  94. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  95.                 ;no=external command if EXTCHR precedes
  96. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  97. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  98. XOFFTST:    DB    NO    ;yes=check for XOFF from remote    while    11AH
  99.                 ;sending a file in terminal mode
  100. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  101.                 ;sending a file in terminal mode
  102. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  103. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  104. EXTRA1:        DB    0    ;for future expansion            11EH
  105. EXTRA2:        DB    0    ;for future expansion            11FH
  106. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  107. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  108. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  109. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  110. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  111. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  112. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  113. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  114. ;
  115.         DS    2        ;                128H
  116. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts    12AH
  117.         OUT    MODCTL1
  118.         IN    MODCTL1        ;get the status bits
  119.         RET
  120.         DS    3
  121. ;
  122. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  123.         DS    7
  124. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  125.         DS    7
  126. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  127. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  128. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  129. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  130.         DS    6        ;                154H
  131. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port     15AH
  132. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  133. ;
  134. LOGONPTR:    DW    LOGON        ;for user message.        160H
  135.         DS    6        ;                162H
  136. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  137. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  138.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    16EH
  139.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    171H
  140.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    174H
  141. JMP$SETUPR:    JMP    SETUPR        ;                177H
  142. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  143. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  144. JMP$BREAK:    JMP    SENDBRK        ;                180H
  145. ;
  146. ; Do not change the following six lines.
  147. ;
  148. JMP$ILPRT:    DS    3        ;                183H
  149. JMP$INBUF    DS    3        ;                186H
  150. JMP$INLNCOMP:    DS    3        ;                189H
  151. JMP$INMODEM    DS    3        ;                18CH
  152. JMP$NXTSCRN:    DS    3        ;                18FH
  153. JMP$TIMER:    DS    3        ;                192H
  154. ;
  155. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  156. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  157. ;
  158. CLREOS:        CALL    JMP$ILPRT    ;                195H
  159.         DB    0,0,0,0,0    ;                198H
  160.         RET            ;                19DH
  161. ;
  162. CLRSCRN:    CALL    JMP$ILPRT    ;for TeleVideo 920 Terminal    19EH
  163.         DB    1AH,0,0,0,0    ;                1A1H
  164.         RET            ;                1A6H
  165.                     ;
  166. ;-----------------------------------------------------------------------
  167. ;
  168. ;        You can change the SYSVER message to be longer or shorter.  The
  169. ;     end of your last routine should terminate by 0400H (601 bytes
  170. ;     available after start of SYSVER) if using the Hayes Smartmodem
  171. ;     or by address 0C00H (2659 bytes) otherwise.
  172. ;
  173. ;
  174. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  175.         DB    'CCS-2830 DART Board'
  176.         DB    CR,LF,0
  177.         RET
  178.                     ;
  179. ;-----------------------------------------------------------------------
  180. ;
  181. ; You can put in a message at this location which can be called up with
  182. ; CTL-L if TRANLOGON has been set TRUE.  You can put in several lines if
  183. ; desired.  End with a 0.
  184. ;
  185. ;
  186. LOGON:        DB    'XMODEM S',0    ;,CR,LF,0
  187.                     ;
  188. ;-----------------------------------------------------------------------
  189. ;
  190. ; This routine allows a 300 ms. break tone to be sent to reset some
  191. ; time-shar computers.
  192. ;
  193. SENDBRK:  MVI    A,5
  194.       OUT    MODCTL1
  195.       MVI    A,0F8H        ;SEND A BREAK TONE
  196.       JMP    GOODBYE1
  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,5
  202.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  203.       MVI    A,68H        ;TURN OFF DTR
  204. ;
  205. GOODBYE1: OUT    MODCTL1
  206.       MVI    B,3        ;WAIT FOR 300 MS.
  207.       CALL    JMP$TIMER
  208.       MVI    A,5
  209.       OUT    MODCTL1
  210.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  211.       OUT    MODCTL1
  212.       RET
  213.                 ;
  214. ;-----------------------------------------------------------------------
  215. ;    
  216. ; CCS-SYSTEM 320/420 initialization -- sets CTC timer 20H for send and 
  217. ; receive baudrate.
  218. ;
  219. INITMOD:
  220.       MVI    A,00010100B    ;RESET DART1     CREG.0
  221.       OUT    MODCTL1        ;
  222.       MVI    A,01000100B    ;CLK, 1 STOP BIT CREG.4è      OUT    MODCTL1        ;
  223.       MVI    A,00000011B    ;CREG.3 NEXT
  224.       OUT    MODCTL1        ;
  225.       MVI    A,11000001B    ;8 DATA BITS, RX EN CREG.3
  226.       OUT    MODCTL1        ;
  227.       MVI    A,00000101B    ;CREG.5
  228.       OUT    MODCTL1        ;
  229.       MVI    A,11101000B    ;DTR, 8 BITS, TX EN, CREG.5
  230.       OUT    MODCTL1        ;
  231. ;
  232. INITMOD1: MVI    A,5        ;DEFAULT TRANSFER TIME TO 1200 BAUD
  233.       STA    MSPEED
  234.       MVI    A,47H        ;DEFAULT TO 1200 BAUD
  235.       OUT    MODCTCP        ;SEND TO 'CTC' TIMER
  236. ;
  237. INITMOD2: MVI    A,68H        ;INITIALIZE TO 1200 BAUD
  238.       OUT    MODCTCP
  239.       RET
  240.                 ;
  241. ;-----------------------------------------------------------------------
  242. ;
  243. ; Setup routine to allow changing modem speed with the SET command.
  244. ;
  245. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  246.       CALL    JMP$ILPRT
  247.       DB    'Input Baud Rate (300 and 1200 [9600 Hard wired only]): ',0
  248.       CALL    JMP$INBUF
  249.       LXI    D,BAUDBUF+2
  250.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  251.       DB    '300',0
  252.       JNC    OK300        ;GO IF GOT MATCH
  253.       CALL    JMP$INLNCOMP
  254.       DB    '1200',0
  255.       JNC    OK1200
  256.       CALL    JMP$INLNCOMP
  257.       DB    '9600',0
  258.       JNC    OK9600
  259.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  260.       DB    'Incorrect entry!',CR,LF,BELL,0
  261.       JMP    SETUPR        ;TRY AGAIN
  262. ;
  263. OK300:      MVI    A,1
  264.       LHLD    BD300
  265.       JMP    LOADBD
  266. ;
  267. OK1200:      MVI    A,5
  268.       LHLD    BD1200
  269.       JMP    LOADBD
  270. ;
  271. OK9600:      MVI    A,8
  272.       LHLD    BD9600
  273. ;
  274. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  275.       MOV    A,H        ;GET CTC BYTE #1
  276.       STA    INITMOD1+6    ;Save it for init routine
  277.       MOV    A,L        ;GET CTC BYTE #2
  278.       STA    INITMOD2+1    ;SEND TO 'CTC' TIMER FOR NEW BAUDRATE
  279.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  280. ;
  281. ;
  282. ; TABLE OF BAUDRATE PARAMETERS
  283. ; Byte #1 = CTC Byte #1 (Mode), Byte #2 = CTC Byte #2 (Baud Rate)
  284. ;
  285. BD300:      DW    0734H
  286. BD1200:      DW    4768H
  287. BD9600:      DW    470DH
  288. BAUDBUF:  DB    10,0
  289.       DS    10
  290. ;
  291. ;-----------------------------------------------------------------------
  292. ;
  293. ; The following routine can be used as an auxiliary menu for notes of
  294. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  295. ; this is unavailable without a special address change.
  296. ;
  297. SPCLMENU: RET
  298. ;
  299. ;-----------------------------------------------------------------------
  300. ;
  301. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  302. ;                 0C00H (without Smartmodem)
  303. ;
  304.       END
  305.