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 / M7EP-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  11KB  |  403 lines

  1. ; M7EP-2.ASM -- Epson QX-10 overlay file for MDM7xx.  06/01/84
  2. ;
  3. ; You will want to look this file over carefully. There are a number of
  4. ; options that you can use to configure the program to suit your taste.
  5. ; This file adapts the QX-10 computer to the modem program.  Much of
  6. ; the information contained here is not in the MDM7xx.ASM file.
  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 300 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. ;
  20. ;=============================================================================
  21. ;
  22. ;    SPECIAL    NOTE:  The MDMLNK.COM utility, if available to you, will
  23. ;        overlay    the .HEX file on the .COM file in one simple step.
  24. ;        See MDMLNK instructions for further details.
  25. ;
  26. ;=============================================================================
  27. ;
  28. ;        A>DDT MDM7xx.COM
  29. ;        DDT VERS 2.2
  30. ;        NEXT  PC
  31. ;        4A00 0100
  32. ;        -IM7EP-2.HEX        (note the "I" command)
  33. ;        -R            ("R" loads in the .HEX file)
  34. ;        NEXT  PC
  35. ;        4A00 0000
  36. ;        -G0            (return    to CP/M)
  37. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  38. ;
  39. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  40. ; 06/01/84 - Slight changes for MDM740        - Robert Flagg
  41. ; 04/10/84 - Added parity, stop bit, word length - jw
  42. ; 11/11/83 - Renamed to M7EP-1.ASM, no changes    - Irv Hoff
  43. ; 08/27/83 - Revised to work with MDM712    - Irv Hoff
  44. ; 07/25/83 - Changed M710XE.ASM forEpson QX-10    - Phil Becker
  45. ;
  46. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  47. ;
  48. BELL:        EQU    07H        ;bell
  49. CR:        EQU    0DH        ;carriage return
  50. ESC:        EQU    1BH        ;escape
  51. LF:        EQU    0AH        ;linefeed
  52. ;
  53. YES:        EQU    0FFH
  54. NO:        EQU    0
  55. TRUE        EQU    0FFH
  56. FALSE        EQU    0
  57. ;
  58. BR7A:        EQU    7AH
  59. BR7B:        EQU    7BH
  60. BR4E:        EQU    4EH
  61. BR4F:        EQU    4FH
  62. ;
  63. PORT:        EQU    11H        ;Epson QX-10 serial output port
  64. MODCTL1:    EQU    PORT+2        ;Modem control port
  65. MODDATP:    EQU    PORT        ;Modem data port
  66. MODCTL2:    EQU    PORT+2        ;Modem control port
  67. MODRCVB:    EQU    01H        ;Your bit to test for receive
  68. MODRCVR:    EQU    01H        ;Your value when receive ready
  69. MODSNDB:    EQU    04H        ;Your bit to test for send
  70. MODSNDR:    EQU    04H        ;Your value when send ready        
  71. ;
  72. ;
  73.         ORG    100H
  74. ;
  75. ;
  76. ; Change the clock speed as needed for your system.
  77. ;
  78.         DS    3    ;(for  "JMP   START" instruction)
  79. ;
  80. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  81. AUTODIAL:    DB    NO    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  82. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  83. CLOCK:        DB    40    ;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    1    ;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. RETRY:        DB    YES    ;yes=reset the error limit to try again 10DH
  97.                 ;no=abort after 10 consecutive errors
  98. BAKUPBYTE:    DB    NO    ;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. CONVRUB:    DB    YES    ;yes=convert rub to backspace        111H
  102. TOGGLEBK:    DB    YES    ;yes=allow toggling of rub to backspace 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    YES    ;yes=allow transmission of logon    115H
  107.                 ;write logon sequence at location LOGON
  108. SAVCCP:        DB    YES    ;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=allow toggling of printer on/off    119H
  113. XOFFTST:    DB    YES    ;yes=chcks 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 a 300 ms. break tone        120H
  122. NOCXNNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  123. LOGCHR:        DB    'L'-40H    ;^O = 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:    MVI    A,10H        ;channel 0, reset interrupts.    12AH
  134.         OUT    MODCTL1
  135.         IN    MODCTL1        ;get the status bits
  136.         RET
  137.         DS    3
  138. ;
  139. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  140.         DS    7
  141. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  142.         DS    7
  143. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  144. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  145. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  146. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  147.         DS    6
  148. ;
  149. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port        15AH
  150. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  151. ;
  152. ;
  153. LOGONPTR:    DW    LOGON        ;for user message.        160H
  154.         DS    6        ;                162H
  155. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  156. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  157.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    66EH
  158.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  159.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  160. JMP$SETUPR:    JMP    SETUPR        ;                177H
  161. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  162. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  163. JMP$BREAK:    JMP    SENDBRK        ;                180H
  164. ;
  165. ;
  166. ; Do not change the following six lines.
  167. ;
  168. JMP$ILPRT:    DS    3        ;                183H
  169. JMP$INBUF    DS    3        ;                186H
  170. JMP$INLNCOMP:    DS    3        ;                189H
  171. JMP$INMODEM    DS    3        ;                18CH
  172. JMP$NXTSCRN:    DS    3        ;                18FH
  173. JMP$TIMER:    DS    3        ;                192H
  174. ;
  175. ;
  176. ; Clear    sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  177. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  178. ;
  179. CLREOS:        CALL    JMP$ILPRT    ;                195H
  180.         DB    017H,0,0,0,0    ;                198H
  181.         RET            ;                19DH
  182. ;
  183. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  184.         DB    01AH,0,0,0,0    ;                1A1H
  185.         RET            ;                1A6H
  186. ;
  187. ;
  188. SYSVER:        CALL    CLRSCRN
  189.         CALL    JMP$ILPRT    ;                1A7H
  190.         DB    1BH,29H,'VERSION FOR EPSON QX-10',1BH,28H
  191.         DB    CR,LF,0
  192.         RET
  193. ;.....
  194. ;
  195. ;
  196. ;-----------------------------------------------------------------------
  197. ;
  198. ; NOTE:     You can change the SYSVER message to be longer or shorter.  The
  199. ;     end of    your last routine should terminate by 0380H (473 bytes
  200. ;     available after start of SYSVER) if using the Hayes Smartmodem
  201. ;     or by address 0B80H (2521 bytes) otherwise.
  202. ;
  203. ;-----------------------------------------------------------------------
  204. ;
  205. ; You can put in a message at this location which can be called up with
  206. ; CTL-O    if TRANLOGON has been set YES.    You can put in several lines if
  207. ; desired.  End with a 0.
  208. ;
  209. LOGON:      DB    'Hello from an Epson QX-10 user.',CR,LF,0
  210. ;.....
  211. ;
  212. ;
  213. ; This routine allows a 300 ms. break tone to be sent to reset some
  214. ; time-share computers.
  215. ;
  216. SENDBRK:  MVI    A,5
  217.       OUT    MODCTL1
  218.       MVI    A,0F8H        ;SEND A    BREAK TONE        
  219.       JMP    GOODBYE1
  220. ;.....
  221. ;
  222. ;
  223. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  224. ; length of time to disconnect some modems such as the Bell 212A, etc.
  225. ;
  226. GOODBYE:  MVI    A,5
  227.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  228.       MVI    A,68H        ;TURN OFF DTR, SEND BREAK
  229. ;
  230. GOODBYE1: OUT    MODCTL1
  231.       MVI    B,3        ;DELAY 300 MS.
  232.       CALL    JMP$TIMER
  233.       MVI    A,5
  234.       OUT    MODCTL1
  235.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  236.       OUT    MODCTL1
  237.       RET
  238. ;.....
  239. ;
  240. ;
  241. ; Epson    QX-10 initialization -- sets CTC timer 00H for send and receive
  242. ; baudrate.
  243. ;
  244. ;
  245. INITMOD:  MVI    A,1
  246.       STA    MSPEED
  247.       MVI    A,0B6H
  248.       OUT    7
  249.       MVI    A,068H
  250.       OUT    6
  251.       MVI    A,000H
  252.       OUT    6
  253.       CALL    SETUP7201
  254. INITMOD1: MVI    A,BR4F
  255.       RET    
  256. ;.....
  257. ;
  258. ;
  259. SETUPR:      CALL    JMP$ILPRT
  260.       DB    CR,LF,'Baud Rate = ',0
  261.       CALL    SETUPD
  262.       CALL    JMP$ILPRT
  263.       DB    CR,LF,LF,0                    
  264.       CALL    JMP$ILPRT
  265.       DB    CR,'Input New Baud Rate (1=300, 2=1200): ',0
  266.       MVI    C,1
  267.       CALL    5
  268.       CPI    31H
  269.       JZ    OK3        
  270.       CPI    32H
  271.       JZ    OK12
  272.       CPI    0DH
  273.       JZ    OKBAUD
  274.       JMP    SETUPR        ;TRY AGAIN
  275. ;
  276. OK3:      MVI    A,1        ;SET UP    SPEED COMMAND
  277.       STA    MSPEED        ;STORE SPEED
  278.       MVI    A,0B6H
  279.       OUT    7
  280.       MVI    A,0A0H
  281.       OUT    6
  282.       MVI    A,1
  283.       OUT    6
  284.       JMP    SETUPF        ;GO TO FORMAT SETUP
  285. ;
  286. OK12:      MVI    A,5        ;SET UP    SPEED COMMAND
  287.       STA    MSPEED        ;STORE SPEED
  288.       MVI    A,0B6H
  289.       OUT    7
  290.       MVI    A,068H
  291.       OUT    6
  292.       MVI    A,0
  293.       OUT    6
  294. ;
  295. SETUPF:
  296.       CALL    JMP$ILPRT
  297.       DB    CR,LF
  298.       DB    'Input Format (1=8N1, 2=7E1): ',0
  299.       MVI    C,1
  300.       CALL    5
  301.       CPI    31H
  302.       JZ    OK8N1        
  303.       CPI    32H
  304.       JZ    OK7E1
  305.       JMP    SETUPF        ;TRY AGAIN
  306. ;
  307. OK7E1:      MVI    A,3
  308.       STA    PARITYBITS
  309.       MVI    A,040H
  310.       STA    DATABITS
  311.       LDA    MSPEED
  312.       CPI    5
  313.       JZ    OK7E1H
  314.       MVI    A,BR7B
  315.       JMP    SETUPDN
  316. OK7E1H:      MVI    A,BR7A
  317.       JMP    SETUPDN
  318. ;
  319. OK8N1:      MVI    A,0
  320.       STA    PARITYBITS
  321.       MVI    A,0C0H
  322.       STA    DATABITS
  323.       LDA    MSPEED
  324.       CPI    5
  325.       JZ    OK8N1H
  326.       MVI    A,BR4F
  327.       JMP    SETUPDN
  328. OK8N1H:      MVI    A,BR4E
  329. ;
  330. SETUPDN:  STA    INITMOD1+1
  331. SETUP7201:
  332.       MVI    A,4
  333.       OUT    013H
  334.       LDA    PARITYBITS
  335.       MOV    B,A
  336.       LDA    STOPBITS
  337.       ORA    B
  338.       MOV    B,A
  339.       MVI    A,040H
  340.       ORA    B
  341.       OUT    013H
  342.       MVI    A,3
  343.       OUT    013H
  344.       LDA    DATABITS
  345.       ORI    1
  346.       OUT    013H
  347.       MVI    A,5
  348.       OUT    013H
  349.       LDA    DATABITS
  350.       RRC
  351.       ORI    08AH
  352.       OUT    013H
  353.       JMP    OKBAUD
  354.  
  355. PARITYBITS:    DB    0
  356. STOPBITS:    DB    4
  357. DATABITS:    DB    0C0H
  358.  
  359.  
  360. OKBAUD:      CALL    JMP$ILPRT
  361.       DB    CR,LF,0
  362.       RET
  363. ;
  364. SETUPD:      LDA    INITMOD1+1
  365.       CPI    BR7A
  366.       JNZ    OK7B
  367.       CALL    JMP$ILPRT
  368.       DB    '1200 Baud - 7E1',0
  369.       RET
  370. OK7B:      CPI    BR7B
  371.       JNZ    OK4E
  372.       CALL    JMP$ILPRT
  373.       DB    '300 Baud - 7E1',0
  374.       RET
  375. OK4E:      CPI    BR4E
  376.       JNZ    OK4F
  377.       CALL    JMP$ILPRT
  378.       DB    '1200 Baud - 8N1',0
  379.       RET
  380. OK4F:      CALL    JMP$ILPRT
  381.       DB    '300 Baud - 8N1',0
  382.       RET
  383. ;
  384. ;
  385. ;           (END OF INITMOD AND SETUP ROUTINES)
  386. ;=======================================================================
  387. ;
  388. ; The following routine can be used as an auxiliary menu for notes of
  389. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  390. ; this is unavailable without a spcial address change.
  391. ;
  392. SPCLMENU: RET
  393. ;
  394. ;-----------------------------------------------------------------------
  395. ;
  396. ;
  397. ; NOTE:     MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  398. ;                 0C00H (without Smartmodem)
  399. ;
  400.       END
  401. ;
  402.  
  403.