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 / M7NC-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  314 lines

  1.  
  2. ; M7NC-1.ASM -- NCR DECISION MATE V overlay 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. ;
  7. ; Edit this file for your preferences then follow the "TO USE:" example
  8. ; shown    below.
  9. ;
  10. ; Use the MDM7xx "SET" command to change the baudrate when desired.  It
  11. ; starts out at 300 baud when the program is first called up.
  12. ;
  13. ;
  14. ;    TO USE:    First edit this file filling in answers for your own
  15. ;        equipment.  Then assemble with ASM.COM or equivalent
  16. ;        assembler.  Then use DDT to overlay the the results
  17. ;        of this    program to the original .COM file:
  18. ;
  19. ;=============================================================================
  20. ;
  21. ;NOTE:     The use of the MDMLNK.COM utility makes the following process much
  22. ;     simpler.  You may want to use MDMLNK if it is available to you.
  23. ;
  24. ;=============================================================================
  25. ;
  26. ;        A>DDT MDM7xx.COM
  27. ;        DDT VERS 2.2
  28. ;        NEXT  PC
  29. ;        4A00 0100
  30. ;        -IM7xx-x.HEX        (note the "I" command)
  31. ;        -R            ("R" loads in the .HEX file)
  32. ;        NEXT  PC
  33. ;        4A00 0000
  34. ;        -G0            (return    to CP/M)
  35. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  36. ;
  37. ; =   =      =   =      =   =      =   =   =   =   =   =   =   =   =   =   =   =
  38. ;
  39. ; 07/01/84 - Slight changes for MDM740        - Robert Flagg
  40. ;         Renamed from M7DMV.ASM to avoid
  41. ;         confusion with the Dynabyte Monarch
  42. ;         overlay (M7DM-1.ASM)
  43. ; 05/30/84 - Renamed to M7DMV.ASM for use with
  44. ;         NCR DMV                - Mark Stamos
  45. ; 11/11/83 - Renamed to M7HZ-1.ASM, no changes    - Irv Hoff    
  46. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  47. ; 02/17/83 - Modified MDM703CF to work with
  48. ;         Heath/Zenith -100 series com-
  49. ;         puters with 2661B I/O        - Irv Hoff
  50. ;
  51. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  52. ;
  53. BELL:        EQU    07H        ;bell
  54. CR:        EQU    0DH        ;carriage return
  55. ESC:        EQU    1BH        ;escape
  56. LF:        EQU    0AH        ;linefeed
  57. ;
  58. YES:        EQU    0FFH
  59. NO:        EQU    0
  60. ;
  61. ;
  62. MODDAT:        EQU    070H        ;data port for NCR DMV
  63. MODSTAT:    EQU    071H        ;STATUS PORT
  64. MODMODE:    EQU    072H        ;MODE REGISTER PORT
  65. MODCMD:        EQU    073H        ;COMMAND PORT
  66. WRITE:        EQU    004H        ;ADDED TO PORT ADDR FOR WRITE
  67. MODRCVB:    EQU    2        ;BIT TO TEST FOR INPUT DATA
  68. MODRCVR:    EQU    2        ;modem receive ready
  69. MODSNDB:    EQU    1        ;bit to test for ready to send
  70. MODSNDR:    EQU    1        ;modem send ready bit
  71. ;
  72. ;
  73.         ORG    100H
  74. ;
  75.         DS    3    ;(for  "JMP   START" instruction)
  76. ;
  77. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  78. AUTODIAL:    DB    NO    ;yes=HAYES-type modem            104H
  79. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  80. CLOCK:        DB    20    ;clock speed in MHz x10, 25.5 MHz max.    106H
  81.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  82. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  83.                 ;6=2400    7=4800 8=9600 9=19200 default
  84. BYTDLY:        DB    0    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  85.                 ;default time to send character in ter-
  86.                 ;minal mode file transfer for slow BBS.
  87. CRDLY:        DB    0    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  88.                 ;default time for extra wait after CRLF
  89.                 ;in terminal mode file transfer
  90. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  91. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  92. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  93. RETRY:        DB    NO    ;yes=reset the error limit to try again 10DH
  94.                 ;no=abort after 10 consecutive errors
  95. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  96. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  97. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  98. CONVRUB:    DB    YES    ;yes=rub to backspace            111H
  99. TOGGLERUB:    DB    YES    ;yes=allow toggling rub to backspace    112H
  100. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  101.                 ;terminal mode (added by remote echo)
  102. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  103. TRANLOGON:    DB    NO    ;yes=allow transmission of logon    115H
  104.                 ;write logon sequence at location LOGON
  105. SAVCCP:        DB    YES    ;yes=do    not overwrite CCP        116H
  106. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  107.                 ;no=external command if EXTCHR precedes
  108. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  109. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  110. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  111.                 ;sending a file in terminal mode
  112. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  113.                 ;sending a file in terminal mode
  114. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  115. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  116. EXTRA1:        DB    0    ;for future expansion            11EH
  117. EXTRA2:        DB    0    ;for future expansion            11FH
  118. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone     120H
  119. NOCONNCT:    DB    'L'-40H    ;^L = Disconnect from the phone line    121H
  120. LOGCHR:        DB    'N'-40H    ;^N = Send logon            122H
  121. LSTCHR:        DB    'P'-40H    ;^P = TOGGLE PRINTER            123H
  122. UNSAVE:        DB    'R'-40H    ;^R = close text buffer            124h
  123. TRANCHR:    DB    'T'-40H    ;^T = Transmit file to remote        125H
  124. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        125H
  125. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        126H
  126. ;
  127. ;
  128.         DS    2        ;                128H
  129. ;
  130. IN$MODCTL1:    IN    MODSTAT    ! RET    ;in modem control port        12AH
  131.         DS    7
  132. OUT$MODDATP:    OUT    MODDAT+4! RET    ;out modem data port        134H
  133.         DS    7
  134. IN$MODDATP:    IN    MODDAT    ! RET    ;in modem data port        13EH
  135.         DS    31
  136. ;
  137. LOGONPTR:    DW    LOGON        ;for user message.        160H
  138.         DS    6        ;                162H
  139. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  140. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  141.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  142.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  143.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  144. JMP$SETUPR:    JMP    SETUPR        ;                177H
  145. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  146. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  147. JMP$BREAK:    JMP    SENDBRK        ;                180H
  148. ;
  149. ;
  150. ; Do not change the following six lines.
  151. ;
  152. JMP$ILPRT:    DS    3        ;                183H
  153. JMP$INBUF    DS    3        ;                186H
  154. JMP$INLNCOMP:    DS    3        ;                189H
  155. JMP$INMODEM    DS    3        ;                18CH
  156. JMP$NXTSCRN:    DS    3        ;                18FH
  157. JMP$TIMER:    DS    3        ;                192H
  158. ;
  159. ;
  160. CLREOS:        CALL    JMP$ILPRT    ;                195H
  161.         DB    ESC,'Y',0,0,0    ;                198H
  162.         RET            ;                19DH
  163. ;
  164. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  165.         DB    ESC,':',0,0,0    ;CLEAR ENTIRE SCREEN        1A1H
  166.         RET            ;                1A6H
  167. ;
  168. ;
  169. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  170.         DB    0BH,CR
  171.         DB    'Version for NCR Decision Mate V with K211 interface'
  172.         DB    CR,LF,0
  173.         DB    RET
  174. ;.....
  175. ;
  176. ;
  177. ;-----------------------------------------------------------------------
  178. ;
  179. ; NOTE:     You can change the SYSVER message to be longer or shorter.  The
  180. ;     end of    your last routine should terminate by 0400H (601 bytes
  181. ;     available after start of SYSVER) if using the Hayes Smartmodem
  182. ;     or by address 0C00H (2659 bytes available) otherwise.
  183. ;
  184. ;-----------------------------------------------------------------------
  185. ;
  186. ; You can put in a message at this location which can be called up with
  187. ; CTL-O    if TRANLOGON has been set YES.    You can put in several lines if
  188. ; desired.  End with a 0.
  189. ;
  190. LOGON:      DB    'this is the place for your message',CR,LF,0
  191. ;.....
  192. ;    
  193. ;
  194. ; This routine allows a 300 ms. break tone to be send to reset some
  195. ; time-share computers.
  196. ;
  197. SENDBRK:  MVI    A,1DH        ;SEND A BREAK TONE FOR 300 MS.
  198.       JMP    GOODBYE1
  199. ;.....
  200. ;
  201. ;
  202. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  203. ; length of time to disconnect some modems such as the Bell 212A, etc.
  204. ;
  205. GOODBYE:  MVI    A,05H        ;SET BREAK, DTR LOW
  206. ;
  207. GOODBYE1: OUT    MODCMD+4    ;PUT COMMAND REGISTER OUT OF MODE
  208.       IN    MODCMD        ;MAKE SURE IT IS NOW CLEAR
  209.       IN    MODCMD        ;TRY ONCE MORE
  210.       MVI    B,3        ;DELAY FOR 300 MS.
  211.       CALL    JMP$TIMER
  212.       MVI    A,37H        ;RESET RTS, FLAGS, DTR LOW, ENABLE R/T
  213.       OUT    MODCMD+4    ;SEND TO COMMAND REGISTER
  214.       IN    MODCMD        ;CLEAR ANY INCOMING CHARS.
  215.       IN    MODCMD        ;TRY ONCE MORE
  216.       XRA    A        ;CLEAR THE 'A' REG.
  217.       RET
  218. ;.....
  219. ;
  220. ;
  221. ; The following are used in setting up the 2651B I/O port.
  222. ;
  223. INITMOD:  MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  224.       STA    MSPEED
  225.       XRA    A        ;SET RTS, FLAGS, DTR, DISABLE R/T
  226.       OUT    MODCMD+4    ;PUT COMMAND REGISTER OUT OF MODE
  227.       IN    MODCMD        ;MAKE SURE IT IS NOW CLEAR
  228.       IN    MODCMD        ;TRY ONCE MORE
  229.       MVI    A,4EH        ;1 STOP, NO PARITY, 8 BITS, 16X ASYNCH
  230.       OUT    MODMODE+4    ;SEND TO MODE REGISTER 1
  231. ;
  232. INITMOD1: MVI    A,0F5H        ;START WITH 300 BAUD, INTERNAL 5.0 CLOCK
  233.       OUT    MODMODE+4    ;SEND TO MODE REGISTER 2
  234.       MVI    A,37H        ;RESET RTS, FLAGS, DTR LOW, ENABLE R/T
  235.       OUT    MODCMD+4    ;SEND TO COMMAND REGISTER
  236.       IN    MODCMD        ;CLEAR ANY INCOMING CHARS.
  237.       IN    MODCMD        ;TRY ONCE MORE
  238.       XRA    A        ;CLEAR THE 'A' REG.
  239.       RET
  240. ;.....
  241. ;
  242. ;
  243. ; The following changes the baud rate with the SET command.
  244. ;
  245. SETUPR:      LXI    D,BAUDBUF
  246.       CALL    JMP$ILPRT
  247.       DB    'Input Baud Rate (110, 300, 1200, 9600): ',0
  248.       CALL    JMP$INBUF
  249.       LXI    D,BAUDBUF+2
  250.       CALL    JMP$INLNCOMP
  251.       DB    '110',0
  252.       JNC    OK110
  253.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  254.       DB    '300',0
  255.       JNC    OK300        ;GO IF GOT MATCH
  256.       CALL    JMP$INLNCOMP
  257.       DB    '1200',0
  258.       JNC    OK1200
  259.       CALL    JMP$INLNCOMP
  260.       DB    '9600',0
  261.       JNC    OK9600
  262.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, ASK AGAIN
  263.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  264.       JMP    SETUPR        ;TRY AGAIN
  265. ;
  266. OK110:      MVI    A,0        ;MSPEED    110 BAUD VALUE
  267.       LHLD    BD110        ;GET 110 BAUD PARAMETERS IN 'HL'
  268.       JMP    LOADBD        ;GO LOAD THEM
  269. ;
  270. OK300:      MVI    A,1
  271.       LHLD    BD300
  272.       JMP    LOADBD
  273. ;
  274. OK1200:      MVI    A,5
  275.       LHLD    BD1200
  276.       JMP    LOADBD
  277. ;
  278. OK9600:      MVI    A,8
  279.       LHLD    BD9600
  280. ;
  281. LOADBD:      STA    INITMOD+1
  282.       MOV    A,L        ;get least significant baud rate byte
  283.       STA    INITMOD1+1    ;store in INITMOD1
  284.       JMP    INITMOD        ;reset Z-100 2661
  285. ;.....
  286. ;
  287. ;
  288. ; TABLE    OF BAUDRATE PARAMETERS FOR 2661 I/O
  289. ;
  290. BD110:      DW    00F4H
  291. BD300:      DW    00F5H
  292. BD1200:      DW    00F7H
  293. BD9600:      DW    00FCH
  294. ;
  295. BAUDBUF:  DB    10,0
  296.       DS    10
  297. ;
  298. ;-----------------------------------------------------------------------
  299. ;
  300. ; The following routine could be used to display selections of interest
  301. ; to owners of this computer.  If using the Hayes Smartmodem this is
  302. ; unavailable without a special change.
  303. ;
  304. SPCLMENU: RET
  305. ;
  306. ;-----------------------------------------------------------------------
  307. ;
  308. ;
  309. ; NOTE:     MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  310. ;                 0C00H (without Smartmodem)
  311. ;
  312.       END
  313. ;
  314.