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

  1. ; M7EG-1.ASM -- EAGLE IIE overlay file for MDM7xx.  
  2. ;
  3. ; Modified from the general purpose overlay by Jerry Haigwood, KY4Z
  4. ;
  5. ; This overlay adapts the MDM7xx program to the EAGLE IIE-2 series
  6. ; computer, using the Z80 SIO and Z80 CTC.
  7. ;
  8. ; You will want to look this file over carefully. There are a number of
  9. ; options that you can use to configure the program to suit your taste.
  10. ; This file places particular emphasis on using the EAGLE IIE series
  11. ; computer with the Z80 SIO serial port "B" and the Z80 CTC baud rate
  12. ; generator.  If you are not using this equipment then you might still
  13. ; want to look over this file to gain knowledge on how to write your
  14. ; own version of this overlay.  Some other overlays which might help
  15. ; are:
  16. ;
  17. ;     "H8"  Heath H89 overlay for 8250 I/O and programmable baud rates
  18. ;     "HZ"  Zenith 120 overlay for 2661B initialization and baud rates
  19. ;     "XE"  Xerox 820II overlay for Z80-SIO intialization, etc.
  20. ;
  21. ; Edit this file for your preferences then follow the "TO USE:" example
  22. ; shown below.
  23. ;
  24. ;    TO USE: First edit this file filling in answers for your own
  25. ;        equipment.  Then assemble with ASM.COM or equivalent
  26. ;        assembler.  Then use DDT to overlay the the results
  27. ;        of this program to the original .COM file:
  28. ;
  29. ;        A>DDT MDM7XX.COM    (substitute the correct version
  30. ;        DDT VERS 2.2         number for "X")
  31. ;        NEXT  PC
  32. ;        4600 0100
  33. ;        -IM7EG-1.HEX        (note the "I" command)
  34. ;        -R            ("R" loads in the .HEX file)
  35. ;        NEXT  PC
  36. ;        4600 0000
  37. ;        -G0            (return to CP/M)
  38. ;        A>SAVE 69 MDM7XX.COM    (now have a modified .COM file)
  39. ;
  40. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  41. ;
  42. ;02/14/84 - First version of this file        - Jerry Haigwood
  43. ;
  44. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  45. ;
  46. BELL:        EQU    07H        ;bell
  47. CR:        EQU    0DH        ;carriage return
  48. ESC:        EQU    1BH        ;escape
  49. LF:        EQU    0AH        ;linefeed
  50. ;
  51. YES:        EQU    0FFH
  52. NO:        EQU    0
  53. ;
  54. ;
  55. ; Change the following information to match your equipment
  56. ;
  57. PORT:        EQU    1BH        ;SIO port B
  58. MODCTL1        EQU    PORT        ;MODEM CONTROL PORT
  59. MODDATP:    EQU    PORT-1        ;MODEM DATA IN PORT
  60. MODRCVB:    EQU    1        ;BIT TO TEST FOR RECEIVE
  61. MODRCVR:    EQU    1        ;VALUE WHEN READY
  62. MODSNDB:    EQU    4        ;BIT TO TEST FOR SEND
  63. MODSNDR:    EQU    4        ;VALUE WHEN READY
  64. CTC:        EQU    02H        ;CTC addr
  65. ;
  66.         ORG    100H
  67. ;
  68. ;
  69. ; Change the clock speed if needed, to match your system
  70. ;
  71.         DS    3    ;(for  "JMP   START" instruction)
  72. ;
  73. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  74. SMARTMODEM:    DB    YES    ;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    NO    ;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    YES    ;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=checks 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 300 ms. break tone        120H
  115. NOCONNCT:    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:    IN    MODCTL1 ! RET    ;in modem control port             12AH
  127.         DS    7
  128. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  129.         DS    7
  130. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  131.         DS    7
  132. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  133. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  134. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  135. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  136.         DS    12        ;                156H
  137. ;
  138. ;
  139. LOGONPTR:    DW    LOGON        ;for user message.        160H
  140.         DS    6        ;                162H
  141. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  142. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  143.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    16EH
  144.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    171H
  145.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    174H
  146. JMP$SETUPR:    JMP    SETUPR        ;                177H
  147. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  148. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  149. JMP$BREAK:    JMP    SENDBRK        ;                180H
  150. ;
  151. ;
  152. ; Do not change the following six lines.
  153. ;
  154. JMP$ILPRT:    DS    3        ;                183H
  155. JMP$INBUF    DS    3        ;                186H
  156. JMP$INLNCOMP:    DS    3        ;                189H
  157. JMP$INMODEM    DS    3        ;                18CH
  158. JMP$NXTSCRN:    DS    3        ;                18FH
  159. JMP$TIMER    DS    3        ;                192H
  160. ;
  161. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  162. ; SCRNTEST to YES at 010AH (above).
  163. ;
  164. CLREOS:        CALL    JMP$ILPRT    ;                195H
  165.         DB    0,0,0,0,0    ;                198H
  166.         RET            ;                19DH
  167. ;
  168. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  169.         DB    0,0,0,0,0    ;                1A1H
  170.         RET            ;                1A6H
  171.     
  172. ;
  173. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  174.         DB    'Version for EAGLE IIE Computer'
  175.         DB    CR,LF,'Initial baud rate set for 300',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 0400H (601 bytes
  184. ;     available after start of SYSVER) if using the Hayes Smartmodem
  185. ;     or by address 0C00H (2659 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 TRUE.  You can use several lines if
  191. ; desired.  End with a 0.
  192. ;
  193. LOGON:        DB    'This is an EAGLE IIE computer',CR,LF,0
  194. ;.....
  195. ;
  196. ;
  197. ; Add your own routine here to send a break tone to reset some time-share
  198. ; computers, if desired.
  199. ;
  200. SENDBRK:    RET
  201. ;.....
  202. ;
  203. ;
  204. ; Add your own routine here to put DTR low and/or send a break tone.
  205. ; Check other routines such as MDM709DP.ASM which is using this feature.
  206. ;
  207. GOODBYE:    RET
  208. ;.....
  209. ;
  210. ;
  211. ; The following is used to initialize the Z80 SIO port "B".
  212. ; Baud rate is initially set to 300.
  213. ;
  214. INITMOD:DI            ;no interupts during setup
  215.     MVI    A,1        ;default transfer speed to 300 baud
  216.     STA    MSPEED
  217.     MVI    A,04H        ;write register 4 of DART 
  218.     OUT    PORT        ;contol port
  219.     MVI    A,84H        ;x32, 1 stop bit, no parity
  220.     OUT    PORT
  221.     MVI    A,03H        ;write register 3 of DART
  222.     OUT     PORT
  223.     MVI    A,0C1H        ;rcv 8 bits/char, rcv enable
  224.     OUT    PORT
  225.     MVI    A,05H        ;write register 5 of DART
  226.     OUT    PORT
  227.     MVI    A,6AH        ;tx 8 bits/char, tx enable, rts enable
  228.     OUT    PORT
  229.     MVI    A,45H        ;counter mode, control word time
  230.     OUT    CTC        ;  constant follows
  231.     MVI    A,208        ;x208
  232.     OUT    CTC
  233.     EI
  234.     RET
  235. ;.....
  236. ;
  237. ;
  238. SETUPR:    LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  239.     CALL    JMP$ILPRT
  240.     DB    'Input Baud Rate (300, 450, 600, 1200, 9600): ',0
  241.     CALL    JMP$INBUF
  242.     LXI    D,BAUDBUF+2
  243.     CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  244.     DB    '300',0
  245.     JNC    B300        ;jump if good match
  246.     CALL     JMP$INLNCOMP
  247.     DB    '450',0
  248.     JNC    B450
  249.     CALL     JMP$INLNCOMP
  250.     DB    '600',0
  251.     JNC    B600
  252.     CALL     JMP$INLNCOMP
  253.     DB    '1200',0
  254.     JNC    B1200
  255.     CALL     JMP$INLNCOMP
  256.     DB    '9600',0
  257.     JNC    B9600
  258.     CALL    JMP$ILPRT    ;no matches, tell operator
  259.     DB    LF,'++ Incorrect entry ++',CR,LF,LF,BELL,0
  260.     JMP    SETUPR        ;try it again
  261. ;
  262. B300:    MVI    A,1        ;MSPEED 300 baud value
  263.     STA    MSPEED
  264.     CALL    DART        ;set up DART
  265.     MVI    A,208        ;x208
  266.     OUT    CTC
  267.     RET
  268. ;.....
  269. ;
  270. ;
  271. B450:    MVI    A,2        ;MSPEED 450 baud value
  272.     STA    MSPEED
  273.     CALL    DART        ;set up DART
  274.     MVI    A,156        ;x156
  275.     OUT    CTC
  276.     RET
  277. ;.....
  278. ;
  279. ;
  280. B600:    MVI    A,3        ;MSPEED 600 baud value
  281.     STA    MSPEED
  282.     CALL    DART        ;set up DART
  283.     MVI    A,104        ;x104
  284.     OUT    CTC
  285.     RET
  286. ;.....
  287. ;
  288. ;
  289. B1200:    MVI    A,5        ;MSPEED 1200 baud value
  290.     STA    MSPEED
  291.     CALL    DART        ;set up DART
  292.     MVI    A,52        ;x52
  293.     OUT    CTC
  294.     RET
  295. ;.....
  296. ;
  297. ;
  298. B9600:    MVI    A,8        ;MSPEED 9600 baud value
  299.     STA    MSPEED
  300.     MVI    A,04H        ;write register 4
  301.     OUT    PORT        ;control port DART
  302.     MVI    A,44H        ;x16, 1 stop bit, no parity
  303.     OUT    PORT
  304.     MVI    A,45H        ;counter mode time constant follows
  305.     OUT    CTC        ;  control word
  306.     MVI    A,13        ;x13
  307.     OUT    CTC
  308.     RET
  309. ;.....
  310. ;
  311. ;
  312. DART:    MVI    A,04H        ;write register 4 DART
  313.     OUT    PORT        ;control port
  314.     MVI    A,84H        ;x32, 1 stop bit, no parity
  315.     OUT    PORT
  316.     MVI    A,45H        ;time constant follows
  317.     OUT    CTC        ;  control word
  318.     RET
  319. ;.....
  320. ;
  321. ;
  322. BAUDBUF:DB    10,0
  323.     DS    10    
  324. ;
  325. ;
  326. ; If using the Hayes Smartmodem this is unavailable without a special
  327. ; change.
  328. ;
  329. SPCLMENU:
  330.     RET
  331. ;
  332. ;
  333. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  334. ;                 0C00H (without Smartmodem)
  335. ;.....
  336. ;
  337.     END
  338. ;
  339.