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-2-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  12KB  |  347 lines

  1.  
  2. ; M7H8-2-1.ASM -- Heath/Zenith H8/H89 overlay file for MDM7xx.COM
  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 2651/2661 PCI serial I/O. Much of the information contained
  8. ; here is not in the main file.   If not using the Heath  H8,  H89 with
  9. ; 2651, or 2661 PCI I/O, but with the 8250 serial I/O, then use M7H8-1.
  10. ; ASM overlay.   If not using Heath/Zenith equipment,  some of the rou-
  11. ; tines here will illustrate what you could do with your equipment.
  12. ;
  13. ;
  14. ; Use the "SET" command to change baudrate when desired.
  15. ;
  16. ; Edit this file for your preferences then follow the "TO USE:" example
  17. ; shown below.
  18. ;
  19. ;
  20. ;    TO USE: First edit this file filling in answers for your own
  21. ;        equipment.  Then assemble with ASM.COM or equivalent
  22. ;        assembler.  Then use DDT to overlay the the results
  23. ;        of this program to the original .COM file:
  24. ;
  25. ;        A>DDT MDM7xx.COM
  26. ;        DDT VERS 2.2
  27. ;        NEXT  PC
  28. ;        4A00 0100
  29. ;        -IM7H8-2-1.HEX        (note the "I" command)
  30. ;        -R            ("R" loads in the .HEX file)
  31. ;        NEXT  PC
  32. ;        4A00 0000
  33. ;        -G0            (return to CP/M)
  34. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  35. ;
  36. ;    NOTE!:  Be sure to check the NEXT address above with what you get
  37. ;        when you load MDM7xx.COM with DDT.   If the two addresses
  38. ;        differ, you need to adjust the number of  'PAGES' to SAVE
  39. ;        by the amount of the differance.   If the address you get
  40. ;        is larger, then add the differance to the number of pages
  41. ;        to SAVE.  If it is smaller, then subtract the differance.
  42. ;
  43. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  44. ;
  45. ; 13-MAY-86  - Revised to work with H8 / H89  2651/2661 PCI USART   - WEA
  46. ; 06-APR-86  - Updated to work with H8 2651 I/O. Renamed M7H8-2.ASM - WEA
  47. ; 11/11/83 - Renamed to M7H8-1.ASM, no changes    - Irv Hoff
  48. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  49. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  50. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  51. ; 05/27/83 - Revised to work with MDM709    - Irv Hoff
  52. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  53. ; 04/17/83 - Revised to work with MDM707    - Irv Hoff
  54. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  55. ; 02/27/83 - Updated to work with MDM705    - Irv Hoff
  56. ; 02/17/83 - Updated to work with MDM704    - Irv Hoff
  57. ; 02/07/83 - Updated to work with MDM703    - Irv Hoff
  58. ; 01/27/83 - Updated to work with MDM702    - Irv Hoff
  59. ; 01/10/83 - Updated to work with MDM701    - Irv Hoff
  60. ; 10/03/82 - First version of this file
  61. ;
  62. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  63. ;
  64. BELL:        EQU    07H        ;bell
  65. CR:        EQU    0DH        ;carriage return
  66. ESC:        EQU    1BH        ;escape
  67. LF:        EQU    0AH        ;linefeed
  68. ;
  69. YES:        EQU    0FFH
  70. NO:        EQU    0
  71. ;
  72. ;
  73. ; Change the value at MODDATP if it does not match what you are using.
  74. ;
  75. MODDATP:    EQU    340Q        ;data port for H8 2651 PCI
  76. MODCTL1:    EQU    MODDATP+1    ;status port for H8 2651/2661 PCI
  77. MODRCVB:    EQU    2H        ;bit to test for Receiver Ready
  78. MODRCVR:    EQU    2H        ;Receive Holding Reg. Has DATA
  79. MODSNDB:    EQU    1H        ;Bit to Test for Transmiter Ready.
  80. MODSNDR:    EQU    1H        ;TxRDY bit TRUE
  81. MODEREG:    EQU    MODDATP+2    ;2651 Mode Regs. 1&2 Port Address
  82. CMDREG:        EQU    MODDATP+3    ;2651 Command Reg. Port Address
  83. ;
  84. ;
  85.         ORG    100H
  86. ;
  87. ; Change the clock speed if needed, to match your system
  88. ;
  89.         DS    3    ;(for  "JMP   START" instruction)
  90. ;
  91. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  92. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  93. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  94. CLOCK:        DB    20    ;clock speed in MHz x10, 25.5 MHz max.    106H
  95.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  96. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  97.                 ;6=2400 7=4800 8=9600 9=19200 default
  98. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  99.                 ;default time to send character in ter-
  100.                 ;minal mode file transfer for slow BBS.
  101. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  102.                 ;default time for extra wait after CRLF
  103.                 ;in terminal mode file transfer
  104. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  105. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  106. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  107. ACKNAK:        DB    NO    ;yes=resend a record after any non-ACK    10DH
  108.                 ;no=resend a record after a valid NAK
  109. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  110. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  111. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  112. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  113. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  114. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  115.                 ;terminal mode (added by remote echo)
  116. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  117. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  118.                 ;write logon sequence at location LOGON
  119. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  120. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  121.                 ;no=external command if EXTCHR precedes
  122. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  123. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  124. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  125.                 ;sending a file in terminal mode
  126. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  127.                 ;sending a file in terminal mode
  128. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  129. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  130. EXTRA1:        DB    0    ;for future expansion            11EH
  131. EXTRA2:        DB    0    ;for future expansion            11FH
  132. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  133. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  134. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  135. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  136. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  137. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  138. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  139. EXTCHR:        DB    'K'-40H    ;^K = Send next character        127H
  140. ;
  141. ;
  142.         DS    2        ;                128H
  143. ;
  144. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  145.         DS    7
  146. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  147.         DS    7
  148. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  149.         DS    7
  150. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    148H
  151. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  152. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    14EH
  153. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  154.         DS    12        ;PMMI only calls        154H
  155. ;
  156. ;
  157. LOGONPTR:    DW    LOGON        ;for user message.        160H
  158.         DS    6        ;                162H
  159. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  160. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  161.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  162.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  163.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  164. JMP$SETUPR:    JMP    SETUPR        ;                177H
  165. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  166. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  167. JMP$BREAK:    JMP    SENDBRK        ;                180H
  168. ;
  169. ;
  170. ; Do not change the following six lines.
  171. ;
  172. JMP$ILPRT:    DS    3        ;                183H
  173. JMP$INBUF:    DS    3        ;                186H
  174. JMP$INLNCOMP:    DS    3        ;                189H
  175. JMP$INMODEM:    DS    3        ;                18CH
  176. JMP$NXTSCRN:    DS    3        ;                18FH
  177. JMP$TIMER:    DS    3        ;                192H
  178. ;
  179. ;
  180. ; The following clear the screen for the H19 or H89 terminal
  181. ;
  182. CLREOS:        CALL    JMP$ILPRT    ;                195H
  183.         DB    ESC,'J',0,0,0    ;                198H
  184.         RET            ;                19DH
  185. ;
  186. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  187.         DB    ESC,'E',0,0,0    ;                1A1H
  188.         RET            ;                1A6H
  189. ;
  190. ;
  191. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  192.         DB    'Version for Heath H8/H89 with 2651/2661'
  193.         DB    CR,LF,'PCI - USART I/O - Rel 2.1'
  194.         DB    CR,LF,0
  195.         RET
  196. ;.....
  197. ;
  198. ;
  199. ;-----------------------------------------------------------------------
  200. ;
  201. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  202. ;     end of your last routine should terminate by 0400H (601 bytes
  203. ;     available after start of SYSVER) if using the Hayes Smartmodem
  204. ;     or by address 0C00H (2659 bytes) otherwise.
  205. ;
  206. ;-----------------------------------------------------------------------
  207. ;
  208. ; You can put in a message at this location which can be called up with
  209. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  210. ; desired.  End with a 0.
  211. ;
  212. LOGON:      DB    '70225,1220',CR,LF,0
  213. ;
  214. ;
  215. ; This routine sends a 300 ms. break tone to reset some time-share
  216. ; computers.
  217. ;
  218. SENDBRK:  MVI    A,2FH        ;SET BREAK TONE
  219.       OUT    CMDREG
  220.       JMP    GOODBYE1    ;SEND A 300 MS. BREAK TONE
  221. ;.....
  222. ;
  223. ;
  224. ; This routine sends a 300 ms. break tone and set DTR low for the same
  225. ; length of time to disconnect some modems such as the Bell 212A, etc.
  226. ;
  227. GOODBYE:  MVI    A,0DH        ;SET BREAK TONE, AND
  228.       OUT    CMDREG        ;RESET 'DTR' AND 'RTS' NOT TRUE
  229. ;
  230. GOODBYE1: MVI    B,3        ;WAIT 300 MS.
  231.       CALL    JMP$TIMER
  232.       MVI    A,27H        ;RESET BREAK TO NORMAL, AND
  233.       OUT    CMDREG        ;SET 'DTR', AND 'RTS' TRUE
  234.       RET
  235. ;.....
  236. ;
  237. ;
  238. ; The following is used to initialize the H8 2651/2661 MODEM I/O port
  239. ; at 340Q.
  240. ;
  241. INITMOD:  MVI    A,1        ;default transfer speed to 300 baud
  242.       STA    MSPEED
  243.       DI            ;turn off interrupts for init.
  244.       MVI    A,4EH        ;16x Baud Rate Factor, 8 Data Bits,
  245.                 ;No Parity, 1 Stop Bit.
  246.       OUT    MODEREG        ;Set up Mode Reg. 1.
  247. LSPSPD:      MVI    A,35H        ;default to 300 baud, Internal clocks.
  248.       OUT    MODEREG        ;Set up Mode Reg. 2.
  249. ;
  250.       MVI    A,27H        ;Set 'DTR', 'RTS', RxEN, and TxEN True.
  251.       OUT    CMDREG        ;Set up Modem Port Command Register.
  252.       EI            ;restore interrupts to normal
  253.       RET
  254. ;.....
  255. ;
  256. ;
  257. ; The following routine changes the baud rate for the H8 with the SET
  258. ; command.
  259. ;
  260. SETUPR:      LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  261.       CALL    JMP$ILPRT
  262.       DB    'Input Baud Rate (300, 600, 1200, 2400, 4800, 9600): ',0
  263.       CALL    JMP$INBUF
  264.       LXI    D,BAUDBUF+2
  265.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  266.       DB    '300',0
  267.       JNC    OK300        ;go if got match
  268.       CALL    JMP$INLNCOMP
  269.       DB    '600',0
  270.       JNC    OK600
  271.       CALL    JMP$INLNCOMP
  272.       DB    '1200',0
  273.       JNC    OK1200
  274.       CALL    JMP$INLNCOMP
  275.       DB    '2400',0
  276.       JNC    OK2400
  277.       CALL    JMP$INLNCOMP
  278.       DB    '4800',0
  279.       JNC    OK4800
  280.       CALL    JMP$INLNCOMP
  281.       DB    '9600',0
  282.       JNC    OK9600
  283.       CALL    JMP$ILPRT    ;NO MATCH - tell operator
  284.       DB    '++ INCORRECT ENTRY ++',CR,LF,BELL,0
  285.       JMP    SETUPR        ;try again
  286. ;
  287. OK300:      MVI    A,1        ;MSPEED Baud Rate Value
  288.       LXI    H,BD300        ;Point to Baud Rate Parameter's Table Add.
  289.       JMP    LOADBD        ;Go Store It.
  290. ;
  291. OK600:      MVI    A,3
  292.       LXI    H,BD600
  293.       JMP    LOADBD
  294. ;
  295. OK1200:      MVI    A,5
  296.       LXI    H,BD1200
  297.       JMP    LOADBD
  298. ;
  299. OK2400:      MVI    A,6
  300.       LXI    H,BD2400
  301.       JMP    LOADBD
  302. ;
  303. OK4800:      MVI    A,7
  304.       LXI    H,BD4800
  305.       JMP    LOADBD
  306. ;
  307. OK9600:      MVI    A,8
  308.       LXI    H,BD9600
  309. ;
  310. LOADBD:      STA    INITMOD+1    ;store speed to show transfer time
  311.       MOV    A,M        ;Get Baud Rate Byte From Table.
  312.       STA    LSPSPD+1    ;store in INITMOD
  313.       JMP    INITMOD        ;reset-up H8 2651 Mode Registers.
  314. ;
  315. ;
  316. ; Table of baud rate parameters
  317. ;
  318. BD300:      DB    35H
  319. BD600:      DB    36H
  320. BD1200:      DB    37H
  321. BD2400:      DB    3AH
  322. BD4800:      DB    3CH
  323. BD9600:      DB    3EH
  324. ;
  325. BAUDBUF:  DB    10,0
  326.       DS    10
  327. ;
  328. ;-----------------------------------------------------------------------
  329. ;
  330. ; This routine can be used for your equipment, be sure to end with RET
  331. ; If using the Hayes Smartmodem this is unavailable without a special
  332. ; change.
  333. ;
  334. SPCLMENU: RET
  335. ;
  336. ;-----------------------------------------------------------------------
  337. ;
  338. ;
  339. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  340. ;                 0C00H (without Smartmodem)
  341. ;
  342.       END
  343. ;
  344. -------------
  345. ;
  346. ;
  347. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartm