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 / M7NH-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  316 lines

  1. ; M7NH-2.ASM -- North Star Horizon - HSIO-4 overlay file for MDM7xx. 01/14/84
  2. ;
  3. ; This overlay adapts the MDM7xx program to the North Star Horizon
  4. ; HSIO-4 serial I/O board. It uses the 8251 USART.
  5. ;
  6. ; You will want to look this file over carefully. There are a number of
  7. ; options that you can use to configure the program to suit your taste.
  8. ; It supports all the baud rates that the HSIO-4 supports even
  9. ; when it is not likeley you are running a dial up modem at that
  10. ; speed. I.E. 19200 baud. This still could be useful for a direct
  11. ; connection between two systems though.
  12. ;
  13. ; Edit this file for your preferences then follow the "TO USE:" example
  14. ; shown below.
  15. ;
  16. ;    TO USE: First edit this file filling in answers for your own
  17. ;        equipment.  Then assemble with ASM.COM or equivalent
  18. ;        assembler.  Then use DDT to overlay the the results
  19. ;        of this program to the original .COM file:
  20. ;
  21. ;        A>DDT MDM7xx.COM
  22. ;        DDT VERS 2.2
  23. ;        NEXT  PC
  24. ;        4300 0100
  25. ;        -IM712GP.HEX        (note the "I" command)
  26. ;        -R            ("R" loads in the .HEX file)
  27. ;        NEXT  PC
  28. ;        4300 0000
  29. ;        -G0            (return to CP/M)
  30. ;        A>SAVE 66 MDM712.COM    (now have a modified .COM file)
  31. ;
  32. ;    use    A>SAVE 68 MDM715.COM    for ver 7.15 and
  33. ;        A>SAVE 69 MDM716.COM    for ver 7.16
  34. ; Check the .DOC files for other versions.
  35. ;
  36. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  37. ;
  38. ; 01/14/83 - Rnamed and revised for mdm716    - Lloyd Miller
  39. ;        Adapted from MDM712GP.ASM
  40. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  41. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  42. ; 07/01/83 - Revised to work with MDM710    - Irv Hoff
  43. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  44. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  45. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  46. ; 04/04/83 - First version of this file        - Irv Hoff
  47. ;
  48. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  49. ;
  50. BELL:        EQU    07H        ;bell
  51. CR:        EQU    0DH        ;carriage return
  52. ESC:        EQU    1BH        ;escape
  53. LF:        EQU    0AH        ;linefeed
  54. ;
  55. YES:        EQU    0FFH
  56. NO:        EQU    0
  57. ;
  58. ;
  59. ; Change the following information to match your equipment
  60. ;
  61. ; THE FOLLOWING EQU CORRESPONDS TO PORT A OF THE HSIO-4
  62. PORT:        EQU    010H
  63. MODCTL1:    EQU    PORT+3        ;MODEM CONTROL PORT
  64. MODDATP:    EQU    PORT+2        ;MODEM DATA IN PORT
  65. MODDATO:    EQU    PORT+2        ;MODEM DATA OUT PORT
  66. BAUDRP:        EQU    PORT        ;BAUD RATE PORT
  67. MODRCVB:    EQU    2        ;BIT TO TEST FOR RECEIVE
  68. MODRCVR:    EQU    2        ;VALUE WHEN READY
  69. MODSNDB:    EQU    1        ;BIT TO TEST FOR SEND
  70. MODSNDR:    EQU    1        ;VALUE WHEN READY
  71. ;
  72.         ORG    100H
  73. ;
  74. ;
  75. ; Change the clock speed to suit your system
  76. ;
  77.         DS    3    ;(for  "JMP   START" instruction)
  78. ;
  79. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  80. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  81. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  82. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  83.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  84. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  85.                 ;6=2400 7=4800 8=9600 9=19200 default
  86. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  87.                 ;default time to send character in ter-
  88.                 ;minal mode file transfer for slow BBS.
  89. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  90.                 ;default time for extra wait after CRLF
  91.                 ;in terminal mode file transfer
  92. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  93. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  94. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  95. ;
  96. ; ACKNAK IS OBSOLETE
  97.         DS    1
  98. ;ACKNAK:    DB    NO    ;yes=resend a record after any non-ACK    10DH
  99.                 ;no=resend a record after a valid-NAK
  100. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  101. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  102. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  103. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  104. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  105. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  106.                 ;terminal mode (added by remote echo)
  107. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  108. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  109.                 ;write logon sequence at location LOGON
  110. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  111. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  112.                 ;no=external command if EXTCHR precedes
  113. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  114. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  115. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  116.                 ;sending a file in terminal mode
  117. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  118.                 ;sending a file in terminal mode
  119. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  120. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  121. EXTRA1:        DB    0    ;for future expansion            11EH
  122. EXTRA2:        DB    0    ;for future expansion            11FH
  123. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  124. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  125. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  126. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  127. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  128. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  129. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  130. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  131. ;
  132.         DS    2        ;                128H
  133. ;
  134. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port             12AH
  135.         DS    7
  136. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  137.         DS    7
  138. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  139.         DS    7
  140. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  141. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  142. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  143. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  144. ;
  145.         DS    12        ;                156H
  146. ;
  147. LOGONPTR:    DW    LOGON        ;for user message.        160H
  148.         DS    6        ;                162H
  149. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  150. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  151.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    16EH
  152.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    171H
  153.         RET  !  NOP  !  NOP    ;(by-passes PMMI routine)    174H
  154. JMP$SETUPR:    JMP    SETUPR        ;                177H
  155. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  156. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  157. JMP$BREAK:    JMP    SENDBRK        ;                180H
  158. ;
  159. ;
  160. ; Do not change the following six lines.
  161. ;
  162. JMP$ILPRT:    DS    3        ;                183H
  163. JMP$INBUF    DS    3        ;                186H
  164. JMP$INLNCOMP:    DS    3        ;                189H
  165. JMP$INMODEM    DS    3        ;                18CH
  166. JMP$NXTSCRN:    DS    3        ;                18FH
  167. JMP$TIMER    DS    3        ;                192H
  168. ;
  169. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  170. ; SCRNTEST to YES at 010AH (above).
  171. ;
  172. ; The following are set up for a Soroc terminal
  173. ;
  174. CLREOS:        CALL    JMP$ILPRT    ;                195H
  175.         DB    ESC,'Y',0,0,0    ;                198H
  176.         RET            ;                19DH
  177. ;
  178. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  179.         DB    ESC,'+',0,0,0    ;                1A1H
  180.         RET            ;                1A6H
  181.     
  182. ;
  183. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  184.         DB    'Version for external modem'
  185.         DB    ' on a North Star Horizon / HSIO-4 port A'
  186.         DB    CR,LF,0
  187.         RET
  188. ;.....
  189. ;
  190. ;
  191. ;-----------------------------------------------------------------------
  192. ;
  193. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  194. ;     end of your last routine should terminate by 0400H (601 bytes
  195. ;     available after start of SYSVER) if using the Hayes Smartmodem
  196. ;     or by address 0C00H (2659 bytes) otherwise.
  197. ;
  198. ;-----------------------------------------------------------------------
  199. ;
  200. ; You can put in a message at this location which can be called up with
  201. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  202. ; desired.  End with a 0.
  203. ;
  204. LOGON:        DB    'How are you today?',CR,LF,0
  205. ;.....
  206. ;
  207. ;
  208. ; Add your own routine here to send a break tone to reset some time-share
  209. ; computers, if desired.
  210. ;
  211. SENDBRK:
  212.     MVI    A,2FH
  213.     OUT    MODCTL1
  214.     MVI    B,3
  215.     CALL    JMP$TIMER    ;300MS
  216.     JMP    RESUME
  217. ;.....
  218. ;
  219. ;
  220. ; Add your own routine here to put DTR low and/or send a break tone.
  221. ; Check other routines such as MDM709DP.ASM which is using this feature.
  222. ;
  223. GOODBYE:
  224.     MVI    A,18H    ; ERR RESET, SEND BREAK, DROP DTR
  225.     OUT    MODCTL1
  226.     RET
  227. ;.....
  228. ;
  229. ;
  230. ; You can use this area for any special initialization or setup you may
  231. ; wish to include.  Each must stop with a RET.  You can check the other
  232. ; available overlays for ideas how to write your own routines if that
  233. ; may be of some help.
  234. ;
  235. INITMOD:
  236.     MVI    A,3    ; stuff contreg in case it is waiting for sync bytes or
  237.     OUT    MODCTL1    ; has just been reset!
  238.     OUT    MODCTL1
  239.     MVI    A,40H    ; INTERNAL RESET TO USART
  240.     OUT    MODCTL1
  241.     XTHL ! XTHL    ; PAUSE FOR USART TO RESET
  242.     MVI    A,4EH    ; MODE ( ASYNC, 1 STOP, DISABLE PARITY,8BIT)
  243.     OUT    MODCTL1
  244. ; INIT SPEED 300 OR 1200 ONLY ( SET MSPEED BYTE ABOVE FOR INITIAL SPEED
  245.     LDA    MSPEED
  246.     CPI    1
  247.     MVI    A,6
  248.     JZ    INIT300
  249.     MVI    A,4
  250. INIT300:
  251.     OUT    BAUDRP
  252.     JMP    RESUME
  253. ;
  254. SETUPR:
  255.     CALL    JMP$ILPRT
  256.     DB    'SELECT SPEED -',CR,LF,LF
  257.     DB    ' A =   110 BAUD',CR,LF
  258.     DB    ' B =   300',CR,LF
  259.     DB    ' C =   600',CR,LF
  260.     DB    ' D =  1200',CR,LF
  261.     DB    ' E =  2400',CR,LF
  262.     DB    ' F =  4800',CR,LF
  263.     DB    ' G =  9600',CR,LF
  264.     DB    ' H = 19200',CR,LF
  265.     DB    '(CR TO RECONECT WITHOUT SPEED CHANGE)-',0
  266.     LXI    D,BAUDBUF
  267.     CALL    JMP$INBUF
  268.     LDA    BAUDBUF+1
  269.     ORA    A
  270.     JZ    RESUME
  271.     LDA    BAUDBUF+2
  272.     CPI    'H'+1
  273.     JNC    SETUPR
  274.     SUI    'A'
  275.     JC    SETUPR
  276.     ADD    A
  277.     MOV    C,A
  278.     MVI    B,0
  279.     LXI    H,BAUDTAB
  280.     DAD    B
  281.     MOV    A,M
  282.     STA    MSPEED
  283.     INX    H
  284.     MOV    A,M
  285.     OUT    BAUDRP
  286. RESUME:
  287.     MVI    A,37H    ; RTS, ERR RESET, RCV ENA, DTR, XMIT ENA
  288.     OUT    MODCTL1
  289.     RET
  290. BAUDBUF:    DB    1,0
  291.         DS    1
  292. BAUDTAB    DB    0,7
  293.     DB    1,6
  294.     DB    3,5
  295.     DB    5,4
  296.     DB    6,3
  297.     DB    7,2
  298.     DB    8,1
  299.     DB    9,0
  300.  
  301. ;
  302. ;
  303. ; If using the Hayes Smartmodem this is unavailable without a special
  304. ; change.
  305. ;
  306. SPCLMENU:  RET
  307. ;
  308. ;
  309. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  310. ;                 0C00H (without Smartmodem)
  311. ;.....
  312. ;
  313.       END
  314.