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

  1.  
  2. ; M7C3-1.ASM -- CP/M Plus overlay file for MODEM7.  11/19/83
  3. ;
  4. ; This overlay adapts the MODEM7 program to use the auxiliary device
  5. ; in CP/M Version 3.
  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 Auxiliary device
  10. ; properly configured under CP/M 3.
  11. ;
  12. ;
  13. ; Edit this file for your preferences then follow the "TO USE:" example
  14. ; shown below.
  15. ;
  16. ;    TO USE: First edit this file filling in answers for your own
  17. ;        equipment.  Then assemble with MAC.COM or equivalent
  18. ;        assembler.  Then use SID to overlay the the results
  19. ;        of this program to the original .COM file:
  20. ;
  21. ;        A>SID MDM712
  22. ;        CP/M 3 SID - Version 3.0
  23. ;        NEXT MSZE  PC  END
  24. ;        4300 4300 0100 D3FF
  25. ;        #E M7C3-1.HEX        ("E" loads in the .HEX file)
  26. ;        NEXT MSZE  PC  END
  27. ;        031E 4300 0100 D3FF
  28. ;        #W MDM712.COM,100,42FF    ("W" writes the modified .COM file)
  29. ;        0084h record(s) written
  30. ;        #G0            (return to CP/M)
  31. ;
  32. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  33. ;
  34. ; 11/19/83 - Edited M712GP.ASM for this file    - Jim Lopushinsky
  35. ;
  36. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  37. ;
  38. BELL:        EQU    07H        ;bell
  39. CR:        EQU    0DH        ;carriage return
  40. ESC:        EQU    1BH        ;escape
  41. LF:        EQU    0AH        ;linefeed
  42. ;
  43. YES:        EQU    0FFH
  44. NO:        EQU    0
  45. ;
  46. ;
  47. ; Change the following information to match your equipment
  48. ;
  49. BDOS:        EQU    5
  50. DEVICE:        EQU    1    ;CP/M's MODEM device number
  51. ;
  52.         ORG    100H
  53. ;
  54. ;
  55. ; Change the clock speed to suit your system
  56. ;
  57.         DS    3    ;(for  "JMP   START" instruction)
  58. ;
  59. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  60. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  61. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  62. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  63.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  64. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  65.                 ;6=2400 7=4800 8=9600 9=19200 default
  66. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  67.                 ;default time to send character in ter-
  68.                 ;minal mode file transfer for slow BBS.
  69. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  70.                 ;default time for extra wait after CRLF
  71.                 ;in terminal mode file transfer
  72. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  73. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  74. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  75. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  76.                 ;no=resend a record after a valid-NAK
  77. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  78. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  79. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  80. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  81. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  82. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  83.                 ;terminal mode (added by remote echo)
  84. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  85. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  86.                 ;write logon sequence at location LOGON
  87. SAVCCP:        DB    NO    ;yes=do not overwrite CCP        116H
  88. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  89.                 ;no=external command if EXTCHR precedes
  90. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  91. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  92. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  93.                 ;sending a file in terminal mode
  94. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  95.                 ;sending a file in terminal mode
  96. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  97. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  98. EXTRA1:        DB    0    ;for future expansion            11EH
  99. EXTRA2:        DB    0    ;for future expansion            11FH
  100. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  101. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  102. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  103. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  104. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  105. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  106. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  107. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  108. ;
  109. ;
  110.         DS    2        ;                128H
  111. ;
  112. IN$MODCTL1:    RET            ;                     12AH
  113.         DS    9
  114. OUT$MODDATP:    JMP    AUXOUT        ;out modem data port        134H
  115.         DS    7
  116. IN$MODDATP:    JMP    AUXIN        ;in modem data port        13EH
  117.         DS    7
  118. ANI$MODRCVB:    RET            ;                148H
  119.         DS    2
  120. CPI$MODRCVR:    JMP    AUXINST        ;value of rcv. bit when ready    14BH
  121. ANI$MODSNDB:    RET            ;                14EH
  122.         DS    2
  123. CPI$MODSNDR:    JMP    AUXOUTST    ;value of send bit when ready    151H
  124.         DS    6        ;                156H
  125. ;
  126. OUT$MODCTL1:    RET            ;                15AH
  127.         DS    2
  128. OUT$MODCTL2:    RET            ;                15DH
  129.         DS    2
  130. ;
  131. LOGONPTR:    DW    LOGON        ;for user message.        160H
  132.         DS    6        ;                162H
  133. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  134. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  135.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    16EH
  136.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    171H
  137.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    174H
  138. JMP$SETUPR:    JMP    SETUPR        ;                177H
  139. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  140. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  141. JMP$BREAK:    JMP    SENDBRK        ;                180H
  142. ;
  143. ;
  144. ; Do not change the following six lines.
  145. ;
  146. JMP$ILPRT:    DS    3        ;                183H
  147. JMP$INBUF    DS    3        ;                186H
  148. JMP$INLNCOMP:    DS    3        ;                189H
  149. JMP$INMODEM    DS    3        ;                18CH
  150. JMP$NXTSCRN:    DS    3        ;                18FH
  151. JMP$TIMER    DS    3        ;                192H
  152. ;
  153. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  154. ; SCRNTEST to YES at 010AH (above).
  155. ;
  156. CLREOS:        CALL    JMP$ILPRT    ;                195H
  157.         DB    ESC,'k',0,0,0    ;Setup for Adds Viewpoint    198H
  158.         RET            ;                19DH
  159. ;
  160. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  161.         DB    12,0,0,0,0    ;Setup for Adds Viewpoint    1A1H
  162.         RET            ;                1A6H
  163.     
  164. ;
  165. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  166.         DB    'Version for CP/M Plus (Device '
  167.         DB    DEVICE+'0',')'
  168.         DB    CR,LF,0
  169.         RET
  170. ;.....
  171. ;
  172. ;
  173. ;-----------------------------------------------------------------------
  174. ;
  175. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  176. ;     end of your last routine should terminate by 0400H (601 bytes
  177. ;     available after start of SYSVER) if using the Hayes Smartmodem
  178. ;     or by address 0C00H (2659 bytes) otherwise.
  179. ;
  180. ;-----------------------------------------------------------------------
  181. ;
  182. ; You can put in a message at this location which can be called up with
  183. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  184. ; desired.  End with a 0.
  185. ;
  186. LOGON:        DB    'The cow jumped over the moon',CR,0
  187. ;.....
  188. ;
  189. ;
  190. ; Add your own routine here to send a break tone to reset some time-share
  191. ; computers, if desired.
  192. ;
  193. SENDBRK:    RET
  194. ;.....
  195. ;
  196. ;
  197. ; Add your own routine here to put DTR low and/or send a break tone.
  198. ; Check other routines such as MDM709DP.ASM which is using this feature.
  199. ;
  200. GOODBYE:    RET
  201. ;.....
  202. ;
  203. ;
  204. ; You can use this area for any special initialization or setup you may
  205. ; wish to include.  Each must stop with a RET.  You can check the other
  206. ; available overlays for ideas how to write your own routines if that
  207. ; may be of some help.
  208. ;
  209. INITMOD:      MVI    C,12
  210.         CALL    BDOS    ;Get version #
  211.         CPI    30H
  212.         JNC    ISCPM3
  213.         CALL    JMP$ILPRT
  214.         DB    'Requires CP/M Version 3',CR,LF,0
  215.         RST    0
  216.  
  217. ISCPM3:        MVI    A,20    ;BIOS return character I/O table function
  218.         STA    FUNC
  219.         MVI    C,50
  220.         LXI    D,FUNC
  221.         CALL    BDOS
  222.         PUSH    H    ;Save the table address for later
  223.         LXI    H,7    ;Offset to baud rate
  224.         MVI    A,DEVICE
  225.         ORA    A
  226.         JZ    ISZERO
  227.         LXI    D,8
  228.  
  229. DEVLP:        DAD    D
  230.         DCR    A
  231.         JNZ    DEVLP
  232.  
  233. ISZERO:        POP    D    ;Get Table address
  234.         DAD    D    ;Form baud rate address
  235.         SHLD    BAUDAD
  236.         RET
  237. ;
  238. SETUPR:          CALL    JMP$ILPRT
  239.         DB    'Input Baud Rate (300, 1200, 9600 ,19200): ',0
  240.         LXI    D,BAUDBUF
  241.         CALL    JMP$INBUF
  242.         LXI    D,BAUDBUF+2
  243.         CALL    JMP$INLNCOMP
  244.         DB    '300',0
  245.         JNC    OK300
  246.         CALL    JMP$INLNCOMP
  247.         DB    '1200',0
  248.         JNC    OK1200
  249.         CALL    JMP$INLNCOMP
  250.         DB    '9600',0
  251.         JNC    OK9600
  252.         CALL    JMP$INLNCOMP
  253.         DB    '19200',0
  254.         JNC    OK19200
  255.         CALL    JMP$ILPRT
  256.         DB    '++ Incorrect entry ++',CR,LF,BELL,0
  257.         JMP    SETUPR
  258.  
  259. OK300:        MVI    A,1
  260.         MVI    B,6
  261.         JMP    LOADBD
  262.  
  263. OK1200:        MVI    A,5
  264.         MVI    B,8
  265.         JMP    LOADBD
  266.  
  267. OK9600:        MVI    A,8
  268.         MVI    B,14
  269.         JMP    LOADBD
  270.  
  271. OK19200:    MVI    A,9
  272.         MVI    B,15
  273.  
  274. LOADBD:        STA    MSPEED
  275.         LHLD    BAUDAD
  276.         MOV    M,B
  277.         LXI    H,DEVICE
  278.         SHLD    BCREG
  279.         MVI    A,21
  280.         STA    FUNC
  281.         MVI    C,50
  282.         LXI    D,FUNC
  283.         JMP    BDOS
  284.  
  285. AUXIN:        DB    0D9H    ;EXX
  286.         MVI    C,3
  287.         CALL    BDOS
  288.         DB    0D9H    ;EXX
  289.         RET
  290.  
  291. AUXOUT:        DB    0D9H    ;EXX
  292.         MVI    C,4
  293.         MOV    E,A
  294.         PUSH    PSW
  295.         CALL    BDOS
  296.         POP    PSW
  297.         DB    0D9H    ;EXX
  298.         RET
  299.  
  300. AUXINST:    DB    0D9H    ;EXX
  301.         MVI    C,7
  302.         CALL    BDOS
  303.         DB    0D9H    ;EXX
  304.         INR    A    ;Reverse sense
  305.         RET
  306.  
  307. AUXOUTST:    DB    0D9H    ;EXX
  308.         MVI    C,8
  309.         CALL    BDOS
  310.         DB    0D9H    ;EXX
  311.         INR    A    ;Reverse sense
  312.         RET
  313.  
  314. BAUDBUF:    DB    10,0
  315.         DS    2
  316.  
  317. FUNC:        DS    1
  318. AREG:        DS    1
  319. BCREG:        DS    2
  320. DEREG:        DS    2
  321. HLREG:        DS    2
  322. BAUDAD:        DS    2
  323. ;
  324. ;
  325. ; If using the Hayes Smartmodem this is unavailable without a special
  326. ; change.
  327. ;
  328. SPCLMENU:  RET
  329. ;
  330. ;
  331. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  332. ;                 0C00H (without Smartmodem)
  333. ;.....
  334. ;
  335.       END
  336. ;
  337.