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-4A.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  12KB  |  400 lines

  1.  
  2. ; M7H8-4A.ASM -- Heath/Zenith H89 overlay file for MDM7xx.  03/16/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 DDT to overlay the the results
  21. ;        of this program to the original .COM file:
  22. ;
  23. ;        A>DDT MDM7xx.COM
  24. ;        DDT VERS 2.2
  25. ;        NEXT  PC
  26. ;        4A00 0100
  27. ;        -IM7H8-4A.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 MODEM7xx.COM    (now have a modified .COM file)
  33. ;
  34. ;        NOTE: If the MDM7XX file gets bigger the SAVE XX will be
  35. ;        larger. Be sure to check the hex number under NEXT..
  36. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  37. ;
  38. ; 03/16/84 - Added SMARTMODEM EQU so IF/ENDIF statements would work
  39. ;  M7H8-4A    work corectly. - Mike Allen
  40. ; 02/26/84 - Corrected to allow SMARTMODEM YES without overrunning
  41. ;  M7H8-4    0400H in assembly. - Bill Wood
  42. ;
  43. ; 02/15/84 - Made default baud-rate follow the MSPEED equate.
  44. ;  M7H8-3                    - Rich Berg
  45. ;
  46. ; 12/11/83 - Restricted baud-rate selection for Hayes users.
  47. ;  M7H8-2    changed signon for Hayes, tells default modem
  48. ;         speed at signon.            - Tom Bering
  49. ;
  50. ; 11/11/83 - Renamed to M7H8-1.ASM, no changes    - Irv Hoff
  51. ; 10/03/82 - First version of this file
  52. ;
  53. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  54. ;
  55. BELL:        EQU    07H        ;bell
  56. CR:        EQU    0DH        ;carriage return
  57. ESC:        EQU    1BH        ;escape
  58. LF:        EQU    0AH        ;linefeed
  59. ;
  60. YES:        EQU    0FFH
  61. NO:        EQU    0
  62. ;
  63. ;
  64. ; Change the value at MODDATP if it does not match what you are using.
  65. ;
  66. MODDATP:    EQU    0D8H        ;data port for H89
  67. MODCTL1:    EQU    MODDATP+5    ;status port for H89
  68. MODRCVB:    EQU    1        ;bit to test for received data
  69. MODRCVR:    EQU    1        ;modem receive ready
  70. MODSNDB:    EQU    20H        ;bit to test for ready to send
  71. MODSNDR:    EQU    20H        ;modem send ready bit
  72. ;
  73. SMARTMODEM:    EQU    YES    ;yes=HAYES SmartModem, no=non-Hayes
  74.                 ;put here to make 'IF-ENDIF' happy
  75. ;
  76.         ORG    100H
  77. ;
  78. ; Change the clock speed if needed, to match your system
  79. ;
  80.         DS    3    ;(for  "JMP   START" instruction)
  81. ;
  82. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  83. SMODEM:        DB    SMARTMODEM    ;now prog & 'IF-ENDIF' happy    104H
  84. TOUCHPULSE:    DB    'P'    ;T=touch, P=pulse (Smartmodem-only)    105H
  85. CLOCK:        DB    20    ;clock speed in MHz x .1, 25.5 MHz max. 106H
  86.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  87. MSPEED:     DB    1    ;set to desired default. 1=300 2=450    107H
  88.                 ;4=600 5=1200 8=9600 
  89. BYTDLY:     DB    1    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  90.                 ;default time to send character in ter-
  91.                 ;minal mode file transfer for slow BBS.
  92. CRDLY:        DB    1    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  93.                 ;default time for extra wait after CRLF
  94.                 ;in terminal mode file transfer
  95. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  96. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  97. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  98. ACKNAK:     DB    YES    ;yes=resend a record after any non-ACK    10DH
  99.                 ;no=resend a record after a valid NAK
  100. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  101. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  102. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  103. CONVBKSP:    DB    YES    ;yes=convert backspace to rub        111H
  104. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  105. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  106.                 ;terminal mode (added by remote echo)
  107. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  108. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  109.                 ;write logon sequence at location LOGON
  110. SAVCCP:     DB    YES    ;yes=do not overwrite CCP        116H
  111. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  112.                 ;no=external command if EXTCHR precedes
  113. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  114. LSTTST:     DB    YES    ;yes=printer available on printer port    119H
  115. XOFFTST:    DB    YES    ;yes=checks for XOFF from remote while    11AH
  116.                 ;sending a file in terminal mode
  117. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  118.                 ;sending a file in terminal mode
  119. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  120. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  121. EXTRA1:     DB    0    ;for future expansion            11EH
  122. EXTRA2:     DB    0    ;for future expansion            11FH
  123. BRKCHR:     DB    '@'-40H ;^@ = Send a 300 ms. break tone     120H
  124. NOCONNCT:    DB    'N'-40H ;^N = Disconnect from the phone line    121H
  125. LOGCHR:     DB    'L'-40H ;^L = Send logon            122H
  126. LSTCHR:     DB    'P'-40H ;^P = Toggle printer            123H
  127. UNSAVE:     DB    'R'-40H ;^R = Close input text buffer        124H
  128. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  129. SAVECHR:    DB    'Y'-40H ;^Y = Open input text buffer        126H
  130. EXTCHR:     DB    '^'-40H ;^^ = Send next character        127H
  131. ;
  132. ;
  133.         DS    2        ;                128H
  134. ;
  135. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  136.         DS    7
  137. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  138.         DS    7
  139. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  140.         DS    7
  141. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    148H
  142. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  143. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    14EH
  144. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  145.         DS    12        ;PMMI only calls        154H
  146. ;
  147. ;
  148. LOGONPTR:    DW    LOGON        ;for user message.        160H
  149.         DS    6        ;                162H
  150. JMP$GOODBYE:    JMP    GOODBYE     ;                168H
  151. JMP$INITMOD:    JMP    INIT        ;go to user written routine    16BH
  152.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  153.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  154.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  155. JMP$SETUPR:    JMP    SETUPR        ;                177H
  156. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  157. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  158. JMP$BREAK:    JMP    SENDBRK     ;                180H
  159. ;
  160. ;
  161. ; Do not change the following six lines.
  162. ;
  163. JMP$ILPRT:    DS    3        ;                183H
  164. JMP$INBUF    DS    3        ;                186H
  165. JMP$INLNCOMP:    DS    3        ;                189H
  166. JMP$INMODEM    DS    3        ;                18CH
  167. JMP$NXTSCRN:    DS    3        ;                18FH
  168. JMP$TIMER    DS    3        ;                192H
  169. ;
  170. ;
  171. ; The following clear the screen for the H19 or H89 terminal
  172. ;
  173. CLREOS:     CALL    JMP$ILPRT    ;                195H
  174.         DB    ESC,'J',0,0,0    ;                198H
  175.         RET            ;                19DH
  176. ;
  177. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  178.         DB    ESC,'E',0,0,0    ;                1A1H
  179.         RET            ;                1A6H
  180. ;
  181. ;
  182. SYSVER:     CALL    JMP$ILPRT    ;                1A7H
  183.         IF    SMARTMODEM
  184.         DB    'Version for H89 + Smartmodem 1200'
  185.         ENDIF
  186.         IF    NOT SMARTMODEM
  187.         DB    'Version for H89 with 8250 I/O'
  188.         ENDIF
  189.         DB    CR,LF,LF,'DEFAULT ',0
  190.         CALL    BAUD
  191.         CALL    JMP$ILPRT
  192.         DB    ' BAUD'
  193.         DB    CR,LF,0
  194.         RET
  195. ;
  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    'an H89 user',CR,0
  213. ;.....
  214. ;
  215. ;
  216. ; This routine sends a 300 ms. break tone to reset some time-share
  217. ; computers.
  218. ;
  219. SENDBRK:  MVI    A,40H        ;SET BREAK TONE
  220.       OUT    MODDATP+3
  221.       JMP    GOODBYE1    ;SEND A 300 MS. BREAK TONE
  222. ;.....
  223. ;
  224. ;
  225. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  226. ; length of time to disconnect some modems such as the Bell 212A, etc.
  227. ;
  228. GOODBYE:  XRA    A
  229.       OUT    MODDATP+4    ;SET DTR AND RTS LOW
  230.       MVI    A,40H        ;SET BREAK TONE
  231.       OUT    MODDATP+3
  232. ;
  233. GOODBYE1: MVI    B,3        ;WAIT 300 MS.
  234.       CALL    JMP$TIMER
  235.       MVI    A,03H        ;RESET TO NORMAL 8 BITS
  236.       OUT    MODDATP+3
  237.       MVI    A,01H
  238.       OUT    MODDATP+4    ;RESET DTR HIGH
  239.       RET
  240. ;.....
  241. ;
  242. ;
  243. BAUD:    LDA    MSPEED
  244.     CPI    1
  245.     JNZ    BAUD1
  246.     CALL    JMP$ILPRT
  247.     DB    '300',0
  248.     RET
  249. BAUD1:    CPI    2
  250.     JNZ    BAUD2
  251.     CALL    JMP$ILPRT
  252.     DB    '450',0
  253.     RET
  254. BAUD2:    CPI    3
  255.     JNZ    BAUD5
  256.     CALL    JMP$ILPRT
  257.     DB    '600',0
  258.     RET
  259. BAUD5:    CPI    5
  260.     JNZ    BAUD8
  261.     CALL    JMP$ILPRT
  262.     DB    '1200',0
  263.     RET
  264. BAUD8:    CALL    JMP$ILPRT
  265.     DB    '9600',0
  266.     RET
  267. ;
  268. ;
  269. ; The following is used to initialize the H89 8250 I/O port
  270. ;
  271. INIT:    LDA    MSPEED
  272.     CPI    1
  273.     JZ    OK300
  274.     CPI    2
  275.     JZ    OK450
  276.     CPI    3
  277.     JZ    OK600
  278.     CPI    5
  279.     JZ    OK1200
  280.     CPI    8
  281.     JZ    OK9600
  282. INITMOD:  MVI    A,1        ;default transfer speed to 300 baud
  283.       STA    MSPEED
  284.       DI            ;turn off interrupts for init.
  285.       XRA    A
  286.       OUT    MODDATP+1    ;interrupt enable register
  287.       MVI    A,80H        ;insure out of mode to set baud rate
  288.       OUT    MODDATP+3    ;line control register
  289.       OUT    MODDATP+3
  290. ;
  291. LSPSPD:   MVI    A,80H        ;default 'LSP' speed for 300 baud
  292.       OUT    MODDATP     ;register for 'LSP' speed if enabled
  293. ;
  294. MSPSPD:   MVI    A,01H        ;default 'MSP' speed for 300 baud
  295.       OUT    MODDATP+1    ;register for 'MSP' speed if enabled
  296. ;
  297.       MVI    A,03H        ;8-level, 1 stop bit, no parity
  298.       OUT    MODDATP+3    ;line control register
  299.       MVI    A,01H        ;set 'DTR' for proper modem output level
  300.       OUT    MODDATP+4    ;modem control register
  301.       EI            ;restore interrupts to normal
  302.       RET
  303. ;.....
  304. ;
  305. ;
  306. ; The following routine changes the baud rate for the H89 with the SET
  307. ; command.
  308. ;
  309.     IF    SMARTMODEM
  310. SETUPR: CALL    JMP$ILPRT
  311.     DB    'Select 450 Baud only *AFTER* dialing modem',CR,LF
  312.     DB    'Select Baud Rate ( 300 450 1200 ) : ',0
  313.     LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  314.     CALL    JMP$INBUF
  315.     LXI    D,BAUDBUF+2    ;compare BAUDBUF+2 w/chars below
  316.     ENDIF
  317. ;
  318. SETUPR1:
  319.     CALL    JMP$INLNCOMP
  320.     DB    '300',0
  321.     JNC    OK300        ;go if got match
  322.     CALL    JMP$INLNCOMP
  323.     DB    '450',0
  324.     JNC    OK450
  325.     CALL    JMP$INLNCOMP
  326.     DB    '1200',0
  327.     JNC    OK1200
  328.     CALL    JMP$ILPRT    ;all matches failed - complain
  329.     DB    '++ INVALID BAUDRATE ++',CR,LF,BELL,0
  330.     JMP    SETUPR        ;try again
  331. ;
  332.     IF    NOT SMARTMODEM
  333. SETUPR: CALL    JMP$ILPRT
  334.     DB    'SELECT BAUD RATE (300, 450, 600, 1200, 9600): ',0
  335.     LXI    D,BAUDBUF
  336.     CALL    JMP$INBUF
  337.     LXI    D,BAUDBUF+2
  338.     CALL    JMP$INLNCOMP
  339.     DB    '600',0
  340.     JNC    OK600
  341.     CALL    JMP$INLNCOMP
  342.     DB    '9600',0
  343.     JNC    OK9600
  344.     JMP    SETUPR1
  345.     ENDIF
  346. ;
  347. OK300:      MVI    A,1        ;MSPEED 300 baud value
  348.       LHLD    BD300        ;get 300 baud parameters in HL
  349.       JMP    LOADBD        ;go load them
  350. ;
  351. OK450:      MVI    A,2
  352.       LHLD    BD450
  353.       JMP    LOADBD
  354. ;
  355. OK600:      MVI    A,3
  356.       LHLD    BD600
  357.       JMP    LOADBD
  358. ;
  359. OK1200:   MVI    A,5
  360.       LHLD    BD1200
  361.       JMP    LOADBD
  362. ;
  363. OK9600:   MVI    A,8
  364.       LHLD    BD9600
  365. ;
  366. LOADBD:   STA    INITMOD+1    ;store speed to show transfer time
  367.       MOV    A,L        ;get least significant baud rate byte
  368.       STA    LSPSPD+1    ;store in INITMOD
  369.       MOV    A,H        ;get most signifcant baud rate byte
  370.       STA    MSPSPD+1    ;store in INITMOD
  371.       JMP    INITMOD     ;reset H89 8250
  372. ;
  373. ;
  374. ; Table of baud rate parameters
  375. ;
  376. BD300:      DW    0180H
  377. BD450:      DW    0100H
  378. BD600:      DW    00C0H
  379. BD1200:   DW    0060H
  380. BD9600:   DW    000CH
  381. ;
  382. BAUDBUF:  DB    10,0
  383.       DS    10
  384. ;
  385. ;-----------------------------------------------------------------------
  386. ;
  387. ; This routine can be used for your equipment, be sure to end with RET.
  388. ; If using the Hayes Smartmodem this is unavailable without a special
  389. ; change.
  390. ;
  391. SPCLMENU: RET
  392. ;
  393. ;-----------------------------------------------------------------------
  394. ;
  395. ;
  396. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  397. ;                 0D00H (without Smartmodem)
  398. ;
  399.       END
  400.