home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols100 / vol169 / m7ep-1.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  10.1 KB  |  344 lines

  1.  
  2. ; M7EP-1.ASM -- Epson QX-10 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 QX-10 computer to the modem program.  Much of
  7. ; the information contained here is not in the MDM7xx.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. ;        -IM7EP-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 M7EP-1.ASM, no changes    - Irv Hoff
  34. ; 08/27/83 - Revised to work with MDM712    - Irv Hoff
  35. ; 07/25/83 - Changed M710XE.ASM forEpson QX-10    - Phil Becker
  36. ;
  37. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  38. ;
  39. BELL:        EQU    07H        ;bell
  40. CR:        EQU    0DH        ;carriage return
  41. ESC:        EQU    1BH        ;escape
  42. LF:        EQU    0AH        ;linefeed
  43. ;
  44. YES:        EQU    0FFH
  45. NO:        EQU    0
  46. ;
  47. ;
  48. PORT:        EQU    11H        ;Epson QX-10 serial output port
  49. MODCTL1:    EQU    PORT+2        ;Modem control port
  50. MODDATP:    EQU    PORT        ;Modem data port
  51. MODCTL2:    EQU    PORT+2        ;Modem control port
  52. MODRCVB:    EQU    01H        ;Your bit to test for receive
  53. MODRCVR:    EQU    01H        ;Your value when receive ready
  54. MODSNDB:    EQU    04H        ;Your bit to test for send
  55. MODSNDR:    EQU    04H        ;Your value when send ready        
  56. ;
  57. ;
  58.         ORG    100H
  59. ;
  60. ;
  61. ; Change the clock speed as needed for your system.
  62. ;
  63.         DS    3    ;(for  "JMP   START" instruction)
  64. ;
  65. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  66. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  67. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  68. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  69.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  70. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  71.                 ;6=2400 7=4800 8=9600 9=19200 default
  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    ;Cursor control 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    NO    ;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    YES    ;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=allow toggling of printer on/off    119H
  98. XOFFTST:    DB    YES    ;yes=chcks 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. NOCXNNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  108. LOGCHR:        DB    'L'-40H    ;^O = 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. ;
  116.         DS    2        ;                128H
  117. ;
  118. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts.    12AH
  119.         OUT    MODCTL1
  120.         IN    MODCTL1        ;get the status bits
  121.         RET
  122.         DS    3
  123. ;
  124. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  125.         DS    7
  126. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  127.         DS    7
  128. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  129. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  130. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  131. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  132.         DS    6
  133. ;
  134. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port        15AH
  135. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  136. ;
  137. ;
  138. LOGONPTR:    DW    LOGON        ;for user message.        160H
  139.         DS    6        ;                162H
  140. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  141. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  142.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    66EH
  143.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  144.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  145. JMP$SETUPR:    JMP    SETUPR        ;                177H
  146. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  147. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  148. JMP$BREAK:    JMP    SENDBRK        ;                180H
  149. ;
  150. ;
  151. ; Do not change the following six lines.
  152. ;
  153. JMP$ILPRT:    DS    3        ;                183H
  154. JMP$INBUF    DS    3        ;                186H
  155. JMP$INLNCOMP:    DS    3        ;                189H
  156. JMP$INMODEM    DS    3        ;                18CH
  157. JMP$NXTSCRN:    DS    3        ;                18FH
  158. JMP$TIMER:    DS    3        ;                192H
  159. ;
  160. ;
  161. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  162. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  163. ;
  164. CLREOS:        CALL    JMP$ILPRT    ;                195H
  165.         DB    017H,0,0,0,0    ;                198H
  166.         RET            ;                19DH
  167. ;
  168. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  169.         DB    01AH,0,0,0,0    ;                1A1H
  170.         RET            ;                1A6H
  171. ;
  172. ;
  173. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  174.         DB    'Version for Epson QX-10 Modem Port 11H'
  175.         DB    CR,LF,0
  176.         RET
  177. ;.....
  178. ;
  179. ;
  180. ;-----------------------------------------------------------------------
  181. ;
  182. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  183. ;     end of your last routine should terminate by 0380H (473 bytes
  184. ;     available after start of SYSVER) if using the Hayes Smartmodem
  185. ;     or by address 0B80H (2521 bytes) otherwise.
  186. ;
  187. ;-----------------------------------------------------------------------
  188. ;
  189. ; You can put in a message at this location which can be called up with
  190. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  191. ; desired.  End with a 0.
  192. ;
  193. LOGON:      DB    'Hello from an Epson QX-10 user.',CR,LF,0
  194. ;.....
  195. ;
  196. ;
  197. ; This routine allows a 300 ms. break tone to be sent to reset some
  198. ; time-share computers.
  199. ;
  200. SENDBRK:  MVI    A,5
  201.       OUT    MODCTL1
  202.       MVI    A,0F8H        ;SEND A BREAK TONE        
  203.       JMP    GOODBYE1
  204. ;.....
  205. ;
  206. ;
  207. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  208. ; length of time to disconnect some modems such as the Bell 212A, etc.
  209. ;
  210. GOODBYE:  MVI    A,5
  211.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  212.       MVI    A,68H        ;TURN OFF DTR, SEND BREAK
  213. ;
  214. GOODBYE1: OUT    MODCTL1
  215.       MVI    B,3        ;DELAY 300 MS.
  216.       CALL    JMP$TIMER
  217.       MVI    A,5
  218.       OUT    MODCTL1
  219.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  220.       OUT    MODCTL1
  221.       RET
  222. ;.....
  223. ;
  224. ;
  225. ; Epson QX-10 initialization -- sets CTC timer 00H for send and receive
  226. ; baudrate.
  227. ;
  228. ;
  229. INITMOD:  MVI    A,00H        ;SELECT REG.
  230.       OUT    MODCTL1
  231.       MVI    A,18H        ;THROW OUT OF MODE
  232.       OUT    MODCTL1
  233.       MVI    A,04H        ;SELECT REG.
  234.       OUT    MODCTL1
  235.       MVI    A,44H        ;SET ASCII PARAMETERS
  236.       OUT    MODCTL1
  237.       MVI    A,03H        ;SELECT REG.
  238.       OUT    MODCTL1
  239.       MVI    A,0C1H        ;ENABLE RECEIVE
  240.       OUT    MODCTL1
  241.       MVI    A,05H        ;SELECT REG.
  242.       OUT    MODCTL1
  243.       MVI    A,0EAH        ;ENABLE SEND, DTR, RTS
  244.       OUT    MODCTL1
  245. ;
  246. INITMOD1: MVI    A,1        ;SET FILE TRANSFER TIME
  247.       STA    MSPEED
  248.       MVI    A,0B6H
  249.       OUT    07H        ;SEND TO 'CTC' TIMER
  250.  
  251. INITMOD2: MVI    A,0A0H        ;DEFAULT TO 300 BAUD, LSP PORTION
  252.       OUT    06H        ;SEND TO 'CTC' TIMER
  253. ;
  254. INITMOD3: MVI    A,01H        ;300 BAUD, MSP PORTION
  255.       OUT    06H        ;TO TIMER
  256.       RET
  257. ;.....
  258. ;
  259. ;
  260. ; Sets the modem speed via the SET command.
  261. ;
  262. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  263.       CALL    JMP$ILPRT
  264.       DB    'Input Baud Rate (300, 1200, 2400, 4800, 9600): ',0
  265.       CALL    JMP$INBUF
  266.       LXI    D,BAUDBUF+2
  267.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  268.       DB    '300',0
  269.       JNC    OK300        ;GO IF GOT MATCH
  270.       CALL    JMP$INLNCOMP
  271.       DB    '1200',0
  272.       JNC    OK1200
  273.       CALL    JMP$INLNCOMP
  274.       DB    '2400',0
  275.       JNC    OK2400
  276.       CALL    JMP$INLNCOMP
  277.       DB    '4800',0
  278.       JNC    OK4800
  279.       CALL    JMP$INLNCOMP
  280.       DB    '9600',0
  281.       JNC    OK9600
  282.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  283.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  284.       JMP    SETUPR        ;TRY AGAIN
  285. ;
  286. OK300:      MVI    A,1
  287.       LHLD    BD300
  288.       JMP    LOADBD
  289. ;
  290. OK1200:      MVI    A,5
  291.       LHLD    BD1200
  292.       JMP    LOADBD
  293. ;
  294. OK2400:      MVI    A,6
  295.       LHLD    BD2400
  296.       JMP    LOADBD
  297. ;
  298. OK4800:      MVI    A,7
  299.       LHLD    BD4800
  300.       JMP    LOADBD
  301. ;
  302. OK9600:      MVI    A,8
  303.       LHLD    BD9600
  304. ;
  305. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  306.       MOV    A,L        ;GET BAUDRATE BYTE
  307.       STA    INITMOD2+1    ;SEND TO 'CTC' FOR NEW BAUDRATE
  308.       MOV    A,H        ;2ND 1/2 OF BAUDRATE
  309.       STA    INITMOD3+1
  310.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  311. ;
  312. ;
  313. ; TABLE OF BAUDRATE PARAMETERS
  314. ;
  315. BD300:      DW    01A0H
  316. BD1200:      DW    0068H
  317. BD2400:      DW    0034H
  318. BD4800:      DW    001AH
  319. BD9600:      DW    000DH
  320. ;
  321. BAUDBUF:  DB    10,0
  322.       DS    10
  323. ;
  324. ;-----------------------------------------------------------------------
  325. ;
  326. ; The following routine can be used as an auxiliary menu for notes of
  327. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  328. ; this is unavailable without a spcial address change.
  329. ;
  330. SPCLMENU: RET
  331. ;
  332. ;-----------------------------------------------------------------------
  333. ;
  334. ;
  335. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  336. ;                 0C00H (without Smartmodem)
  337. ;
  338.       END
  339. ;
  340.  
  341. LOADBD
  342. ;
  343. OK4800:      MVI    A,7
  344.