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 / M7VG-1.AQM / M7VG-1.ASM
Assembly Source File  |  2000-06-30  |  15KB  |  427 lines

  1. ; M7VG-1.ASM -- Vector Graphic overlay file for MDM7xx 
  2. ; 01/08/84
  3. ;
  4. ; This overlay will assemble to operate MDM7xx with a Vector 3 or 4 
  5. ; with an external modem driven by the Vector's RS-232 modem port.  You will 
  6. ; want to look this file over carefully. There  are a number of options 
  7. ; that you can use to configure the program to suit your taste.  Much of 
  8. ; the information contained here is not in the main file.
  9. ;
  10. ; The source can be modified from the syntax of the ASM assembler that comes 
  11. ; with most CP/M systems to that of the ZSM assembler that comes with 
  12. ; Vector CP/M systems in four steps:
  13. ;
  14. ;  -globally replace all occurrences of the character $ (dollar sign) with
  15. ;   the character _ (underscore)
  16. ;
  17. ;  -globally replace all occurrences of the string DB<HT>' (DB followed 
  18. ;   by an ASCII HT (09h,^I) followed by a single quote) with DT<HT>' 
  19. ;   (ZSM requires the psuedo-op DT for strings of >1 character)
  20. ;
  21. ;  -globally replace all occurrences of IF<HT>NOT VECTOR4 with 
  22. ;   IFF<HT>VECTOR4 and all IF<HT>VECTOR4 with IFT<HT>VECTOR4
  23. ;
  24. ;  -delete the last line in the file (ZSM doesn't need an END pseudo-op)
  25. ;
  26. ; On a Vector 4, the program will come up running at 1200 baud, which can 
  27. ; be changed using the "SET" command or by changing the equates before 
  28. ; assembling.  On a Vector 3, the program will come up at whatever baud 
  29. ; rate has been set by the hardware switches.
  30. ;
  31. ; It is currently set up for a Vector 4.  To assemble for a Vector 3, change
  32. ; the VECTOR4 equate to NO and the clock and baud bytes appropriately. 
  33. ; The Vector 4 appears to scroll the screen just slowly enough to cause
  34. ; a couple of missed characters at the start of each line when operating at
  35. ; 1200 baud.  This can be fixed by using whatever command the system you
  36. ; are communicating with accepts to tell it to insert a short delay between 
  37. ; lines as it transmits.
  38. ;
  39. ; Edit this file for your preferences then follow the "TO USE:" example
  40. ; shown below.
  41. ;
  42. ;       TO USE: First edit this file filling in answers for your own
  43. ;               equipment.  Then assemble with ASM.COM or equivalent
  44. ;               assembler.  Then use DDT to overlay the the results
  45. ;               of this program to the original .COM file:
  46. ;
  47. ;               A>DDT MDM7xx.COM
  48. ;               DDT VERS 2.2
  49. ;               NEXT  PC
  50. ;               4300 0100
  51. ;               -IM7VG-1.HEX            (note the "I" command)
  52. ;               -R                      ("R" loads in the .HEX file)
  53. ;               NEXT  PC
  54. ;               4300 0000
  55. ;               -G0                     (return to CP/M)
  56. ;               A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  57. ;
  58. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  59. ; 01/08/84 - Modified for Vector 3 and 4     - Ross Alford
  60. ;                          ...duke!ecsvax!alford
  61. ; 11/10/83 - Modified for Vector 4 computers    - Loren Cook
  62. ; 07/27/83 - Renamed to work with MDM712           - Irv Hoff
  63. ; 07/01/83 - Revised to work with MDM711           - Irv Hoff
  64. ; 06/22/83 - Revised to work with MDM710           - Irv Hoff
  65. ; 05/25/83 - Updated to work with MDM709           - Irv Hoff
  66. ; 05/15/83 - Revised to work with MDM708           - Irv Hoff
  67. ; 04/11/83 - Updated to work with MDM707           - Irv Hoff
  68. ; 04/04/83 - Updated to work with MDM706           - Irv Hoff
  69. ; 02/27/83 - Updated to work with MDM705           - Irv Hoff
  70. ; 02/17/83 - Modified MDM703CF for Datapoint
  71. ;            1560 computers using an exter-
  72. ;            nal modem                              - Irv Hoff
  73. ;
  74. ;
  75. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  76. ;
  77. BELL:        EQU    07H        ;bell
  78. CR:        EQU    0DH        ;carriage return
  79. ESC:        EQU    1BH        ;escape
  80. LF:        EQU    0AH        ;linefeed
  81. ;
  82. YES:        EQU    0FFH
  83. NO:        EQU    0
  84. ;
  85. PORT:           EQU     04H             ;Vector Graphic modem data port
  86. MODCTL1:        EQU     PORT+1          ;Modem status port
  87. MODCTL2:        EQU     PORT+1          ;Modem control port
  88. MODDATP:        EQU     PORT            ;Modem data port
  89. ;
  90. VECTOR4        EQU    YES        ;assemble for Vector 4
  91. ;
  92.         ORG    100H
  93. ;
  94.         DS    3    ;(for  "JMP   START" instruction)
  95. ;
  96.  
  97. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  98. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem            104H
  99. TONEPULSE:    DB     'T'    ;T=tone, P=Pulse (Smartmodem-only)    105H
  100. CLOCK:        DB    51    ;clock speed in MHz x10, 25.5 MHz max.    106H
  101.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  102. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  103.                 ;6=2400 7=4800 8=9600 9=19200 default
  104. BYTDLY:        DB    0    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  105.                 ;default time to send character in ter-
  106.                 ;minal mode file transfer for slow BBS.
  107. CRDLY:        DB    0    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  108.                 ;default time for extra wait after CRLF
  109.                 ;in terminal mode file transfer
  110. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  111. ;
  112. ; baud change routine available for Vector 4
  113. ;
  114.         IF    VECTOR4    
  115. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  116.         ENDIF
  117. ;
  118. ; no baud change for Vector 3
  119. ;
  120.         IF    NOT VECTOR4
  121. SETUPTST:    DB    NO    ;no=no user-added Setup routine        10BH
  122.         ENDIF
  123. ;
  124. SCRNTEST:    DB    YES    ;cursor control routine         10CH
  125. ACKNAK:        DB    YES    ;yes=resend a record after a non-ACK    10DH
  126.                 ;no=resend a record only after NAK
  127. BAKKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  128. CRCDFLT:    DB    NO    ;yes=default to CRC checking        10FH
  129. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  130. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  131. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  132. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  133.                 ;terminal mode (added by remote echo)
  134. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  135. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  136.                 ;write logon sequence at location LOGON
  137. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  138. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  139.                 ;no=external command if EXTCHR precedes
  140. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  141. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  142. XOFFTST:    DB    YES    ;yes=chcks for XOFF from remote    while    11AH
  143.                 ;sending a file in terminal mode
  144. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  145.                 ;sending a file in terminal mode
  146. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  147. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  148. EXTRA1:        DB    0    ;for future expansion            11EH
  149. EXTRA2:        DB    0    ;for future expansion            11FH
  150. ;
  151. BRKCHR        DB     'B'-40H    ;Send a 300 ms. break tone        120H
  152. NOCONNCT:    DB     'N'-40H    ;^N = Disconnect from phone line    121H
  153. LOGCHR:        DB     'L'-40H    ;^L = Send logon            122H
  154. LSTCHR:        DB     'P'-40H    ;^P = Toggle printer            123H
  155. UNSAVE:        DB     'R'-40H    ;^R = Close input text buffer        124H
  156. TRANCHR:    DB     'T'-40H ;^T = Transmit file to remote        125H
  157. SAVECHR:    DB     'Y'-40H    ;^Y = Open input text buffer        126H
  158. EXTCHR:        DB     '\'-40H    ;^\ = Send next character        127H
  159. ;
  160.                 DS      2               ;                               128H
  161. ;
  162. IN$MODCTL1:     IN      MODCTL1         ;in modem control port          12AH
  163.         RET
  164.                 DS      7
  165. OUT$MODDATP:    OUT     MODDATP     ;out modem data port            134H
  166.         RET
  167.                 DS      7
  168. IN$MODDATP:     IN      MODDATP     ;in modem data port             13EH
  169.         RET
  170.                 DS      31
  171. ;
  172. LOGONPTR:       DW      LOGON           ;for user message.              160H
  173.                 DS      6               ;                               162H
  174. JMP$GOODBYE:    JMP     GOODBYE         ;                               168H
  175. JMP$INITMOD:    JMP     INITMOD         ;go to user written routine     16BH
  176.                 RET              ;(by-passes PMMI routine)       16EH
  177.         NOP
  178.         NOP
  179.                 RET            ;(by-passes PMMI routine)       171H
  180.         NOP
  181.         NOP
  182.                 RET            ;(by-passes PMMI routine)       174H
  183.         NOP
  184.         NOP
  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. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  201. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  202. ;
  203. CLREOS:        CALL    JMP$ILPRT    ;                 195H
  204.         DB    010H,0,0,0,0    ;Vector clr to end of scrn    198H
  205.         RET            ;                19DH
  206. ;
  207. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  208.         DB    04H,0,0,0,0    ;Vector clear screen           1A1H
  209.         RET            ;                1A6H
  210. ;
  211. ;
  212. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  213. ;
  214.         IF    VECTOR4
  215.         DB    'Version for Vector 4 '    
  216.         ENDIF
  217. ;
  218.         IF    NOT VECTOR4
  219.         DB    'Version for Vector 3 '
  220.         ENDIF
  221. ;
  222.         DB    CR,LF,0
  223.         RET
  224. ;.....
  225. ;
  226. ;
  227. ;-----------------------------------------------------------------------
  228. ;    
  229. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  230. ;     end of your last routine should terminate by 0400H (601 bytes
  231. ;     available after start of SYSVER) if using the Hayes Smartmodem
  232. ;     or by address 0C00H (2659 bytes) otherwise.
  233. ;
  234. ;-----------------------------------------------------------------------
  235. ;
  236. ; You can put in a message at this location which can be called up with
  237. ; CTL-O if TRANLOGON has been set YES.  You can put in several lines if
  238. ; desired.  End with a 0.
  239. ;
  240. LOGON:        DB    'This is a Vector computer',CR,LF,0
  241. ;
  242. ;=======================================================================
  243. ;
  244. ; This routine allows a 300 ms. break tone to be sent to reset some
  245. ; time-share computers.
  246. ;
  247. SENDBRK:    MVI    A,1FH
  248.         JMP    GOODBYE1
  249. ;.....
  250. ;
  251. ;
  252. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  253. ; length of time to disconnect some modems such as the Bell 212A, etc.
  254. ;
  255. GOODBYE:    MVI    A,15H        ;Send break, turn off DTR
  256. ;
  257. GOODBYE1:    OUT    MODCTL1        ;Send to status port
  258.           MVI    B,3        ;Delay about 300 ms
  259.           CALL    JMP$TIMER
  260.           MVI    A,07H        ;Normal send/receive with DTR
  261.           OUT    MODCTL1        ;Send to status port
  262.           RET
  263. ;
  264. ;------------------------------------------------------------------------
  265. ; initialization routines
  266. ;
  267. ; just initialize the 8251 USART on a Vector 3
  268. ;
  269.         IF    NOT VECTOR4
  270. INITMOD:      MVI       A,40H        ;internal 8251 reset
  271.               OUT       MODCTL1
  272.           MVI       A,4EH        ;8data, 1 stop, no parity, 16X baud
  273.           OUT       MODCTL1
  274.               MVI       A,07H           ;normal command start
  275.               OUT       MODCTL1
  276.               RET
  277.         ENDIF            ;vector 3 initialization
  278. ;
  279. ; Set baud rate and initialize 8251 if Vector 4
  280. ;
  281.         IF    VECTOR4
  282. ;
  283. ; Vector 4 specific equates for initialization.
  284. ;
  285.     
  286. CTCCMD:        EQU    13H        ;8253 Timer control/status port
  287. CTC1:        EQU    11H        ;Timer (1) port 011H
  288. LSBAUD:          EQU    68H        ;Default 1200 baud(LSB)
  289. MSBAUD:          EQU    00H        ;Default 1200 baud(MSB)
  290. ;
  291. ;
  292. ; Vector 4 initialization -- sets CTC timer for baudrate in/out.
  293. ;.....
  294. INITMOD:      MVI    A,5        ;Default transfer time to 1200 baud
  295.           STA    MSPEED
  296. ;
  297. INITMOD1:     MVI    A,76H        ;Select Timer (1)
  298.           OUT    CTCCMD
  299. ;
  300. LSBD:          MVI    A,LSBAUD    ;Send LSB of baud rate
  301.           OUT    CTC1  
  302. ;
  303. MSBD:          MVI    A,MSBAUD    ;Send MSB of baud rate
  304.           OUT    CTC1
  305. ;
  306. ; set up USART with data format
  307. ;
  308.         MVI       A,40H        ;internal 8251 reset
  309.               OUT       MODCTL1
  310.           MVI       A,4EH        ;8data, 1 stop, no parity, 16X baud
  311.           OUT       MODCTL1
  312.               MVI       A,07H           ;normal command start
  313.               OUT       MODCTL1
  314.               RET
  315.         ENDIF            ;conditional Vector 4 initialization
  316. ;
  317. ;------------------------------------------------------------------------
  318. ; setup routines
  319. ;
  320. ; if Vector 3, no user setup routine
  321. ;
  322.         IF    NOT VECTOR4
  323. SETUPR:        RET
  324.         ENDIF
  325. ;
  326. ; if Vector 4, setup routine for baud rate
  327. ;
  328.         IF    VECTOR4
  329. SETUPR:          LXI    D,BAUDBUF    ;Point to new input buffer
  330.           CALL    JMP$ILPRT
  331.           DB    'Input Baud Rate (300, 600, 1200, 2400, '
  332.           DB    '4800, 9600): '
  333.         DB    0
  334.           CALL    JMP$INBUF
  335.           LXI    D,BAUDBUF+2
  336.           CALL    JMP$INLNCOMP    ;Compare BAUDBUF+2 with chars below
  337.           DB    '300'
  338.         DB    0
  339.           JNC    OK300        ;Go if got match
  340.           CALL    JMP$INLNCOMP
  341.           DB    '600'
  342.         DB    0
  343.           JNC    OK600
  344.           CALL    JMP$INLNCOMP
  345.           DB    '1200'
  346.         DB    0
  347.           JNC    OK1200
  348.           CALL    JMP$INLNCOMP
  349.           DB    '2400'
  350.         DB     0
  351.           JNC    OK2400
  352.           CALL    JMP$INLNCOMP
  353.           DB    '4800'
  354.         DB    0
  355.           JNC    OK4800
  356.           CALL    JMP$INLNCOMP
  357.           DB    '9600'
  358.         DB     0
  359.           JNC    OK9600
  360.           CALL    JMP$ILPRT    ;All matches failed, tell operator
  361.           DB    '++ Incorrect entry ++'
  362.         DB    CR,LF,BELL,0
  363.           JMP    SETUPR        ;Try again
  364. ;
  365. OK300:          MVI    A,1        ;MSPEED 300 baud value
  366.           LHLD    BD300        ;Get 300 baud parameters in 'HL'
  367.           JMP    LOADBD        ;Go load them
  368. ;
  369. OK600:        MVI    A,3
  370.           LHLD      BD600
  371.           JMP    LOADBD
  372. ;
  373. OK1200:          MVI    A,5
  374.           LHLD    BD1200
  375.           JMP       LOADBD
  376. ;
  377. OK2400:          MVI    A,6
  378.           LHLD    BD2400
  379.           JMP    LOADBD
  380. ;
  381. OK4800:          MVI    A,7
  382.           LHLD      BD4800
  383.           JMP    LOADBD
  384. ;
  385. OK9600:          MVI    A,8
  386.           LHLD    BD9600
  387.           JMP    LOADBD
  388. ;
  389. LOADBD:          STA    INITMOD+1    ;Change time-to-send to match baudrate
  390.           MOV    A,L        ;Get least significant baudrate byte
  391.           STA    LSBD+1        ;Store in INITMOD
  392.           MOV    A,H        ;Get most significant baudrate byte
  393.           STA    MSBD+1        ;Store in INITMOD
  394.           JMP    INITMOD        ;Reinitialize to new baudrate, then done
  395. ;
  396. ;
  397. ; TABLE OF BAUDRATE PARAMETERS
  398. ;
  399. BD300:          DW    01A1H        ;  300 Baud
  400. BD600:          DW    00D0H        ;  600 Baud
  401. BD1200:          DW    0068H        ; 1200 Baud
  402. BD2400:          DW    0034H        ; 2400 Baud
  403. BD4800:          DW    001AH        ; 4800 Baud
  404. BD9600:          DW    000DH        ; 9600 Baud
  405. ;
  406. BAUDBUF:      DB    10,0
  407.           DS    10
  408.         ENDIF            ;Vector 4 SET routine for baud rate
  409. ;
  410. ;           (END OF INITMOD AND SETUP ROUTINES)
  411. ;=======================================================================
  412. ;        
  413. ;
  414. ; These routines can be used for your equipment, be sure to end with RET
  415. ; If using the Hayes Smartmodem this is unavailable without a special
  416. ; change.
  417. ;
  418. SPCLMENU: RET
  419. ;        
  420. ;=======================================================================
  421. ;
  422. ;
  423. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  424. ;                                0BC0H (without Smartmodem)
  425. ;
  426.       END
  427.