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 / M7KP-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  336 lines

  1.  
  2. ; M7KP-1.ASM -- Kaypro II overlay file for MDM7xx.  11/11/83
  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. ; This file adapts the Kaypro II computer to the modem program.  Much of
  7. ; the information contained here is not in the MDMxx2.ASM file.
  8. ;
  9. ; Edit this file for your preferences then follow the "TO USE:" example
  10. ; shown below.
  11. ;
  12. ; Use the "SET" command to change the baudrate when desired.  It starts
  13. ; out at 300 baud when the program is first called up.
  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. ;        -IM7KP-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. ; 11/11/83 - Renamed to M7KP-1.ASM, no changes    - Irv Hoff
  34. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  35. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  36. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  37. ; 05/25/83 - Revised to work with MDM709    - Irv Hoff
  38. ; 04/15/83 - Revised to work with MDM708    - Irv Hoff
  39. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  40. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  41. ; 02/27/83 - Updated to work with MDM705    - Irv Hoff
  42. ; 02/17/83 - Modified MDM703CF for Kaypro II
  43. ;         computers with external modems    - 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. PORT:        EQU    04H        ;Kaypro II serial output port
  57. MODCTL1:    EQU    PORT+2        ;Modem control port
  58. MODDATP:    EQU    PORT        ;Modem data port
  59. MODCTL2:    EQU    PORT+2        ;Modem control port
  60. MODRCVB:    EQU    01H        ;Your bit to test for receive
  61. MODRCVR:    EQU    01H        ;Your value when receive ready
  62. MODSNDB:    EQU    04H        ;Your bit to test for send
  63. MODSNDR:    EQU    04H        ;Your value when send ready        
  64. ;
  65. ;
  66.         ORG    100H
  67. ;
  68. ;
  69. ; Change the clock speed as needed for your system.
  70. ;
  71.         DS    3    ;(for  "JMP   START" instruction)
  72. ;
  73. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  74. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  75. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  76. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  77.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  78. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  79.                 ;6=2400 7=4800 8=9600 9=19200 default
  80. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  81.                 ;default time to send character in ter-
  82.                 ;minal mode file transfer for slow BBS.
  83. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  84.                 ;default time for extra wait after CRLF
  85.                 ;in terminal mode file transfer
  86. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  87. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  88. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  89. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  90.                 ;no=resend a record after a valid NAK
  91. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  92. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  93. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  94. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  95. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  96. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  97.                 ;terminal mode (added by remote echo)
  98. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  99. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  100.                 ;write logon sequence at location LOGON
  101. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  102. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  103.                 ;no=external command if EXTCHR precedes
  104. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  105. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  106. XOFFTST:    DB    NO    ;yes=chcks for XOFF from remote while    11AH
  107.                 ;sending a file in terminal mode
  108. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  109.                 ;sending a file in terminal mode
  110. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  111. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  112. EXTRA1:        DB    0    ;for future expansion            11EH
  113. EXTRA2:        DB    0    ;for future expansion            11FH
  114. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  115. NOCXNNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  116. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  117. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  118. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  119. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  120. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  121. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  122. ;
  123. ;
  124.         DS    2        ;                128H
  125. ;
  126. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts.    12AH
  127.         OUT    MODCTL1
  128.         IN    MODCTL1        ;get the status bits
  129.         RET
  130.         DS    3
  131. ;
  132. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  133.         DS    7
  134. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  135.         DS    7
  136. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  137. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  138. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  139. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  140.         DS    6
  141. ;
  142. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port        15AH
  143. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  144. ;
  145. ;
  146. LOGONPTR:    DW    LOGON        ;for user message.        160H
  147.         DS    6        ;                162H
  148. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  149. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  150.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  151.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  152.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  153. JMP$SETUPR:    JMP    SETUPR        ;                177H
  154. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  155. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  156. JMP$BREAK:    JMP    SENDBRK        ;                180H
  157. ;
  158. ;
  159. ; Do not change the following six lines.
  160. ;
  161. JMP$ILPRT:    DS    3        ;                183H
  162. JMP$INBUF    DS    3        ;                186H
  163. JMP$INLNCOMP:    DS    3        ;                189H
  164. JMP$INMODEM    DS    3        ;                18CH
  165. JMP$NXTSCRN:    DS    3        ;                18FH
  166. JMP$TIMER:    DS    3        ;                192H
  167. ;
  168. ;
  169. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  170. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  171. ;
  172. CLREOS:        CALL    JMP$ILPRT    ;                195H
  173.         DB    017H,0,0,0,0    ;                198H
  174.         RET            ;                19DH
  175. ;
  176. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  177.         DB    01AH,0,0,0,0    ;                1A1H
  178.         RET            ;                1A6H
  179. ;
  180. ;
  181. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  182.         DB    'Version for Kaypro II serial port 04H'
  183.         DB    CR,LF,0
  184.         RET
  185. ;.....
  186. ;
  187. ;
  188. ;-----------------------------------------------------------------------
  189. ;
  190. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  191. ;     end of your last routine should terminate by 0380H (473 bytes
  192. ;     available after start of SYSVER) if using the Hayes Smartmodem
  193. ;     or by address 0B80H (2521 bytes) otherwise.
  194. ;
  195. ;-----------------------------------------------------------------------
  196. ;
  197. ; You can put in a message at this location which can be called up with
  198. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  199. ; desired.  End with a 0.
  200. ;
  201. LOGON:      DB    'This is a KayPro computer',CR,LF,0
  202. ;.....
  203. ;
  204. ;
  205. ; This routine allows a 300 ms. break tone to be sent to reset some
  206. ; time-share computers.
  207. ;
  208. SENDBRK:  MVI    A,5
  209.       OUT    MODCTL1
  210.       MVI    A,0F8H        ;SEND A BREAK TONE        
  211.       JMP    GOODBYE1
  212. ;.....
  213. ;
  214. ;
  215. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  216. ; length of time to disconnect some modems such as the Bell 212A, etc.
  217. ;
  218. GOODBYE:  MVI    A,5
  219.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  220.       MVI    A,68H        ;TURN OFF DTR
  221. ;
  222. GOODBYE1: OUT    MODCTL1
  223.       MVI    B,3        ;DELAY 300 MS.
  224.       CALL    JMP$TIMER
  225.       MVI    A,5
  226.       OUT    MODCTL1
  227.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  228.       OUT    MODCTL1
  229.       RET
  230. ;.....
  231. ;
  232. ;
  233. ; Kaypro II initialization -- sets CTC timer 00H for send and receive
  234. ; baudrate.
  235. ;
  236. ;
  237. INITMOD:  MVI    A,00H        ;SELECT REG.
  238.       OUT    MODCTL1
  239.       MVI    A,18H        ;THROW OUT OF MODE
  240.       OUT    MODCTL1
  241.       MVI    A,04H        ;SELECT REG.
  242.       OUT    MODCTL1
  243.       MVI    A,44H        ;SET ASCII PARAMETERS
  244.       OUT    MODCTL1
  245.       MVI    A,03H        ;SELECT REG.
  246.       OUT    MODCTL1
  247.       MVI    A,0C1H        ;ENABLE RECEIVE
  248.       OUT    MODCTL1
  249.       MVI    A,05H        ;SELECT REG.
  250.       OUT    MODCTL1
  251.       MVI    A,0EAH        ;ENABLE SEND, DTR, RTS
  252.       OUT    MODCTL1
  253. ;
  254. INITMOD1: MVI    A,1        ;SET FILE TRANSFER TIME
  255.       STA    MSPEED
  256.       MVI    A,47H
  257.       OUT    00H        ;SEND TO 'CTC' TIMER
  258.  
  259. INITMOD2: MVI    A,05H        ;INITIALIZE TO 300 BAUD
  260.       OUT    00H        ;SEND TO 'CTC' TIMER
  261.       RET
  262. ;.....
  263. ;
  264. ;
  265. ; Sets the modem speed via the SET command.
  266. ;
  267. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  268.       CALL    JMP$ILPRT
  269.       DB    'Input Baud Rate (300, 600, 1200, 9600): ',0
  270.       CALL    JMP$INBUF
  271.       LXI    D,BAUDBUF+2
  272.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  273.       DB    '300',0
  274.       JNC    OK300        ;GO IF GOT MATCH
  275.       CALL    JMP$INLNCOMP
  276.       DB    '600',0
  277.       JNC    OK600
  278.       CALL    JMP$INLNCOMP
  279.       DB    '1200',0
  280.       JNC    OK1200
  281.       CALL    JMP$INLNCOMP
  282.       DB    '9600',0
  283.       JNC    OK9600
  284.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  285.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  286.       JMP    SETUPR        ;TRY AGAIN
  287. ;
  288. OK300:      MVI    A,1
  289.       LHLD    BD300
  290.       JMP    LOADBD
  291. ;
  292. OK600:      MVI    A,3
  293.       LHLD    BD600
  294.       JMP    LOADBD
  295. ;
  296. OK1200:      MVI    A,5
  297.       LHLD    BD1200
  298.       JMP    LOADBD
  299. ;
  300. OK9600:      MVI    A,8
  301.       LHLD    BD9600
  302. ;
  303. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  304.       MOV    A,L        ;GET BAUDRATE BYTE
  305.       STA    INITMOD2+1    ;SEND TO 'CTC' FOR NEW BAUDRATE
  306.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  307. ;
  308. ;
  309. ; TABLE OF BAUDRATE PARAMETERS
  310. ;
  311. BD300:      DW    0005H
  312. BD600:      DW    0006H
  313. BD1200:      DW    0007H
  314. BD9600:      DW    000EH
  315. ;
  316. BAUDBUF:  DB    10,0
  317.       DS    10
  318. ;
  319. ;-----------------------------------------------------------------------
  320. ;
  321. ; The following routine can be used as an auxiliary menu for notes of
  322. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  323. ; this is unavailable without a spcial address change.
  324. ;
  325. SPCLMENU: RET
  326. ;
  327. ;-----------------------------------------------------------------------
  328. ;
  329. ;
  330. ; NOTE:  MUST TERMINATE PRIOR TO 0380H (with Smartmodem)
  331. ;                 0B80H (without Smartmodem)
  332. ;
  333.       END
  334. ;
  335.  
  336.