home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols200 / vol219 / mxo-h812.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  11.0 KB  |  349 lines

  1.  
  2. ; MXO-H811.ASM-- Heath/Zenith H89 overlay file for MEX. 05/23/84
  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 MLOAD to overlay the the results
  21. ;        of this program to the original .COM file.
  22. ;
  23. ;
  24. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  25. ; 07/27/84 - Added 9600 baud select        - Bucky Carr
  26. ; 05/23/84 - Corrected clear-screen error    - Biff Bueffel
  27. ; 05/19/84 - Converted for MEX10        - Biff Bueffel
  28. ; 11/11/83 - Renamed to M7H8-1.ASM, no changes    - Irv Hoff
  29. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  30. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  31. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  32. ; 05/27/83 - Revised to work with MDM709    - Irv Hoff
  33. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  34. ; 04/17/83 - Revised to work with MDM707    - Irv Hoff
  35. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  36. ; 02/27/83 - Updated to work with MDM705    - Irv Hoff
  37. ; 02/17/83 - Updated to work with MDM704    - Irv Hoff
  38. ; 02/07/83 - Updated to work with MDM703    - Irv Hoff
  39. ; 01/27/83 - Updated to work with MDM702    - Irv Hoff
  40. ; 01/10/83 - Updated to work with MDM701    - Irv Hoff
  41. ; 10/03/82 - First version of this file
  42. ;
  43. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  44. ;
  45. BELL:        EQU    07H        ;bell
  46. CR:        EQU    0DH        ;carriage return
  47. ESC:        EQU    1BH        ;escape
  48. LF:        EQU    0AH        ;linefeed
  49. ;
  50. YES:        EQU    0FFH
  51. NO:        EQU    0
  52. ;
  53. ;
  54. ; Change the value at MODDATP if it does not match what you are using.
  55. ;
  56. MODDATP:    EQU    0D8H        ;data port for H89
  57. MODCTL1:    EQU    MODDATP+5    ;status port for H89
  58. MODRCVB:    EQU    1        ;bit to test for received data
  59. MODRCVR:    EQU    1        ;modem receive ready
  60. MODSNDB:    EQU    20H        ;bit to test for ready to send
  61. MODSNDR:    EQU    20H        ;modem send ready bit
  62. ;
  63. ; MEX service processor stuff
  64. ;
  65. MEX    EQU    0D00H        ;address of the service processor
  66. INMDM    EQU    255        ;get char from port to A, CY=no more in 100 ms
  67. TIMER    EQU    254        ;delay 100ms * reg B
  68. TMDINP    EQU    253        ;B=# secs to wait for char, cy=no char
  69. CHEKCC    EQU    252        ;check for ^C from KBD, Z=present
  70. SNDRDY    EQU    251        ;test for modem-send ready
  71. RCVRDY    EQU    250        ;test for modem-receive ready
  72. SNDCHR    EQU    249        ;send a character to the modem (after sndrdy)
  73. RCVCHR    EQU    248        ;recv a char from modem (after rcvrdy)
  74. LOOKUP    EQU    247        ;table search: see CMDTBL comments for info
  75. PARSFN    EQU    246        ;parse filename from input stream
  76. BDPARS    EQU    245        ;parse baud-rate from input stream
  77. SBLANK    EQU    244        ;scan input stream to next non-blank
  78. EVALA    EQU    243        ;evaluate numeric from input stream
  79. LKAHED    EQU    242        ;get nxt char w/o removing from input
  80. GNC    EQU    241        ;get char from input, cy=1 if none
  81. ILP    EQU    240        ;inline print
  82. DECOUT    EQU    239        ;decimal output
  83. PRBAUD    EQU    238        ;print baud rate
  84. ;
  85. PRINT    EQU    9        ;BDOS print-string function
  86. ;
  87.         ORG    100H
  88. ;
  89. ; Change the clock speed if needed, to match your system
  90. ;
  91.         DS    3    ;(for  "JMP   START" instruction)
  92. ;
  93. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  94. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  95. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  96. CLOCK:        DB    20    ;clock speed in MHz x10, 25.5 MHz max.    106H
  97.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  98. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  99.                 ;6=2400 7=4800 8=9600 9=19200 default
  100. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  101.                 ;default time to send character in ter-
  102.                 ;minal mode file transfer for slow BBS.
  103. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  104.                 ;default time for extra wait after CRLF
  105.                 ;in terminal mode file transfer
  106. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  107. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  108. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  109. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  110.                 ;no=resend a record after a valid NAK
  111. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  112. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  113. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  114. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  115. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  116. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  117.                 ;terminal mode (added by remote echo)
  118. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  119. TRANLOGON:    DB    NO    ;yes=allow transmission of logon    115H
  120.                 ;write logon sequence at location LOGON
  121. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  122. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  123.                 ;no=external command if EXTCHR precedes
  124. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  125. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  126. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  127.                 ;sending a file in terminal mode
  128. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  129.                 ;sending a file in terminal mode
  130. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  131. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  132. EXTRA1:        DB    0    ;for future expansion            11EH
  133. EXTRA2:        DB    0    ;for future expansion            11FH
  134. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  135. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  136. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  137. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  138. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  139. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  140. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  141. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  142. ;
  143. ;
  144.         DS    2        ;                128H
  145. ;
  146. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  147.         DS    7
  148. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  149.         DS    7
  150. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  151.         DS    7
  152. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    148H
  153. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  154. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    14EH
  155. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  156.         DS    12        ;PMMI only calls        154H
  157. ;
  158. ;
  159.         DS    2        ;Not used by MEX        160H
  160.         DS    6        ;                162H
  161. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  162. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  163. JMP$NEWBAUD:    JMP    NEWBAUD        ;Change baudrate        16EH
  164.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  165.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  166. JMP$SETUPR:    JMP    SETUPR        ;                177H
  167.         DS    3        ;Not used by MEX        17AH
  168. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  169. JMP$BREAK:    JMP    SENDBRK        ;                180H
  170. ;
  171. ;
  172. ; Do not change the following six lines.
  173. ;
  174. JMP$ILPRT:    DS    3        ;                183H
  175. JMP$INBUF    DS    3        ;                186H
  176. JMP$INLNCOMP:    DS    3        ;                189H
  177. JMP$INMODEM    DS    3        ;                18CH
  178. JMP$NXTSCRN:    DS    3        ;                18FH
  179. JMP$TIMER    DS    3        ;                192H
  180. ;
  181. ;
  182. ; The following clear the screen for the H19 or H89 terminal
  183. ;
  184. CLREOS:     LXI    D,EOSMSG
  185.         MVI    C,PRINT
  186.         CALL    MEX
  187.         RET            
  188. ;
  189. CLRSCRN:    LXI    D,CLSMSG
  190.         MVI    C,PRINT
  191.         CALL    MEX
  192.         RET            
  193. ;
  194. ;
  195. SYSVER:        MVI    C,ILP
  196.         CALL    MEX
  197.         DB    'Version for Heath/Zenith with 8250 I/O'
  198.         DB    CR,LF,0
  199.         RET
  200. ;.....
  201. ;
  202. ;
  203. ;-----------------------------------------------------------------------
  204. ;
  205. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  206. ;     end of your last routine should terminate by 0B00H (601 bytes
  207. ;     available after start of SYSVER) if using the Hayes Smartmodem
  208. ;     or by address 0D00H (2659 bytes) otherwise.
  209. ;
  210. ;-----------------------------------------------------------------------
  211. ;
  212. ;
  213. ;
  214. ; This routine sends a 300 ms. break tone to reset some time-share
  215. ; computers.
  216. ;
  217. SENDBRK:  MVI    A,40H        ;SET BREAK TONE
  218.       OUT    MODDATP+3
  219.       JMP    GOODBYE1    ;SEND A 300 MS. BREAK TONE
  220. ;.....
  221. ;
  222. ;
  223. ; This routine sends a 300 ms. break tgone and set DTR low for the same
  224. ; length of time to disconnect some modems such as the Bell 212A, etc.
  225. ;
  226. GOODBYE:  XRA    A
  227.       OUT    MODDATP+4    ;SET DTR AND RTS LOW
  228.       MVI    A,40H        ;SET BREAK TONE
  229.       OUT    MODDATP+3
  230. ;
  231. GOODBYE1: MVI    B,3        ;WAIT 300 MS.
  232.       MVI    C,TIMER
  233.       CALL    MEX    
  234.       MVI    A,03H        ;RESET TO NORMAL 8 BITS
  235.       OUT    MODDATP+3
  236.       MVI    A,01H
  237.       OUT    MODDATP+4    ;RESET DTR HIGH
  238.       RET
  239. ;.....
  240. ;
  241. ;
  242. ; The following is used to initialize the H89 8250 I/O port
  243. ;
  244. INITMOD:  MVI    A,5        ;default transfer speed to 1200 baud
  245.       STA    MSPEED
  246.       DI            ;turn off interrupts for init.
  247.       XRA    A
  248.       OUT    MODDATP+1    ;interrupt enable register
  249.       MVI    A,80H        ;insure out of mode to set baud rate
  250.       OUT    MODDATP+3    ;line control register
  251.       OUT    MODDATP+3
  252. ;
  253. LSPSPD:   MVI    A,60H        ;default 'LSP' speed for 1200 baud
  254.       OUT    MODDATP        ;register for 'LSP' speed if enabled
  255. ;
  256. MSPSPD:   MVI    A,00H        ;default 'MSP' speed for 1200 baud
  257.       OUT    MODDATP+1    ;register for 'MSP' speed if enabled
  258. ;
  259.       MVI    A,03H        ;8-level, 1 stop bit, no parity
  260.       OUT    MODDATP+3    ;line control register
  261.       MVI    A,01H        ;set 'DTR' for proper modem output level
  262.       OUT    MODDATP+4    ;modem control register
  263.       EI            ;restore interrupts to normal
  264.       RET
  265. ;.....
  266. ;
  267. ;
  268. ; The following routine changes the baud rate for the H89 with the SET
  269. ; command.
  270. ;
  271. ;
  272. SETUPR:      MVI    C,SBLANK    ;Any arguments?
  273.       CALL    MEX
  274.       JC    TELL        ;If not, go display baud
  275.       LXI    D,CMDTBL
  276.       MVI    C,LOOKUP
  277.       CALL    MEX        ;Parse argument
  278.       PUSH    H        ;Save any parsed argument addrs on stack
  279.       RNC            ;If we have one, return to it
  280.       POP    H        ;Oops, input not found in table
  281.       MVI    C,ILP
  282.       CALL    MEX        ;Tell user input not valid
  283.       DB    CR,LF,'300, 1200, or 9600 baud',CR,LF,0
  284.       RET
  285. ;
  286. CMDTBL:      DB    '30','0'+80H
  287.       DW    OK300
  288.       DB    '120','0'+80H
  289.       DW    OK1200
  290.       DB    '960','0'+80H
  291.       DW    OK9600
  292.       DB    0
  293. ;
  294. TELL:      MVI    C,ILP
  295.       CALL    MEX        ;Print current baud rate
  296.       DB    CR,LF,'Baud rate is now: ',0
  297.       LDA    MSPEED
  298.       MVI    C,PRBAUD
  299.       CALL    MEX
  300.       RET
  301. ;
  302. ;
  303. ;
  304. OK300:      MVI    A,1        ;MSPEED 300 baud value
  305.       LHLD    BD300        ;get 300 baud parameters in HL
  306.       JMP    LOADBD        ;go load them
  307. ;
  308. OK1200:      MVI    A,5
  309.       LHLD    BD1200
  310.       JMP    LOADBD
  311. ;
  312. OK9600:   MVI    A,8
  313.       LHLD    BD9600
  314.       JMP    LOADBD
  315. ;
  316. LOADBD:   STA    INITMOD+1    ;store speed to show transfer time
  317.       MOV    A,L        ;get least significant baud rate byte
  318.       STA    LSPSPD+1    ;store in INITMOD
  319.       MOV    A,H        ;get most signifcant baud rate byte
  320.       STA    MSPSPD+1    ;store in INITMOD
  321.       JMP    INITMOD        ;reset H89 8250
  322. ;
  323. ;
  324. NEWBAUD:  CPI    1
  325.       JZ    OK300
  326.       CPI    5
  327.       JZ    OK1200
  328.       CPI    8
  329.       JZ    OK9600
  330.       RET
  331. ;
  332. ;
  333. ; Table of baud rate parameters
  334. ;
  335. BD300:      DW    0180H
  336. BD1200:      DW    0060H
  337. BD9600:   DW    000CH
  338. ;
  339. BAUDBUF:  DB    10,0
  340.       DS    10
  341. ;
  342. EOSMSG:      DB    ESC,'J',0,0,0,'$'              
  343. CLSMSG:      DB    ESC,'E',0,0,0,'$'
  344. ;------------------------------------------------------------------
  345. ;
  346. ; NOTE:  MUST TERMINATE PRIOR TO 0B00H (with Smartmodem)
  347. ;
  348.       END
  349. S