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

  1.  
  2. ; M7H8-6.ASM -- Heath/Zenith H89 overlay file for MDM7xx.  01/24/85
  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 places particular emphasis on using the Heath/Zenith equip-
  7. ; ment with 8250 serial I/O.  Much of the information contained here is
  8. ; not in the main file.  If not using the Heath/Zenith H89/Z89 equipment
  9. ; some of the routines here will illustrate what you could do with your
  10. ; unit.
  11. ;
  12. ; Use the "SET" command to change baudrate when desired.
  13. ;
  14. ; Edit this file for your preferences then follow the "TO USE:" example
  15. ; shown below.
  16. ;
  17. ;
  18. ;    TO USE: First edit this file filling in answers for your own
  19. ;        equipment.  Then assemble with ASM.COM or equivalent
  20. ;        assembler.  Then use DDT to overlay the the results
  21. ;        of this program to the original .COM file:
  22. ;
  23. ;        A>DDT MDM740.COM
  24. ;        DDT VERS 2.2
  25. ;        NEXT  PC
  26. ;        4A00 0100
  27. ;        -IM7H8-6.HEX        (note the "I" command)
  28. ;        -R            ("R" loads in the .HEX file)
  29. ;        NEXT  PC
  30. ;        4A00 0000
  31. ;        -G0            (return to CP/M)
  32. ;        A>SAVE 73 MDM.COM    (now have a modified .COM file)
  33. ;
  34. ;        NOTE: If the MDM7nn file gets bigger the SAVE 73 will be
  35. ;        larger. Be sure to check the hex number under NEXT..
  36. ;
  37. ;-----------------------------------------------------------------------
  38. ;
  39. ;    Quick, easy alternate method of combining this overlay with
  40. ;    MDM740.COM file using MLOAD.COM (Current version is MLOAD24.)
  41. ;
  42. ;        A>MLOAD MDM7.COM=MDM740.COM,M7H8-n.HEX <ret>
  43. ;
  44. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  45. ;
  46. ; 02/12/85 - Set to default to 1200 bps, added SETSPD option.  Use the
  47. ;  M7H8-7    M7RV-6.ASM overlay for use with Racal-Vadic 1200v or 2400v
  48. ;         smartmodems after using this overlay first.  Other changes.
  49. ;                    - Irv Hoff
  50. ;
  51. ; 01/24/85 - Added support for Racal Vadic/Hayes 2400 baud smartmodems
  52. ;  M7H8-6                - Larry Snyder
  53. ;
  54. ; 07/15/84 - Added support for 2400 baud modems
  55. ;  M7H8-5                - Larry Snyder
  56. ;
  57. ; 03/16/84 - Added smartmodem EQU so IF/ENDIF statements would work
  58. ;  M7H8-4A   work corectly.        - Mike Allen
  59. ;
  60. ; 02/26/84 - Corrected to allow smartmodem YES without overrunning
  61. ;  M7H8-4    0400H in assembly.     - Bill Wood
  62. ;
  63. ; 02/15/84 - Made default baud-rate follow the MSPEED equate.
  64. ;  M7H8-3                - Rich Berg
  65. ;
  66. ; 12/11/83 - Restricted baud-rate selection for Hayes users.  Changed
  67. ;  M7H8-2    signon for Hayes, tells default modem speed at signon.
  68. ;                    - Tom Bering
  69. ;
  70. ; 10/03/82 - First version of this file    - Irv Hoff
  71. ;
  72. ;-----------------------------------------------------------------------
  73. ;
  74. ;
  75. ; Set the speed you wish the unit to automatically initialize at:
  76. ;
  77. SETSPD    EQU    5        ; 2=300, 5=1200, 6=2400 bps (select one)
  78. ;
  79. ;-----------------------------------------------------------------------
  80. ;
  81. ;
  82. NO    EQU    0
  83. YES    EQU    0FFH        ; (must be a 8-bit value for ASM.COM)
  84. ;
  85. ;
  86. BELL    EQU    07H        ; Bell
  87. CR    EQU    0DH        ; Carriage return
  88. ESC    EQU    1BH        ; Escape
  89. LF    EQU    0AH        ; Linefeed
  90. ;
  91. ;
  92. ; Change the value at MODDATP if it does not match what you are using.
  93. ;
  94. MODDATP    EQU    0D8H        ; Data port for H89
  95. MODCTL1    EQU    MODDATP+5    ; Status port for H89
  96. MODRCVB    EQU    1        ; Bit to test for received data
  97. MODRCVR    EQU    1        ; Modem receive ready
  98. MODSNDB    EQU    20H        ; Bit to test for ready to send
  99. MODSNDR    EQU    20H        ; Modem send ready bit
  100. ;
  101. ;-----------------------------------------------------------------------
  102. ;
  103. ;
  104.         ORG    100H
  105. ;
  106. ;
  107. ; Change the clock speed if needed, to match your system
  108. ;
  109.         DS    3    ;(for  "JMP   START" instruction)
  110. ;
  111. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 plug in modem        103H
  112. AUTODIAL:    DB    YES    ;yes=Hayes protocol, no=other        104H
  113. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  114. CLOCK:        DB    20    ;clock speed in MHz x .1, 25.5 MHz max. 106H
  115.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  116. MSPEED:        DB    SETSPD    ;set to desired default. 1=300 2=450    107H
  117.                 ;4=600 5=1200 6=2400 8=9600
  118. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  119.                 ;default time to send character in ter-
  120.                 ;minal mode file transfer for slow BBS.
  121. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  122.                 ;default time for extra wait after CRLF
  123.                 ;in terminal mode file transfer
  124. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  125. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  126. SCRNTEST:    DB    YES    ;cursor control routine         10CH
  127. RETRY:        DB    YES    ;reset the error limit to try again    10DH
  128.                 ;no abort after 10 consecutive errors
  129. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  130. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  131. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  132. CONVRUB:    DB    YES    ;yes=convert rub to backspace        111H
  133. TOGGLERUB:    DB    YES    ;yes=allow toggling rub to backspace    112H
  134. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  135.                 ;terminal mode (added by remote echo)
  136. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  137. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  138.                 ;write logon sequence at location LOGON
  139. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  140. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  141.                 ;no=external command if EXTCHR precedes
  142. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  143. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  144. XOFFTST:    DB    YES    ;yes=checks for XOFF from remote while    11AH
  145.                 ;sending a file in terminal mode
  146. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  147.                 ;sending a file in terminal mode
  148. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  149. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  150. EXTRA1:        DB    0    ;for future expansion            11EH
  151. EXTRA2:        DB    0    ;for future expansion            11FH
  152. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone     120H
  153. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  154. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  155. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  156. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  157. TRANCHR:    DB    'T'-40H    ;^T = Transmit file to remote        125H
  158. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  159. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  160. ;
  161. ;
  162.         DS    2        ;                128H
  163. ;
  164. IN$MODCTL1:    IN    MODCTL1    ! RET    ;in modem control port        12AH
  165.         DS    7
  166. OUT$MODDATP:    OUT    MODDATP    ! RET    ;out modem data port        134H
  167.         DS    7
  168. IN$MODDATP:    IN    MODDATP    ! RET    ;in modem data port        13EH
  169.         DS    7
  170. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  171. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  172. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  173. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  174.         DS    12        ;PMMI only calls        154H
  175. ;
  176. ;
  177. LOGONPTR:    DW    LOGON        ;for user message.        160H
  178.         DS    6        ;                162H
  179. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  180. JMP$INITMOD:    JMP    INIT        ;go to user written routine    16BH
  181.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  182.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  183.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  184. JMP$SETUPR:    JMP    SETUPR        ;                177H
  185. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  186. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  187. JMP$BREAK:    JMP    SENDBRK        ;                180H
  188. ;
  189. ;
  190. ; Do not change the following six lines.
  191. ;
  192. JMP$ILPRT:    DS    3        ;                183H
  193. JMP$INBUF:    DS    3        ;                186H
  194. JMP$INLNCOMP:    DS    3        ;                189H
  195. JMP$INMODEM:    DS    3        ;                18CH
  196. JMP$NXTSCRN:    DS    3        ;                18FH
  197. JMP$TIMER:    DS    3        ;                192H
  198. ;
  199. ;
  200. ; The following clear the screen for the H19 or H89 terminal
  201. ;
  202. CLREOS:    CALL    JMP$ILPRT        ;                195H
  203.     DB    ESC,'J',0,0,0        ;                198H
  204.     RET                ;                19DH
  205. ;
  206. CLRSCRN:CALL    JMP$ILPRT        ;                19EH
  207.     DB    ESC,'E',0,0,0        ;                1A1H
  208.     RET                ;                1A6H
  209. ;
  210. SYSVER:    CALL    JMP$ILPRT        ;                1A7H
  211.     DB    'Version for Heath H89 with serial modem'
  212.     DB    CR,LF,0
  213.     CALL    JMP$ILPRT
  214.     DB    'Default speed:  ',0
  215.     CALL    BAUD
  216.     CALL    JMP$ILPRT
  217.     DB    ' bps',CR,LF,0
  218.     RET
  219. ;.....
  220. ;
  221. ;
  222. ;-----------------------------------------------------------------------
  223. ;
  224. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  225. ;     end of your last routine should terminate by 0400H (601 bytes
  226. ;     available after start of SYSVER) if using the Hayes Smartmodem
  227. ;     or by address 0C00H (2659 bytes) otherwise.
  228. ;
  229. ;-----------------------------------------------------------------------
  230. ;
  231. ; You can put in a message at this location which can be called up with
  232. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  233. ; desired.  End with a 0.
  234. ;
  235. LOGON:    DB    'Hello from an Heath H89 user',CR,0
  236. ;.....
  237. ;
  238. ;
  239. ; This routine sends a 300 ms. break tone to reset some time-share
  240. ; computers.
  241. ;
  242. SENDBRK:
  243.     MVI    A,40H        ; Set break tone
  244.     OUT    MODDATP+3
  245.     JMP    GOODBYE1    ; Send a 300 ms. break tone
  246. ;.....
  247. ;
  248. ;
  249. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  250. ; length of time to disconnect some modems such as the Bell 212A, etc.
  251. ;
  252. GOODBYE:
  253.     XRA    A
  254.     OUT    MODDATP+4    ; Set DTR and RTS low
  255.     MVI    A,40H        ; Set break tone
  256.     OUT    MODDATP+3
  257. ;
  258. GOODBYE1:
  259.     MVI    B,3        ; Wait 300 ms.
  260.     CALL    JMP$TIMER
  261.     MVI    A,03H        ; Reset to normal 8 bits
  262.     OUT    MODDATP+3
  263.     MVI    A,01H
  264.     OUT    MODDATP+4    ; Reset DTR high
  265.     RET
  266. ;.....
  267. ;
  268. ;
  269. ; Auto-selects the default message baudrate from SELECT option at start
  270. ; of overlay.
  271. ;
  272. BAUD:    LDA    MSPEED
  273.     CPI    1
  274.     JNZ    BAUD5
  275.     CALL    JMP$ILPRT
  276.     DB    '300',0
  277.     RET
  278. ;
  279. BAUD5:    CPI    5
  280.     JNZ    BAUD6
  281.     CALL    JMP$ILPRT
  282.     DB    '1200',0
  283.     RET
  284. ;
  285. BAUD6:    CPI    6
  286.     JNZ    BAUD8
  287.     CALL    JMP$ILPRT
  288.     DB    '2400',0
  289.     RET
  290. ;
  291. BAUD8:    CALL    JMP$ILPRT
  292.     DB    '9600',0
  293.     RET
  294. ;
  295. ;
  296. ; Auto selects baud rate from SELECT option near start of overlay, which
  297. ; initializes the H89 8250 I/O port.
  298. ;
  299. INIT:    LDA    MSPEED
  300.     CPI    1
  301.     JZ    OK300
  302.     CPI    5
  303.     JZ    OK1200
  304.     CPI    6
  305.     JZ    OK2400
  306.     CPI    8
  307.     JZ    OK9600
  308. ;
  309. INITMOD:MVI    A,5        ; Default transfer speed to 1200 baud
  310.     STA    MSPEED
  311.     DI            ; Turn off interrupts for initialization
  312.     XRA    A
  313.     OUT    MODDATP+1    ; Interrupt enable register
  314.     MVI    A,80H        ; Insure out of mode to set baud rate
  315.     OUT    MODDATP+3    ; Line control register
  316.     OUT    MODDATP+3
  317. ;
  318. LSPSPD:    MVI    A,60H        ; Default 'LSP' speed for 1200 baud
  319.     OUT    MODDATP        ; Register for 'LSP' speed if enabled
  320. ;
  321. MSPSPD:    MVI    A,00H        ; Default 'MSP' speed for 1200 baud
  322.     OUT    MODDATP+1    ; Register for 'MSP' speed if enabled
  323. ;
  324.     MVI    A,03H        ; 8-level, 1 stop bit, no parity
  325.     OUT    MODDATP+3    ; Line control register
  326.     MVI    A,01H        ; Set 'DTR' nromal
  327.     OUT    MODDATP+4    ; Modem control register
  328.     EI            ; Restore interrupts to normal
  329.     RET
  330. ;.....
  331. ;
  332. ;
  333. ; The following routine changes the baud rate for the H89 with the SET
  334. ; command.
  335. ;
  336. SETUPR:    CALL    JMP$ILPRT
  337.     DB    'Select Baud Rate (300, 1200, 2400, 9600) : ',0
  338.     LXI    D,BAUDBUF    ; Point to input buffer for INLNCOMP
  339.     CALL    JMP$INBUF
  340.     LXI    D,BAUDBUF+2    ; Compare BAUDBUF+2 with/chars. below
  341.     CALL    JMP$INLNCOMP
  342.     DB    '1200',0
  343.     JNC    OK1200
  344.     CALL    JMP$INLNCOMP
  345.     DB    '2400',0
  346.     JNC    OK2400
  347.     CALL    JMP$INLNCOMP
  348.     DB    '9600',0
  349.     JNC    OK9600
  350.     CALL    JMP$ILPRT    ; All matches failed, tell operator
  351.     DB    '++ Incorrect entry ++',CR,LF,BELL,0
  352.     JMP    SETUPR        ; None of these, ask again
  353. ;
  354. OK300:    MVI    A,1        ; MSPEED 300 baud value
  355.     LHLD    BD300        ; Get 300 baud parameters in HL
  356.     JMP    LOADBD        ; Go load them
  357. ;
  358. OK1200:    MVI    A,5
  359.     LHLD    BD1200
  360.     JMP    LOADBD
  361. ;
  362. OK2400:    MVI    A,6
  363.     LHLD    BD2400
  364.     JMP    LOADBD
  365. ;
  366. OK9600:    MVI    A,8
  367.     LHLD    BD9600
  368. ;
  369. LOADBD:    STA    INITMOD+1    ; Store speed to show transfer time
  370.     MOV    A,L        ; Get least significant baud rate byte
  371.     STA    LSPSPD+1    ; Store in INITMOD
  372.     MOV    A,H        ; Get most signifcant baud rate byte
  373.     STA    MSPSPD+1    ; Store in INITMOD
  374.     JMP    INITMOD        ; Reset H89 8250 for new speed
  375. ;.....
  376. ;
  377. ;
  378. ; Table of baud rate parameters
  379. ;
  380. BD300:    DW    0180H
  381. BD1200:    DW    0060H
  382. BD2400:    DW    0030H
  383. BD9600:    DW    000CH
  384. ;
  385. BAUDBUF:DB    10,0
  386.     DS    10
  387. ;
  388. ;-----------------------------------------------------------------------
  389. ;
  390. ; This routine can be used for your equipment, be sure to end with RET.
  391. ; If using the Hayes Smartmodem this is unavailable without a special
  392. ; change.
  393. ;
  394. SPCLMENU: RET
  395. ;
  396. ;-----------------------------------------------------------------------
  397. ;
  398. ;
  399. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  400. ;                 0D00H (without Smartmodem)
  401. ;
  402.     END
  403.