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 / M7C3-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  326 lines

  1.  
  2. ; M7C3-2.ASM -- ; Derived from the general purpose overlay file
  3. ; M7GP-1.ASM and the CP/M Plus overlay file M7C3-1.ASM.
  4. ;
  5. ; This overlay includes subroutines at INITMOD and SETUPR to set the
  6. ; baud rate in a CP/M Plus system and easily adapts the MDM7xx program to
  7. ; various serial I/O types such as the UART, 8251 USART, 8250 ACE, 2661
  8. ; EPCI, etc.
  9. ;
  10. ; You will want to look this file over carefully. There are a number of
  11. ; options that you can use to configure the program to suit your taste.
  12. ; Edit this file for your preferences then follow the "TO USE:" example
  13. ; shown below.
  14. ;
  15. ;    TO USE: First edit this file filling in answers for your own
  16. ;        equipment.  Then assemble with ASM.COM or equivalent
  17. ;        assembler.  Then use DDT to overlay the the results
  18. ;        of this program to the original .COM file:
  19. ;
  20. ;        A>DDT MDM7xx.COM
  21. ;        DDT VERS 2.2
  22. ;        NEXT  PC
  23. ;        4300 0100
  24. ;        -IM7GP-1.HEX        (note the "I" command)
  25. ;        -R            ("R" loads in the .HEX file)
  26. ;        NEXT  PC
  27. ;        4300 0000
  28. ;        -G0            (return to CP/M)
  29. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  30. ;
  31. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  32. ;
  33. ; 06/16/84 - Incorporated CP/M PLUS INITMOD
  34. ;            and SETUPR routines from M7C3-1
  35. ;            into M7GP-1 and renamed M7C3-2    - R. Saeks
  36. ; 11/11/83 - Renamed to M7GP-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. ; 07/01/83 - Revised to work with MDM710    - Irv Hoff
  40. ; 05/27/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 - First version of this file        - Irv Hoff
  44. ;
  45. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  46. ;
  47. BELL:        EQU    07H        ;bell
  48. CR:        EQU    0DH        ;carriage return
  49. ESC:        EQU    1BH        ;escape
  50. LF:        EQU    0AH        ;linefeed
  51. ;
  52. YES:        EQU    0FFH
  53. NO:        EQU    0
  54. ;
  55. ;
  56. ; Change the following information to match your equipment
  57. ;
  58. PORT:        EQU    080H
  59. MODCTL1:    EQU    PORT+1        ;MODEM CONTROL PORT
  60. MODDATP:    EQU    PORT        ;MODEM DATA IN PORT
  61. MODDATO:    EQU    PORT        ;MODEM DATA OUT PORT
  62. MODDCDB:    EQU    040H        ;CARRIER DETECT BIT
  63. MODDCDA:    EQU    040H        ;VALUE WHEN ACTIVE
  64. BAUDRP:        EQU    PORT+2        ;BAUD RATE PORT
  65. MODCTL2:    EQU    PORT+3        ;2ND MODEM CONTROL PORT
  66. MODRCVB:    EQU    2        ;BIT TO TEST FOR RECEIVE
  67. MODRCVR:    EQU    2        ;VALUE WHEN READY
  68. MODSNDB:    EQU    081H        ;BIT TO TEST FOR SEND
  69. MODSNDR:    EQU    081H        ;VALUE WHEN READY
  70. BDOS:        EQU    5
  71. DEVICE:        EQU    6        ;CP/M's MODEM device number
  72. ;
  73.         ORG    100H
  74. ;
  75. ;
  76. ; Change the clock speed to suit 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    60    ;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    5    ;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    YES    ;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    YES    ;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    NO    ;yes=allow transmission of logon    115H
  107.                 ;write logon sequence at location LOGON
  108. SAVCCP:        DB    NO    ;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=checks 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 300 ms. break tone        120H
  122. NOCONNCT:    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:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  134.         DS    7
  135. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  136.         DS    7
  137. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  138.         DS    7
  139. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  140.  
  141. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  142. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  143. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  144.         DS    6        ;                156H
  145. ;
  146. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port #2    15AH
  147. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem control port #1    15DH
  148. ;
  149. LOGONPTR:    DW    LOGON        ;for user message.        160H
  150.         DS    6        ;                162H
  151. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  152. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  153.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  154.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  155.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  156. JMP$SETUPR:    JMP    SETUPR        ;                177H
  157. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  158. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  159. JMP$BREAK:    JMP    SENDBRK        ;                180H
  160. ;
  161. ;
  162. ; Do not change the following six lines.
  163. ;
  164. JMP$ILPRT:    DS    3        ;                183H
  165. JMP$INBUF    DS    3        ;                186H
  166. JMP$INLNCOMP:    DS    3        ;                189H
  167. JMP$INMODEM    DS    3        ;                18CH
  168. JMP$NXTSCRN:    DS    3        ;                18FH
  169. JMP$TIMER    DS    3        ;                192H
  170. ;
  171. ;
  172. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  173. ; SCRNTEST to YES at 010AH (above).
  174. ;
  175. CLREOS:        CALL    JMP$ILPRT    ;                195H
  176.         DB    ESC,'k',0,0,0    ;                198H
  177.         RET            ;                19DH
  178. ;
  179. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  180.         DB    ESC,'v',0,0,0    ;                1A1H
  181.         RET            ;                1A6H
  182.     
  183. ;
  184. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  185.         DB    'Version for CP/M Plus Super Six '
  186.         DB    'with Smartmodem'
  187.         DB    CR,LF,0
  188.         RET
  189. ;.....
  190. ;
  191. ;
  192. ;-----------------------------------------------------------------------
  193. ;
  194. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  195. ;     end of your last routine should terminate by 0400H (601 bytes
  196. ;     available after start of SYSVER) if using the Hayes Smartmodem
  197. ;     or by address 0C00H (2659 bytes) otherwise.
  198. ;
  199. ;-----------------------------------------------------------------------
  200. ;
  201. ; You can put in a message at this location which can be called up with
  202. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  203. ; desired.  End with a 0.
  204. ;
  205. LOGON:        DB    'How are you today?',CR,LF,0
  206. ;.....
  207. ;
  208. ;
  209. ; Add your own routine here to send a break tone to reset some time-share
  210. ; computers, if desired.
  211. ;
  212. SENDBRK:    RET
  213. ;.....
  214. ;
  215. ;
  216. ; Add your own routine here to put DTR low and/or send a break tone.
  217. ; Check other routines such as MDM709DP.ASM which is using this feature.
  218. ;
  219. GOODBYE:    RET
  220. ;.....
  221. ;
  222. ;
  223. ; You can use this area for any special initialization or setup you may
  224. ; wish to include.  Each must stop with a RET.    You can check the other
  225. ; available overlays for ideas how to write your own routines if that
  226. ; may be of some help.
  227. ;
  228. INITMOD:      MVI    C,12
  229.         CALL    BDOS    ;Get version #
  230.         CPI    30H
  231.         JNC    ISCPM3
  232.         CALL    JMP$ILPRT
  233.         DB    'Requires CP/M Version 3',CR,LF,0
  234.         RST    0
  235.  
  236. ISCPM3:        MVI    A,20    ;BIOS return character I/O table function
  237.         STA    FUNC
  238.         MVI    C,50
  239.         LXI    D,FUNC
  240.         CALL    BDOS
  241.         PUSH    H    ;Save the table address for later
  242.         LXI    H,7    ;Offset to baud rate
  243.         MVI    A,DEVICE
  244.         ORA    A
  245.         JZ    ISZERO
  246.         LXI    D,8
  247.  
  248. DEVLP:        DAD    D
  249.         DCR    A
  250.         JNZ    DEVLP
  251.  
  252. ISZERO:        POP    D    ;Get Table address
  253.         DAD    D    ;Form baud rate address
  254.         SHLD    BAUDAD
  255.         RET
  256. ;
  257. SETUPR:          CALL    JMP$ILPRT
  258.         DB    'Input Baud Rate (300, 1200, 9600 ,19200): ',0
  259.         LXI    D,BAUDBUF
  260.         CALL    JMP$INBUF
  261.         LXI    D,BAUDBUF+2
  262.         CALL    JMP$INLNCOMP
  263.         DB    '300',0
  264.         JNC    OK300
  265.         CALL    JMP$INLNCOMP
  266.         DB    '1200',0
  267.         JNC    OK1200
  268.         CALL    JMP$INLNCOMP
  269.         DB    '9600',0
  270.         JNC    OK9600
  271.         CALL    JMP$INLNCOMP
  272.         DB    '19200',0
  273.         JNC    OK19200
  274.         CALL    JMP$ILPRT
  275.         DB    '++ Incorrect entry ++',CR,LF,BELL,0
  276.         JMP    SETUPR
  277.  
  278. OK300:        MVI    A,1
  279.         MVI    B,6
  280.         JMP    LOADBD
  281.  
  282. OK1200:        MVI    A,5
  283.         MVI    B,8
  284.         JMP    LOADBD
  285.  
  286. OK9600:        MVI    A,8
  287.         MVI    B,14
  288.         JMP    LOADBD
  289.  
  290. OK19200:    MVI    A,9
  291.         MVI    B,15
  292.  
  293. LOADBD:        STA    MSPEED
  294.         LHLD    BAUDAD
  295.         MOV    M,B
  296.         LXI    H,DEVICE
  297.         SHLD    BCREG
  298.         MVI    A,21
  299.         STA    FUNC
  300.         MVI    C,50
  301.         LXI    D,FUNC
  302.         JMP    BDOS
  303. ;
  304. BAUDBUF:    DB    10,0
  305.         DS    2
  306.  
  307. FUNC:        DS    1
  308. AREG:        DS    1
  309. BCREG:        DS    2
  310. DEREG:        DS    2
  311. HLREG:        DS    2
  312. BAUDAD:        DS    2
  313. ;
  314. ; If using the Hayes Smartmodem this is unavailable without a special
  315. ; change.
  316. ;
  317. SPCLMENU:  RET
  318. ;
  319. ;
  320. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  321. ;                 0C00H (without Smartmodem)
  322. ;.....
  323. ;
  324.       END
  325. ;
  326.