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 / M7NSP-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  11KB  |  327 lines

  1. ; M7NSP-1.ASM - NSC Starplex overlay file for MDM7xx    08/15/83
  2. ;
  3. ; You will want to look this file over carefully. There are a number of
  4. ; options that you can use to configure the program to suit your taste.
  5. ; This file adapts the NSC Starplex Development System to the modem pro-
  6. ; gram.  There are two versions of this program, determined by the selec-
  7. ; tion of the equate VAX.  This equate set YES sets the program up for a
  8. ; single baud rate option of 2400 baud for optimum performance with the
  9. ; system connected directly to a port on the DEC VAX 11/780.  This option
  10. ; requires special attention to setting up the Starplex 8253 baud rate
  11. ; clock counter.  The NOT VAX option sets up the program to operate as a
  12. ; normal Modem 711 program, with selection of either 300 or 1200 baud,
  13. ; as originally written.  This overlay program is an adaptation of one
  14. ; that was written for the Morrow Decision computer, using the 8251 USART.
  15. ;
  16. ; Edit this file for your preferences then follow the "TO USE:" example
  17. ; shown below.
  18. ;
  19. ; Use the "SET" command to change the baudrate when desired.  It starts
  20. ; out at 300 baud when the program is first called up.
  21. ;
  22. ;    TO USE: First edit this file filling in answers for your own
  23. ;        equipment.  Then assemble with ASM.COM or equivalent
  24. ;        assembler.  Then use DDT to overlay the the results
  25. ;        of this program to the original .COM file:
  26. ;
  27. ;        A>DDT MDM7xx.COM
  28. ;        DDT VERS 2.2
  29. ;        NEXT  PC
  30. ;        4x00 0100
  31. ;        -IM7NSP-1.HEX        (note the "I" command)
  32. ;        -R            ("R" loads in the .HEX file)
  33. ;        NEXT  PC
  34. ;        4x00 0000
  35. ;        -G0            (return to CP/M)
  36. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  37. ;
  38. ;                       ^
  39. ;                     Value may vary with version of MDM7xx
  40. ;
  41. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  42. ;
  43. ; 04/11/84 - Renamed to M7NSP-1.ASM            - Dennis Recla  
  44. ; 08/15/83 - Revised for use with MDM711 on the
  45. ;         NSC Starplex Development System -    - Charles Horn
  46. ;
  47. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  48. ;
  49. BELL:        EQU    07H        ;bell
  50. CR:        EQU    0DH        ;carriage return
  51. ESC:        EQU    1BH        ;escape
  52. LF:        EQU    0AH        ;linefeed
  53. ;
  54. YES:        EQU    0FFH
  55. NO:        EQU    0
  56. ;
  57. ;
  58. PORT:        EQU    0EEH        ;Starplex data port
  59. MODCTL1:    EQU    PORT+1        ;Modem status port
  60. MODDATP:    EQU    PORT        ;Modem data port
  61. MODCTL2:    EQU    PORT+1        ;Modem control port
  62. CLKPORT:    EQU    PORT-10H    ;Baud clock rate port
  63. MODRCVB:    EQU    2        ;bit to test for received data
  64. MODRCVR:    EQU    2        ;modem receive ready
  65. MODSNDB:    EQU    1        ;bit to test for ready to send
  66. MODSNDR:    EQU    1        ;modem send ready bit
  67. ;
  68. VAX:        EQU    NO        ;YES = for VAX ll/780; 2400 baud only
  69. ;
  70. ;
  71.         ORG    100H
  72. ;
  73.         DS    3    ;(for  "JMP   START" instruction)
  74. ;
  75. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  76. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  77. TOUCHPULSE:    DB    'T'    ;T=Touch, P=Pulse (Smartmodem-only)    105H
  78. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  79.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  80. MSPEED:     DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  81.                 ;6=2400 7=4800 8=9600 9=19200 default
  82. BYTDLY:     DB    0    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  83.                 ;default time to send character in ter-
  84.                 ;minal mode file transfer for slow BBS.
  85. CRDLY:        DB    0    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  86.                 ;default time for extra wait after CRLF
  87.                 ;in terminal mode file transfer
  88. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  89. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  90. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  91. ACKNAK:     DB    YES    ;yes=resend a record after any non-ACK    10DH
  92.                 ;no=resend a record after a valid NAK
  93. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  94. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  95. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  96. CONVBKSP:    DB    YES    ;yes=convert backspace to rub        111H
  97. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  98. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  99.                 ;terminal mode (added by remote echo)
  100. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  101. TRANLOGON:    DB    NO    ;yes=allow transmission of logon    115H
  102.                 ;write logon sequence at location LOGON
  103. SAVCCP:     DB    YES    ;yes=do not overwrite CCP        116H
  104. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  105.                 ;no=external command if EXTCHR precedes
  106. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  107. LSTTST:     DB    NO    ;no=no printer on printer port (modem)    119H
  108. XOFFTST:    DB    YES    ;yes=checks for XOFF from remote while    11AH
  109.                 ;sending a file in terminal mode
  110. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  111.                 ;sending a file in terminal mode
  112. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  113. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  114. EXTRA1:     DB    0    ;for future expansion            11EH
  115. EXTRA2:     DB    0    ;for future expansion            11FH
  116. BRKCHR:     DB    '@'-40H ;^@ = Send 300 ms. break tone        120H
  117. NOCONNCT:    DB    'N'-40H ;^N = Disconnect from phone line    121H
  118. LOGCHR:     DB    'O'-40H ;^O = Send logon            122H
  119. LSTCHR:     DB    'P'-40H ;^P = Toggle printer            123H
  120. UNSAVE:     DB    'R'-40H ;^R = Close input text buffer        124H
  121. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  122. SAVECHR:    DB    'Y'-40H ;^Y = Open input text buffer        126H
  123. EXTCHR:     DB    '^'-40H ;^^ = Send next character        127H
  124. ;
  125. ;
  126.         DS    2        ;                128H
  127. ;
  128. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  129.         DS    7
  130. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  131.         DS    7
  132. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  133.         DS    7
  134. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    148H
  135. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  136. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    14EH
  137. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  138.         DS    12
  139. ;
  140. LOGONPTR:    DW    LOGON        ;for user message.        160H
  141.         DS    6        ;                162H
  142. JMP$GOODBYE:    JMP    GOODBYE     ;                168H
  143. JMP$INITMOD:    JMP    INITMOD     ;go to user written routine    16BH
  144.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  145.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  146.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  147. JMP$SETUPR:    JMP    SETUPR        ;                177H
  148. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  149. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  150. JMP$BREAK:    JMP    SENDBRK     ;                180H
  151. ;
  152. ;
  153. ; Do not change the following six lines.
  154. ;
  155. JMP$ILPRT:    DS    3        ;                183H
  156. JMP$INBUF    DS    3        ;                186H
  157. JMP$INLNCOMP:    DS    3        ;                189H
  158. JMP$INMODEM    DS    3        ;                18CH
  159. JMP$NXTSCRN:    DS    3        ;                18FH
  160. JMP$TIMER:    DS    3        ;                192H
  161. ;
  162. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  163. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  164. ; The SCRNTST option must be set "YES" for these to work.  These are now
  165. ; set for the NSC Starplex Development System.
  166. ;
  167. CLREOS:     CALL    JMP$ILPRT    ;                195H
  168.         DB    0,0,0,0,0    ;                198H
  169.         RET            ;                19DH
  170. ;
  171. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  172.         DB    0,0,0,0,0    ;                1A1H
  173.         RET            ;                1A6H
  174. ;
  175. ;
  176. SYSVER:     CALL    JMP$ILPRT    ;                1A7H
  177.         DB    'Version for NSC Starplex Development System'
  178.         DB    CR,LF,0
  179.         RET
  180. ;.....
  181. ;
  182. ;
  183. ;-----------------------------------------------------------------------
  184. ;
  185. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  186. ;     end of your last routine should terminate by 0400H (601 bytes
  187. ;     available after start of SYSVER) if using the Hayes Smartmodem
  188. ;     or by address 0C00H (2659 bytes) otherwise.
  189. ;
  190. ;-----------------------------------------------------------------------
  191. ;
  192. ; You can put in a message at this location which can be called up with
  193. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  194. ; desired.  End with a 0.
  195. ;
  196. ;
  197. LOGON:      DB    'This is a Dummy Logon Message',CR,LF,0
  198. ;.....
  199. ;
  200. ;
  201. ;=======================================================================
  202. ;
  203. ; This routine allows a 300 ms. break tone to be sent to reset some
  204. ; time-share computer.
  205. ;
  206. SENDBRK:  MVI    A,1FH        ;SEND BREAK TONE
  207.       JMP    GOODBYE1
  208. ;...
  209. ;
  210. ;
  211. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  212. ; length of time to disconnect some modems such as the Bell 212A, etc.
  213. ;
  214. GOODBYE:  MVI    A,15H        ;SEND BREAK, TURN OFF DTR
  215. ;
  216. GOODBYE1: OUT    MODCTL1     ;SEND TO STATUS PORT
  217.       MVI    B,3        ;WAIT 300 MS.
  218.       CALL    JMP$TIMER
  219.       MVI    A,07H        ;NORMAL SEND/RECEIVE WITH DTR
  220.       OUT    MODCTL1     ;SEND TO STATUS PORT
  221.       RET
  222. ;.....
  223. ;
  224. ;
  225. ; USART initialization -- sets the 8251A for 8 bits, 1 stop pulse,
  226. ; DTR high, using the Starplex RS-232 port no. 2, to 1200 baud then
  227. ; divides by 64 for 300, or by 16 for 1200 baud via "SET" command.  Set
  228. ; at present to default to 300 baud. The VAX option is fixed at 2400 baud.
  229. ;
  230. INITMOD:  MVI    A,1        ;TRANSFER TIME FOR 300 BAUD
  231.       STA    MSPEED    
  232.       DI            ;DISABLE INTERRUPTS FOR THIS
  233.       XRA    A
  234.       MVI    B,4        ;INSURE
  235. OUTMODE:  OUT    MODCTL1     ;..OUT
  236.       DCR    B        ;....OF
  237.       JNZ    OUTMODE     ;......MODE
  238.       MVI    A,40H        ;RESET UART AND
  239.       OUT    MODCTL1     ;..SET TO MODE
  240. ;
  241. INITMOD1:
  242.       IF    VAX        ;VAX 11/780
  243.       MVI    A,4EH        ;DIVIDE BY 16
  244.       ENDIF ;VAX
  245.       IF    NOT VAX     ;NORMAL MODEM711
  246.       MVI    A,4FH        ;DEFAULT TO DIVIDE BY 64 FOR 300 BAUD
  247.       ENDIF ;NOT VAX
  248.       OUT    MODCTL1     ;SET MODE
  249.       MVI    A,37H        ;RTS,RESET ERR FLAGS,DTR,RX&TX ENABLE
  250.       OUT    MODCTL1     ;MODEM STATUS PORT
  251.       IN    MODDATP     ;CLEAR
  252.       IN    MODDATP     ;..GARBAGE
  253. ;
  254.       MVI    A,0B6H        ;TIMER 2 MODE
  255.       OUT    CLKPORT+1
  256.       IF    VAX
  257.       MVI    A,30H        ;LS BYTE FOR 2400 BAUD
  258.       ENDIF ;VAX
  259.       IF NOT VAX
  260.       MVI    A,60H        ;NORMAL STARPLEX DIVISOR
  261.       ENDIF ;NOT VAX
  262.       OUT    CLKPORT
  263.       MVI    A,00H        ;MS BYTE FOR BAUD DIVISOR
  264.       OUT    CLKPORT
  265.       EI            ;ENABLE INTERRUPTS
  266.       RET
  267. ;.....
  268. ;
  269. SETUPR:
  270.       IF    VAX
  271.       CALL    JMP$ILPRT
  272.       DB    'Baud Rate is fixed at 2400 for VAX 11/780...',CR,LF,0
  273.       JMP    INITMOD     ;NONE OF THE FOLLOWING FOR VAX
  274.       ENDIF ;VAX
  275.       IF    NOT VAX
  276.       LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  277.       CALL    JMP$ILPRT
  278.       DB    'Input Baud Rate (300, 1200): ',0
  279.       CALL    JMP$INBUF
  280.       LXI    D,BAUDBUF+2
  281.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  282.       DB    '300',0
  283.       JNC    OK300        ;GO IF GOT MATCH
  284.       CALL    JMP$INLNCOMP
  285.       DB    '1200',0
  286.       JNC    OK1200
  287.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  288.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  289.       JMP    SETUPR        ;TRY AGAIN
  290. ;
  291. OK300:      MVI    A,1        ;MSPEED 300 BAUD VALUE
  292.       MVI    B,4FH        ;DIVIDE BY 64 FOR 300 BAUD
  293.       JMP    LOADBD        ;GO LOAD THEM
  294. ;
  295. OK1200:   MVI    A,5
  296.       MVI    B,4EH        ;DIVIDE BY 16 FOR 1200 BAUD
  297. ;
  298. ;
  299. LOADBD:   STA    INITMOD+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  300.       MOV    A,B        ;GET BAUDRATE BYTE
  301.       STA    INITMOD1+1    ;STORE IN INITMOD
  302.       JMP    INITMOD     ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  303.       ENDIF ;NOT VAX
  304. ;
  305. ;
  306. BAUDBUF:  DB    10,0
  307.       DS    10
  308. ;.....
  309. ;
  310. ;
  311. ;           (END OF INITMOD AND SETUP ROUTINES)
  312. ;=======================================================================
  313. ;        
  314. ;
  315. ; These routines can be used for your equipment, be sure to end with RET
  316. ;
  317. SPCLMENU: RET
  318. ;        
  319. ;=======================================================================
  320. ;
  321. ;
  322. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  323. ;                 0C00H (without Smartmodem).
  324. ;
  325.       END
  326. ;
  327.