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

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