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

  1.  
  2. ; M7NE-1.ASM - NEC PC-8001 computer overlay file for MDM712 - 11/11/83
  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. ; This file adapts the NEC PC-8001 computer to the modem program.  While
  7. ; this computer has two serial ports, one is used for the CRT/keyboard
  8. ; and the other for the printer.  To use this overlay, you must set the
  9. ; serial port for 1200 baud, as the program then converts that to 300
  10. ; baud whenever needed.
  11. ;
  12. ; Edit this file for your preferences then follow the "TO USE:" example
  13. ; shown below.
  14. ;
  15. ; Use the "SET" command to change the baudrate when desired.  It starts
  16. ; out at 300 baud when the program is first called up.
  17. ;
  18. ;    TO USE: First edit this file filling in answers for your own
  19. ;        equipment.  Then assemble with ASM.COM or equivalent
  20. ;        assembler.  Then use DDT to overlay the the results
  21. ;        of this program to the original .COM file:
  22. ;
  23. ;        A>DDT MDM7xx.COM
  24. ;        DDT VERS 2.2
  25. ;        NEXT  PC
  26. ;        4300 0100
  27. ;        -IM7NE-1.HEX        (note the "I" command)
  28. ;        -R            ("R" loads in the .HEX file)
  29. ;        NEXT  PC
  30. ;        4300 0000
  31. ;        -G0            (return to CP/M)
  32. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  33. ;
  34. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  35. ;
  36. ; 11/11/83 - Renamed to M7NE-1.ASM, no changes    - Irv Hoff
  37. ; 07/27/83 - Renamed for use with MDM712    - Irv Hoff
  38. ; 07/01/83 - Revised for use with MDM711    - Irv Hoff
  39. ; 06/22/83 - Revised for use with MDM710    - Irv Hoff
  40. ; 06/22/83 - Altered for use with MDM710    - Irv Hoff
  41. ; 06/22/83 - Altered MDM708DP for the NEC 8001
  42. ;         computer using an external modem    - Irv Hoff
  43. ;
  44. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  45. ;
  46. BELL:        EQU    07H        ;bell
  47. CR:        EQU    0DH        ;carriage return
  48. ESC:        EQU    1BH        ;escape
  49. LF:        EQU    0AH        ;linefeed
  50. ;
  51. YES:        EQU    0FFH
  52. NO:        EQU    0
  53. ;
  54. ;
  55. PORT:        EQU    20H        ;NEC PC-8001 serial port
  56. MODCTL1:    EQU    PORT+1        ;Modem status port
  57. MODCTL2:    EQU    PORT+1        ;Modem control port
  58. MODDATP:    EQU    PORT        ;Modem data port
  59. ;
  60. ;
  61.         ORG    100H
  62. ;
  63.         DS    3    ;(for  "JMP   START" instruction)
  64. ;
  65. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  66. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem            104H
  67. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  68. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  69.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  70. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  71.                 ;6=2400 7=4800 8=9600 9=19200 default
  72. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  73.                 ;default time to send character in ter-
  74.                 ;minal mode file transfer for slow BBS.
  75. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  76.                 ;default time for extra wait after CRLF
  77.                 ;in terminal mode file transfer
  78. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  79. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  80. SCRNTEST:    DB    NO    ;cursor control routine         10CH
  81. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  82.                 ;no=resend a record after a valid NAK
  83. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  84. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  85. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  86. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  87. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  88. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  89.                 ;terminal mode (added by remote echo)
  90. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  91. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  92.                 ;write logon sequence at location LOGON
  93. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  94. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  95.                 ;no=external command if EXTCHR precedes
  96. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  97. LSTTST:        DB    NO    ;no=printer not available (modem)    119H
  98. XOFFTST:    DB    NO    ;yes=chcks for XOFF from remote    while    11AH
  99.                 ;sending a file in terminal mode
  100. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  101.                 ;sending a file in terminal mode
  102. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  103. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  104. EXTRA1:        DB    0    ;for future expansion            11EH
  105. EXTRA2:        DB    0    ;for future expansion            11FH
  106. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  107. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  108. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  109. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  110. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  111. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  112. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  113. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  114. ;
  115. ;
  116.         DS    2        ;                128H
  117. ;
  118. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  119.         DS    7
  120. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  121.         DS    7
  122. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  123.         DS    31
  124. ;
  125. LOGONPTR:    DW    LOGON        ;for user message.        160H
  126.         DS    6        ;                162H
  127. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  128. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  129.         RET  !    NOP  !    NOP    ;(by-passes PMMI port)        16EH
  130.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  131.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  132. JMP$SETUPR:    JMP    SETUPR        ;                177H
  133. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  134. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  135. JMP$BREAK:    JMP    SENDBRK        ;                180H
  136. ;
  137. ;
  138. ; Do not change the following six lines.
  139. ;
  140. JMP$ILPRT:    DS    3        ;                183H
  141. JMP$INBUF    DS    3        ;                186H
  142. JMP$INLNCOMP:    DS    3        ;                189H
  143. JMP$INMODEM    DS    3        ;                18CH
  144. JMP$NXTSCRN:    DS    3        ;                18FH
  145. JMP$TIMER:    DS    3        ;                192H
  146. ;
  147. ;
  148. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  149. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  150. ; The SCRNTST option must be set "YES" for these to work.
  151. ;
  152. CLREOS:        CALL    JMP$ILPRT    ;                195H
  153.         DB    ESC,59H,0,0,0    ;                198H
  154.         RET            ;                19DH
  155. ;
  156. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  157.         DB    1EH,ESC,59H,0,0    ;                1A1H
  158.         RET            ;                1A6
  159. ;
  160. ;
  161. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  162.         DB    'Version for NEC PC-8001 computers'
  163.         DB    CR,LF,0
  164.         RET
  165. ;.....
  166. ;
  167. ;
  168. ;-----------------------------------------------------------------------
  169. ;
  170. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  171. ;     end of your last routine should terminate by 0400H (601 bytes
  172. ;     available after start of SYSVER) if using the Hayes Smartmodem
  173. ;     or by address 0C00H (2659 bytes) otherwise.
  174. ;
  175. ;-----------------------------------------------------------------------
  176. ;
  177. ; You can put in a message at this location which can be called up with
  178. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  179. ; desired.  End with a 0.
  180. ;
  181. ;
  182. LOGON:      DB    'This is a NEC PC-8001 computer',CR,LF,0
  183. ;.....
  184. ;
  185. ;
  186. ;=======================================================================
  187. ;
  188. ; This routine allows a 300 ms. break tone to be send to reset some
  189. ; time-share computers.
  190. ;
  191. SENDBRK:  MVI    A,1FH        ;SEND A BREAK TONE
  192.       JMP    GOODBYE1
  193. ;.....
  194. ;
  195. ;
  196. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  197. ; length of time to disconnect some modesm such as the Bell 212A, etc.    
  198. ;
  199. GOODBYE:  MVI    A,15H        ;SEND BREAK, TURN OFF DTR
  200. ;
  201. GOODBYE1: OUT    MODCTL1        ;SEND TO STATUS PORT
  202.       MVI    B,3        ;WAIT 300 MS.
  203.       CALL    JMP$TIMER
  204.       MVI    A,07H        ;NORMAL SEND/RECEIVE WITH DTR
  205.       OUT    MODCTL1        ;SEND TO STATUS PORT
  206.       RET
  207. ;.....
  208. ;
  209. ;
  210. ; NEC PC-8001 initialization -- sets the 8251A for 8 bits, 1 stop pulse,
  211. ; DTR high, requires dip switches be set internally to 1200 baud then
  212. ; divides by 64 for 300, or by 16 for 1200 baud via "SET" command.  Set
  213. ; at present to default to 300 baud.
  214. ;
  215. INITMOD:  MVI    A,1        ;TRANSFER TIME FOR 300 BAUD
  216.       STA    MSPEED    
  217.       MVI    A,087H        ;INSURE OUT OF MODE
  218.       OUT    MODCTL1        ;MODEM STATUS PORT
  219.       OUT    MODCTL1        ;SLIGHT EXTRA DELAY
  220.       MVI    A,40H        ;INITIALIZE USART
  221.       OUT    MODCTL1        ;MODEM STATUS PORT
  222. ;
  223. INITMOD1: MVI    A,4FH        ;DEFAULT TO DIVIDE BY 64 FOR 300 BAUD
  224.       OUT    MODCTL1        ;MODEM STATUS PORT
  225.       MVI    A,17H        ;DTR, RCV, XMT, ERROR RESET
  226.       OUT    MODCTL1        ;MODEM STATUS PORT
  227.       IN    PORT        ;CLEAR DATA PORT
  228.       RET
  229. ;.....
  230. ;
  231. ;
  232. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  233.       CALL    JMP$ILPRT
  234.       DB    'Input Baud Rate (300, 1200): ',0
  235.       CALL    JMP$INBUF
  236.       LXI    D,BAUDBUF+2
  237.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  238.       DB    '300',0
  239.       JNC    OK300        ;GO IF GOT MATCH
  240.       CALL    JMP$INLNCOMP
  241.       DB    '1200',0
  242.       JNC    OK1200
  243.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  244.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  245.       JMP    SETUPR        ;TRY AGAIN
  246. ;
  247. OK300:      MVI    A,1        ;MSPEED 300 BAUD VALUE
  248.       MVI    B,4FH        ;DIVIDE BY 64 FOR 300 BAUD
  249.       JMP    LOADBD        ;GO LOAD THEM
  250. ;
  251. OK1200:      MVI    A,5
  252.       MVI    B,4EH        ;DIVIDE BY 16 FOR 1200 BAUD
  253. ;
  254. ;
  255. LOADBD:      STA    INITMOD+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  256.       MOV    A,B        ;GET BAUDRATE BYTE
  257.       STA    INITMOD1+1    ;STORE IN INITMOD
  258.       JMP    INITMOD        ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  259. ;
  260. ;
  261. BAUDBUF:  DB    10,0
  262.       DS    10
  263. ;.....
  264. ;
  265. ;
  266. ;           (END OF INITMOD AND SETUP ROUTINES)
  267. ;=======================================================================
  268. ;        
  269. ;
  270. ; These routines can be used for your equipment.  End with RET.  If
  271. ; using the Hayes Smartmodem this is unavailable without a special ad-
  272. ; dress change.
  273. ;
  274. SPCLMENU: RET
  275. ;        
  276. ;=======================================================================
  277. ;
  278. ;
  279. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  280. ;                 0C00H (without Smartmodem)
  281. ;
  282.       END
  283. ;
  284.