home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / modem / m7vt-4.asm < prev    next >
Encoding:
Assembly Source File  |  1993-06-08  |  12.0 KB  |  396 lines

  1. ; M7VT-4.ASM -- DEC Micro Overlay File for MDM7xx  01-Sep-84
  2. ;
  3. ; This OverlayFile supports the DEC Micros VT180, Rainbow and DECmate II
  4. ; with CP/M.
  5. ;
  6. ;    NOTE:  The speed of this program runs at whatever baudrate
  7. ;           you have set your currently booted disk via CONFIG.
  8. ;           If you need a different speed, you will need to boot
  9. ;           a disk with a different CONFIG speed for that port.
  10. ;           This requires a separate disk for each baud rate,
  11. ;           with a subsequent reboot for the new speed.
  12. ;
  13. ; The micro's COMM-port is used.  Baudrates are "parallel" to the con-
  14. ; sole baudrates, no need for a "special" baudrate routine.  BDOS calls
  15. ; are used since the COMM-port is I/O-wise reader/punch.
  16. ;
  17. ; I/O byte redirection is used in conjunction with a direct BIOS-CONSTAT
  18. ; call to test for COMM-status.
  19. ;
  20. ; This technique (although a little slower than direct I/O using inter-
  21. ; rupt on INPUT) is general enough to be system independent.  Set one of
  22. ; the following selections to YES:
  23. ;
  24. ;        RAINBO1 for (old) Version 1 CP/M 80/86
  25. ;        RAINBO2 for (current) Version 2 of CP/M 80/86
  26. ;        DECMATE for DECmate II with CP/M option
  27. ;        ROBIN    for the VT180 (aka ROBIN)
  28. ;
  29. ;                    - B. Eiben
  30. ;                      DEC Large System Marketing
  31. ;                      Marlboro, Mass.
  32. ;
  33. ;***********************************************************************
  34. ;
  35. ; You will want to look this file over carefully.  There are a number of
  36. ; options that you can use to configure the program to suit your taste.
  37. ;
  38. ; You could look at other overlay files to see how the GOODBYE and/or
  39. ; SETUPR areas are handled.  You could then adapt one of those, if ap-
  40. ; propriate for your equipment in this overlay.  Some examples:
  41. ;
  42. ;     "DP"  Datapoint 1560 overlay using 8251 I/O and CTC timers for
  43. ;           setting baud rates
  44. ;     "H8"  Heath H89 overlay for 8250 I/O and programmable baud rates
  45. ;     "HZ"  Zenith 120 overlay for 2661B initialization and baud rates
  46. ;     "XE"  Xerox 820II overlay for Z80-SIO intialization, etc.
  47. ;
  48. ; Edit this file for your preferences then follow the "TO USE:" example
  49. ; shown below.
  50. ;
  51. ;    TO USE: First edit this file filling in answers for your own
  52. ;        equipment.  Then assemble with ASM.COM or equivalent
  53. ;        assembler.  Then use DDT to overlay the the results
  54. ;        of this program to the original .COM file:
  55. ;
  56. ;        A>DDT MDM7xx.COM
  57. ;        DDT VERS 2.2
  58. ;        NEXT  PC
  59. ;        4A00 0100
  60. ;        -IM7VT-1.HEX        (note the "I" command)
  61. ;        -R            ("R" loads in the .HEX file)
  62. ;        NEXT  PC
  63. ;        4A00 0000
  64. ;        -G0            (return to CP/M)
  65. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  66. ;
  67. ; -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
  68. ;
  69. ; Or (easier and less error-prone) use MLOAD21.COM instead of the above
  70. ; DDT.COM merge-technique:
  71. ;
  72. ;        MLOAD21 MODEM.COM=MDM7xx.COM,M7VT-2.HEX
  73. ;
  74. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  75. ;
  76. ; 09/01/84  Updated for MDM740            - Irv Hoff
  77. ; 29/08/84  Changed to split Rainbow V1/V2    - B. Eiben
  78. ;        (incompatible I/O byte)
  79. ; 11/24/83  Changed to add Rainbow and Decmate    - B. Eiben
  80. ; 11/11/83  Renamed to M7VT-1.ASM, no changes    - Irv Hoff
  81. ; 08/09/83  Revised to work with a VT180    - Michael Gwilliam
  82. ; 04/04/83  First version of this file        - Irv Hoff
  83. ;
  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. YES:        EQU    0FFH
  92. NO:        EQU    0
  93. ;
  94. ;
  95. ; Change the following information to match your equipment
  96. ;
  97. ROBIN:        EQU    yes        ;aka DEC VT180
  98. RAINBO1:    EQU    NO        ;Rainbow Software V1
  99. RAINBO2:    EQU    NO        ;Rainbow Software V2
  100. DECMATE:    EQU    NO        ;.. with CP/M option
  101. ;
  102. ;
  103. ;
  104. BDOS:        EQU    0005        ;address of BDOS entry
  105. PUNCH:        EQU    4        ;punch function
  106. READER:        EQU    3        ;reader function
  107. MODDCDB:    EQU    4        ;carrier detect bit
  108. MODDCDA:    EQU    0        ;value when active
  109. MODRCVB:    EQU    0FFH        ;bit to test for recedive
  110. MODRCVR:    EQU    0FFH        ;value when ready
  111. MODSNDB:    EQU    0FFH        ;bit to test for send
  112. MODSNDR:    EQU    0FFH        ;value when ready
  113. ;
  114. ;
  115.         ORG    100H
  116. ;
  117. ;
  118. ; Change the clock speed to suit your system
  119. ;
  120.         DS    3    ;(for  "JMP   START" instruction)
  121. ;
  122. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  123. AUTODIAL:    DB    YES    ;yes=HAYES-type modem, no=other     104H
  124. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  125. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  126.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  127. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  128.                 ;6=2400 7=4800 8=9600 9=19200 default
  129. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  130.                 ;default time to send character in ter-
  131.                 ;minal mode file transfer for slow BBS.
  132. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  133.                 ;default time for extra wait after CRLF
  134.                 ;in terminal mode file transfer
  135. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  136. SETUPTST:    DB    NO    ;yes=user-added Setup routine        10BH
  137. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  138. RETRY:        DB    NO    ;yes=reset the error limit to try again 10DH
  139.                 ;no=resend a record after a valid-NAK
  140. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  141. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  142. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  143. CONVRUB:    DB    YES    ;yes=convert rub to backspace        111H
  144. TOGGLERUB:    DB    YES    ;yes=allow toggling of rub to backspace 112H
  145. BADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  146.                 ;terminal mode (added by remote echo)
  147. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  148. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  149.                 ;write logon sequence at location LOGON
  150. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  151. LOCONEXTCHR:    DB    YES    ;yes=local command if EXTCHR precedes    117H
  152.                 ;no=external command if EXTCHR precedes
  153. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  154. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  155. XOFFTST:    DB    YES    ;yes=checks for XOFF from remote while    11AH
  156.                 ;sending a file in terminal mode
  157. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  158.                 ;sending a file in terminal mode
  159. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  160. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  161. EXTRA1:        DB    0    ;for future expansion            11EH
  162. EXTRA2:        DB    0    ;for future expansion            11FH
  163. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  164. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  165. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  166. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  167. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  168. TRANCHR:    DB    'T'-40H    ;^T = Transmit file to remote        125H
  169. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  170. EXTCHR:        DB    '\'-40H    ;^\ = Send next character        127H
  171.                 ;changed to be closer to KERMIT (B.G.E)
  172. ;
  173. ;
  174.         DS    2        ;                128H
  175. ;
  176. IN$MODCTL1:    JMP    INCTL        ;in modem control port        12AH
  177.         DS    7
  178. OUT$MODDATP:    JMP    OUTDATA        ;out modem data port        134H
  179.         DS    7
  180. IN$MODDATP:    JMP    INDATA        ;in modem data port        13EH
  181.         DS    7
  182. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  183.  
  184. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  185. ANI$MODSNDB:    MVI    A,MODSNDB ! RET    ;bit to test for send ready    14EH
  186. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  187.         DS    6        ;Together these do nothing    156H
  188. ;
  189. OUT$MODCTL1:    RET ! NOP ! NOP        ;out modem control port #2    15AH
  190. OUT$MODCTL2:    RET ! NOP ! NOP        ;out modem control port #1    15DH
  191. ;
  192. LOGONPTR:    DW    LOGON        ;for user message.        160H
  193.         DS    6        ;                162H
  194. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  195. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  196.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  197.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  198.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  199. JMP$SETUPR:    JMP    SETUPR        ;                177H
  200. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  201. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  202. JMP$BREAK:    JMP    SENDBRK        ;                180H
  203. ;
  204. ;
  205. ; Do not change the following six lines.
  206. ;
  207. JMP$ILPRT:    DS    3        ;                183H
  208. JMP$INBUF    DS    3        ;                186H
  209. JMP$INLNCOMP:    DS    3        ;                189H
  210. JMP$INMODEM    DS    3        ;                18CH
  211. JMP$NXTSCRN:    DS    3        ;                18FH
  212. JMP$TIMER    DS    3        ;                192H
  213. ;
  214. ;
  215. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  216. ; SCRNTEST to YES at 010AH (above).
  217. ;
  218. CLREOS:    CALL    JMP$ILPRT    ;                195H
  219.     DB    ESC,'[','0','J',0;                198H
  220.     RET            ;                19DH
  221. ;
  222. CLRSCRN:JMP    DECVT100    ;                19EH
  223.     DB    0,0,0,0,0    ;                1A1H
  224.     RET            ;                1A6H
  225. ;
  226. SYSVER:    CALL    JMP$ILPRT    ;                1A7H
  227. XSO:    EQU    14        ;"shift out" character
  228. XSI:    EQU    15        ;"shift in" character
  229.     DB    'Version for: ',ESC,'[7m',ESC,')0'
  230.     DB    'd',XSO,'x',XSI
  231.     DB    'i',XSO,'x',XSI
  232.     DB    'g',XSO,'x',XSI
  233.     DB    'i',XSO,'x',XSI
  234.     DB    't',XSO,'x',XSI
  235.     DB    'a',XSO,'x',XSI
  236.     DB    'l',ESC,'[m '
  237. ;
  238.      IF ROBIN
  239.     DB    'DEC VT180 and external modem'
  240.      ENDIF                ;ROBIN
  241. ;
  242.      IF RAINBO1
  243.     DB    'DEC Rainbow V1 and external modem'
  244.      ENDIF                ;RAINBO1
  245. ;
  246.      IF RAINBO2
  247.     DB    'DEC Rainbow V2 and external modem'
  248.      ENDIF                ;RAINBO2
  249. ;
  250.      IF DECMATE
  251.     DB    'DECMATE II and external modem'
  252.      ENDIF                ;DECMATE
  253. ;
  254.     DB    CR,LF,0
  255.     RET
  256. ;.....
  257. ;
  258. ;
  259. ; Modem I/O primitive
  260. ;
  261. ; Subroutine to output a character to the modem.  This routine does it's
  262. ; own status checking.
  263. ;
  264. OUTDATA:PUSH    B        ;save...
  265.     PUSH    D        ;...the...
  266.     PUSH    H        ;...registers.
  267.     MOV    E,A        ;move output byte into E
  268.     MVI    C,PUNCH        ;use the BDOS function
  269.     CALL    BDOS        ;go
  270.     POP    H        ;restore...
  271.     POP    D        ;...the...
  272.     POP    B        ;...registers.
  273.     RET
  274. ;.....
  275. ;
  276. ;
  277. ; Subroutine to input a character from the modem.
  278. ; This routine will wait until one becomes available.
  279. ;
  280. INDATA:    PUSH    B        ;save...
  281.     PUSH    D        ;...the...
  282.     PUSH    H        ;...regesters.
  283.     MVI    C,READER    ;use the BDOS function
  284.     CALL    BDOS        ;go
  285.     POP    H        ;restore...
  286.     POP    D        ;...the...
  287.     POP    B        ;...registers.
  288.     RET
  289. ;.....
  290. ;
  291. ;
  292. ; Screen- Clearing needs more space than left above
  293. ;
  294. DECVT100:
  295.     CALL JMP$ILPRT
  296.     DB    ESC,'[','2','J',ESC,'[','H',0
  297.     RET
  298. ;
  299. ;
  300. ; The Check for characters at COMM-Port using I/O redirection
  301. ;
  302. IOBYTE    EQU    3        ;some definitions
  303. ;
  304.      IF RAINBO1 OR ROBIN
  305. DEFIO    EQU    95H        ;the "standard" setting
  306. BATIO    EQU    56H
  307.      ENDIF            ;RAINBO1 OR ROBIN
  308. ;
  309.      IF RAINBO2
  310. DEFIO    EQU    15H        ;the "standard" setting
  311. BATIO    EQU    96H
  312.      ENDIF            ;RAINBO2
  313. ;
  314.      IF DECMATE
  315. DEFIO    EQU    81H        ;the "standard" setting
  316. BATIO    EQU    42H
  317.      ENDIF            ;DECMATE
  318. ;
  319. INCTL:    PUSH    B
  320.     PUSH    D
  321.     PUSH    H        ;save the environment
  322.     MVI    A,BATIO        ;change I/O byte
  323.     STA    IOBYTE
  324.     CALL    BCONST        ;call BIOS direct - see INITMOD
  325.     PUSH    A
  326.     MVI    A,DEFIO        ;change I/O byte back
  327.     STA    IOBYTE
  328.     POP    A
  329.     POP    H        ;restore environment
  330.     POP    D
  331.     POP    B
  332.     RET
  333. ;.....
  334. ;
  335. ;
  336. ;-----------------------------------------------------------------------
  337. ;
  338. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  339. ;     end of your last routine should terminate by 0400H (601 bytes
  340. ;     available after start of SYSVER) if using the Hayes Smartmodem
  341. ;     or by address 0C00H (2659 bytes) otherwise.
  342. ;
  343. ;-----------------------------------------------------------------------
  344. ;
  345. ; You can put in a message at this location which can be called up with
  346. ; CTL-O if TRANLOGON has been set YES.    You can use several lines if
  347. ; desired.  End with a 0.
  348. ;
  349. LOGON:    DB    'How are you today?',CR,LF,0
  350. ;.....
  351. ;
  352. ;
  353. ; Add your own routine here to send a break tone to reset some time-
  354. ; share computers, if desired.
  355. ;
  356. SENDBRK:RET
  357. ;.....
  358. ;
  359. ;
  360. ; Add your own routine here to put DTR low and/or send a break tone.
  361. ; Check other routines such as MDM709DP.ASM which is using this feature.
  362. ;
  363. GOODBYE:RET
  364. ;.....
  365. ;
  366. ;
  367. ; You can use this area for any special initialization or setup you may
  368. ; wish to include.  Each must stop with a RET.    You can check the other
  369. ; available overlays for ideas how to write your own routines if that
  370. ; may be of some help.
  371. ;
  372. INITMOD:LHLD    1        ;Get BIOS jump-table adress
  373.     LXI    D,3
  374.     DAD    D        ;CONSTAT routine in BIOS
  375.     SHLD    BCONST+1    ;modify our "routine"
  376.     RET
  377. ;
  378. BCONST:    JMP    $-$        ;address "filled in" by above code
  379. ;
  380. SETUPR:    RET
  381. ;.....
  382. ;
  383. ;
  384. ; If using the Hayes Smartmodem this is unavailable without a special
  385. ; change.
  386. ;
  387. SPCLMENU: RET
  388. ;
  389. ;
  390. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  391. ;                 0C00H (without Smartmodem)
  392. ;.....
  393. ;
  394.       END
  395. ;
  396.