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 / M7ZB-2.AQM / M7ZB-2.ASM
Assembly Source File  |  2000-06-30  |  12KB  |  367 lines

  1.  
  2. ; M7ZB-2.ASM --  Zorba overlay file for MDM7xx - 07/01/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 adapts the ZORBA computer to the modem program.
  7. ; Much of the information contained here is not in the main file.
  8. ;
  9. ; Edit this file for your preferences then follow the "TO USE:" example
  10. ; shown    below.
  11. ;
  12. ;
  13. ;    TO USE:    First edit this file filling in answers for your own
  14. ;        equipment.  Then assemble with ASM.COM or equivalent
  15. ;        assembler.  Then use DDT to overlay the the results
  16. ;        of this    program to the original .COM file:
  17. ;
  18. ;=============================================================================
  19. ;
  20. ;NOTE:     The use of the MDMLNK.COM utility makes the following process much
  21. ;     simpler.  You may want to use MDMLNK if it is available to you.
  22. ;
  23. ;=============================================================================
  24. ;
  25. ;        A>DDT MDM7xx.COM
  26. ;        DDT VERS 2.2
  27. ;        NEXT  PC
  28. ;        4A00 0100
  29. ;        -IM7xx-x.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. ; =   =      =   =      =   =      =   =   =   =   =   =   =   =   =   =   =   =
  37. ;
  38. ; SPECIAL ZORBA NOTES    6/11/84
  39. ;
  40. ; Running MDM7xx on the Zorba requires some special considerations.
  41. ; It is    not necessary to use Setup when changing baud rate.
  42. ; Use the MDM7xx "SET" command to change the baud rate.  MDM7xx is
  43. ; at 300 baud when the program is first called up.  (This default
  44. ; can be changed in this overly.)  Just leave the Zorba's comm
  45. ; port configured for 1200 baud and use MDM7xx SET to change back and
  46. ; forth    between 300 and 1200.
  47. ;
  48. ; MDM7xx does not recognize the Zorba function keys, nor does it
  49. ; recognize Smartkey designations.  Several people are trying to
  50. ; find a patch, but for now use M7FNK to program MDM7xx's own 
  51. ; function key feature.  Hint to others who might search for the
  52. ; cause    of problem:  Compare MDM7xx to MEX.  MEX does recognize
  53. ; Zorba    function keys.
  54. ;
  55. ; The Print Buffer feature does not work.  If your printer is slower
  56. ; than your modem you will simply lose data.
  57. ;
  58. ; For mainframe users, the Zorba overlay does allow the Zorba
  59. ; to generate a true Break signal.  For operating systems up to
  60. ; 1.8b just use the Zorba keyboard's Break key.
  61. ; However, OS v. 2.0 uses the Break key to stop the disk
  62. ; drives, and it no longer can cause MDM7xx to send a
  63. ; Break    signal.  In theory, MDM7xx allows using ^@ to send the Break,
  64. ; but ^@ can't be keyed from Zorba keyboard.  I have 
  65. ; substituted ~ as the Break key (BRKCHR).  Note that the
  66. ; Menu will not display the "~" properly, because it's
  67. ; looking for a control character, so the program welcome
  68. ; message has been modified to remind you that ~ is the 
  69. ; break    generating key.
  70. ;
  71. ;           Randy Brook, 206 522 6868 (h),  442 4655 (w)
  72. ;
  73. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  74. ;
  75. ; 07/01/84 - Slight changes for MDM740        - Robert Flagg
  76. ; 05/23/84 -  BRKCHR changed from ^@ to ~    
  77. ;          Also renamed M7ZB-2.        - Randy Brook
  78. ; 11/11/83 - Renamed to M7ZB-1.ASM, no changes    - Irv Hoff
  79. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  80. ; 07/12/83 - Modified for the ZORBA computer    - Michael Booth
  81. ;
  82. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  83. ;
  84. BELL:        EQU    07H        ;bell
  85. CR:        EQU    0DH        ;carriage return
  86. ESC:        EQU    1BH        ;escape
  87. LF:        EQU    0AH        ;linefeed
  88. ;
  89. YES:        EQU    0FFH
  90. NO:        EQU    0
  91. ;
  92. ;
  93. PORT:        EQU    020H        ;ZORBA Modem Data Port
  94. MODCTL1:    EQU    PORT+1        ;Modem status port
  95. MODCTL2:    EQU    PORT+1        ;Modem control port
  96. MODDATP:    EQU    PORT        ;Modem data port
  97. ;
  98. ;
  99.         ORG    100H
  100. ;
  101.         DS    3    ;(for  "JMP   START" instruction)
  102. ;
  103.  
  104. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  105. AUTODIAL:    DB    NO    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  106. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  107. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  108.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  109. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  110.                 ;6=2400    7=4800 8=9600 9=19200 default
  111. BYTDLY:        DB    3    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  112.                 ;default time to send character in ter-
  113.                 ;minal mode file transfer for slow BBS.
  114. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  115.                 ;default time for extra wait after CRLF
  116.                 ;in terminal mode file transfer
  117. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  118. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  119. SCRNTEST:    DB    YES    ;cursor control routine         10CH
  120. RETRY:        DB    YES    ;yes=reset the error limit to try again 10DH
  121.                 ;no=abort after 10 consecutive errors
  122. BAKKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  123. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  124. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  125. CONVRUB:    DB    YES    ;yes=convert rub to backspace        111H
  126. TOGGLEBK:    DB    YES    ;yes=allow toggling of rub to backspace 112H
  127. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  128.                 ;terminal mode (added by remote echo)
  129. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  130. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  131.                 ;write logon sequence at location LOGON
  132. SAVCCP:        DB    YES    ;yes=do    not overwrite CCP        116H
  133. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  134.                 ;no=external command if EXTCHR precedes
  135. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  136. LSTTST:        DB    YES    ;yes=printer available on printer port    19H
  137. XOFFTST:    DB    NO    ;yes=chcks for XOFF from remote    while    11AH
  138.                 ;sending a file in terminal mode
  139. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  140.                 ;sending a file in terminal mode
  141. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  142. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  143. EXTRA1:        DB    0    ;for future expansion            11EH
  144. EXTRA2:        DB    0    ;for future expansion            11FH
  145. BRKCHR:        DB    '~'    ;Send a 300 ms. break tone        120H
  146. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from phone line    121H
  147. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  148. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  149. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  150. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  151. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  152. EXTCHR:        DB    '\'-40H    ;^\ = Send next character        127H
  153. ;
  154. ;
  155.         DS    2        ;                128H
  156. ;
  157. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  158.         DS    7
  159. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  160.         DS    7
  161. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  162.         DS    31
  163. ;
  164. LOGONPTR:    DW    LOGON        ;for user message.        160H
  165.         DS    6        ;                162H
  166. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  167. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  168.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  169.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  170.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  171. JMP$SETUPR:    JMP    SETUPR        ;                177H
  172. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  173. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  174. JMP$BREAK:    JMP    SENDBRK        ;                180H
  175. ;
  176. ;
  177. ; Do not change the following six lines.
  178. ;
  179. JMP$ILPRT:    DS    3        ;                183H
  180. JMP$INBUF    DS    3        ;                186H
  181. JMP$INLNCOMP:    DS    3        ;                189H
  182. JMP$INMODEM    DS    3        ;                18CH
  183. JMP$NXTSCRN:    DS    3        ;                18FH
  184. JMP$TIMER:    DS    3        ;                192H
  185. ;
  186. ; Clear    sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  187. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  188. ;
  189. CLREOS:        CALL    JMP$ILPRT    ;                195H
  190.         DB    ESC,'J',0,0,0    ;                198H
  191.         RET            ;                19DH
  192. ;
  193. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  194.         DB    ESC,'E',0,0,0    ;                1A1H
  195.         RET            ;                1A6H
  196. ;
  197. ;
  198. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  199.         DB    '***  Version for ZORBA  ***'    
  200.         DB    '  Use ~ to send Break signal  ***'
  201.         DB    CR,LF,0
  202.         RET
  203. ;.....
  204. ;
  205. ;
  206. ;-----------------------------------------------------------------------
  207. ;
  208. ; NOTE:     You can change the SYSVER message to be longer or shorter.  The
  209. ;     end of    your last routine should terminate by 0400H (601 bytes
  210. ;     available after start of SYSVER) if using the Hayes Smartmodem
  211. ;     or by address 0C00H (2659 bytes) otherwise.
  212. ;
  213. ;-----------------------------------------------------------------------
  214. ;
  215. ; You can put in a message at this location which can be called up with
  216. ; CTL-O    if TRANLOGON has been set YES.    You can put in several lines if
  217. ; desired.  End with a 0.
  218. ;
  219. ;
  220. LOGON:      DB    'Hello, This is a ZORBA computer',CR,LF,0
  221. ;
  222. ;=======================================================================
  223. ;
  224. ; This routine allows a 300 ms. break tone to be sent to reset some
  225. ; time-share computers.
  226. ;
  227. SENDBRK:  MVI    A,1FH
  228.       JMP    GOODBYE1
  229. ;.....
  230. ;
  231. ;
  232. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  233. ; length of time to disconnect some modems such as the Bell 212A, etc.
  234. ;
  235. GOODBYE:  MVI    A,15H        ;SEND BREAK, TURN OFF DTR
  236. ;
  237. GOODBYE1: OUT    MODCTL1        ;SEND TO STATUS PORT
  238.       MVI    B,3        ;DELAY ABOUT 300 MS.
  239.       CALL    JMP$TIMER
  240.       MVI    A,07H        ;NORMAL    SEND/RECEIVE WITH DTR
  241.       OUT    MODCTL1        ;SEND TO STATUS PORT
  242.       RET
  243. ;
  244. ;
  245. ; ZORBA    initialization -- sets CTC timer 0 for baudrate in/out.
  246. ;
  247. ; ZORBA    specific equates for initialization.
  248. ;
  249. CTCCMD:      EQU    03H        ;8253 Timer control/status
  250. CTC0:      EQU    00H        ;Timer 0 (port A)
  251. LSB300      EQU    83H        ;Default 300 baud
  252. MSB300      EQU    06H
  253. ;
  254. ;
  255. INITMOD:  MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  256.       STA    MSPEED
  257. ;
  258. INITMOD1: MVI    A,36H        ;SQUARE WAVE MODE, PORT A
  259.       OUT    CTCCMD
  260. ;
  261. LSBD:      MVI    A,LSB300
  262.       OUT    CTC0
  263. ;
  264. MSBD:      MVI    A,MSB300
  265.       OUT    CTC0
  266.       RET
  267. ;.....
  268. ;
  269. ;
  270. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  271.       CALL    JMP$ILPRT
  272.       DB    'Input Baud Rate (300, 450, 600, 1200, '
  273.       DB    '4800, 9600, 19200): ',0
  274.       CALL    JMP$INBUF
  275.       LXI    D,BAUDBUF+2
  276.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  277.       DB    '300',0
  278.       JNC    OK300        ;GO IF GOT MATCH
  279.       CALL    JMP$INLNCOMP
  280.       DB    '450',0
  281.       JNC    OK450
  282.       CALL    JMP$INLNCOMP
  283.       DB    '600',0
  284.       JNC    OK600
  285.       CALL    JMP$INLNCOMP
  286.       DB    '1200',0
  287.       JNC    OK1200
  288.       CALL    JMP$INLNCOMP
  289.       DB    '4800',0
  290.       JNC    OK4800
  291.       CALL    JMP$INLNCOMP
  292.       DB    '9600',0
  293.       JNC    OK9600
  294.       CALL    JMP$INLNCOMP
  295.       DB    '19200',0
  296.       JNC    OK19200
  297.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  298.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  299.       JMP    SETUPR        ;TRY AGAIN
  300. ;
  301. OK300:      MVI    A,1        ;MSPEED    300 BAUD VALUE
  302.       LHLD    BD300        ;GET 300 BAUD PARAMETERS IN 'HL'
  303.       JMP    LOADBD        ;GO LOAD THEM
  304. ;
  305. OK450:      MVI    A,2
  306.       LHLD    BD450
  307.       JMP    LOADBD
  308. ;
  309. OK600:      MVI    A,3
  310.       LHLD    BD600
  311.       JMP    LOADBD
  312. ;
  313. OK1200:      MVI    A,5
  314.       LHLD    BD1200
  315.       JMP    LOADBD
  316. ;
  317. OK4800:      MVI    A,7
  318.       LHLD    BD4800
  319.       JMP    LOADBD
  320. ;
  321. OK9600:      MVI    A,8
  322.       LHLD    BD9600
  323.       JMP    LOADBD
  324. ;
  325. OK19200:  MVI    A,9
  326.       LHLD    BD19200        ;FALL THRU.....
  327. ;
  328. LOADBD:      STA    INITMOD+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  329.       MOV    A,L        ;GET LEAST SIGNIFICANT BAUDRATE BYTE
  330.       STA    LSBD+1        ;STORE IN INITMOD
  331.       MOV    A,H        ;GET MOST SIGNIFICANT BAUDRATE BYTE
  332.       STA    MSBD+1        ;STORE IN INITMOD
  333.       JMP    INITMOD        ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  334. ;
  335. ;
  336. ; TABLE    OF BAUDRATE PARAMETERS
  337. ;
  338. BD300:      DW    0683H        ;  300 BAUD
  339. BD450:      DW    0457H        ;  450 BAUD
  340. BD600:      DW    0341H        ;  600 BAUD
  341. BD1200:      DW    01A1H        ; 1200 BAUD
  342. BD4800:      DW    0068H        ; 4800 BAUD
  343. BD9600:      DW    0034H        ; 9600 BAUD
  344. BD19200:  DW    001AH        ;19200 BAUD
  345. ;
  346. BAUDBUF:  DB    10,0
  347.       DS    10
  348. ;
  349. ;           (END OF INITMOD AND SETUP ROUTINES)
  350. ;=======================================================================
  351. ;        
  352. ;
  353. ; These    routines can be used for your equipment, be sure to end with RET
  354. ; If using the Hayes Smartmodem this is unavailable without a special
  355. ; change.
  356. ;
  357. SPCLMENU: RET
  358. ;        
  359. ;=======================================================================
  360. ;
  361. ;
  362. ; NOTE:     MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  363. ;                 0BC0H (without Smartmodem)
  364. ;
  365.       END
  366. ;
  367.