home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols100 / vol169 / m7vt-2.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  11.5 KB  |  363 lines

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