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 / M7NS-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  9KB  |  279 lines

  1. ; M7NS-2.ASM -- North Star HORIZON overlay (right serial). 06/01/84
  2. ;
  3. ; *** Be sure your right serial port header is strapped for 1200 baud!!!
  4. ;
  5. ; You will want to look this file over carefully. There are a number of
  6. ; options that you can use to configure the program to suit your taste.
  7. ;
  8. ; Edit this file for your preferences then follow the "TO USE:" example
  9. ; shown below.
  10. ;
  11. ;    TO USE: First edit this file filling in answers for your own
  12. ;        equipment.  Then assemble with ASM.COM or equivalent
  13. ;        assembler.  Then use DDT to overlay the the results
  14. ;        of this program to the original .COM file:
  15. ;
  16. ;        A>DDT MDM712.COM
  17. ;        DDT VERS 2.2
  18. ;        NEXT  PC
  19. ;        4x00 0100
  20. ;        -IM7NS-2.HEX        (note the "I" command)
  21. ;        -R            ("R" loads in the .HEX file)
  22. ;        NEXT  PC
  23. ;        4x00 0000
  24. ;        -G0            (return to CP/M)
  25. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  26. ;            ^
  27. ;            This may vary with version of MDM7xx used.
  28. ;
  29. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  30. ;
  31. ;06/01/84 - Revised save values            - Dennis Recla
  32. ;11/27/83 - Renamed M7NS-1    no changes    - S. Kluger
  33. ;09/05/83 - Constructed from M712GP        - Sigi Kluger
  34. ;
  35. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  36. ;
  37. BELL:        EQU    07H        ;bell
  38. CR:        EQU    0DH        ;carriage return
  39. ESC:        EQU    1BH        ;escape
  40. LF:        EQU    0AH        ;linefeed
  41. ;
  42. YES:        EQU    0FFH
  43. NO:        EQU    0
  44. ;
  45. ;
  46. ; Change the following information to match your equipment
  47. ;
  48. PORT:        EQU    4
  49. MODCTL1:    EQU    PORT+1        ;MODEM CONTROL PORT
  50. MODDATP:    EQU    PORT        ;MODEM DATA IN PORT
  51. MODDATO:    EQU    PORT        ;MODEM DATA OUT PORT
  52. MODDCDB:    EQU    4        ;CARRIER DETECT BIT
  53. MODDCDA:    EQU    0        ;VALUE WHEN ACTIVE
  54. BAUDRP:        EQU    PORT+1        ;BAUD RATE PORT
  55. MODCTL2:    EQU    PORT+1        ;2ND MODEM CONTROL PORT
  56. MODRCVB:    EQU    2        ;BIT TO TEST FOR RECEIVE
  57. MODRCVR:    EQU    2        ;VALUE WHEN READY
  58. MODSNDB:    EQU    1        ;BIT TO TEST FOR SEND
  59. MODSNDR:    EQU    1        ;VALUE WHEN READY
  60. ;
  61.         ORG    100H
  62. ;
  63. ;
  64. ; Change the clock speed to suit your system
  65. ;
  66.         DS    3    ;(for  "JMP   START" instruction)
  67. ;
  68. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  69. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  70. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  71. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  72.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  73. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  74.                 ;6=2400 7=4800 8=9600 9=19200 default
  75. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  76.                 ;default time to send character in ter-
  77.                 ;minal mode file transfer for sloW BBS.
  78. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  79.                 ;default time for extra wait after CRLF
  80.                 ;in terminal mode file transfer
  81. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  82. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  83. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  84. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  85.                 ;no=resend a record after a valid-NAK
  86. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  87. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  88. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  89. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  90. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  91. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  92.                 ;terminal mode (added by remote echo)
  93. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  94. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  95.                 ;write logon sequence at location LOGON
  96. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  97. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  98.                 ;no=external command if EXTCHR precedes
  99. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  100. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  101. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  102.                 ;sending a file in terminal mode
  103. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  104.                 ;sending a file in terminal mode
  105. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  106. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  107. EXTRA1:        DB    0    ;for future expansion            11EH
  108. EXTRA2:        DB    0    ;for future expansion            11FH
  109. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  110. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  111. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  112. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  113. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  114. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  115. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  116. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  117. ;
  118. ;
  119.         DS    2        ;                128H
  120. ;
  121. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port             12AH
  122.         DS    7
  123. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  124.         DS    7
  125. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  126.         DS    7
  127. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  128.  
  129. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  130. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  131. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  132.         DS    6        ;                156H
  133. ;
  134. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port #2    15AH
  135. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem control port #1    15DH
  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. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  160. ; SCRNTEST to YES at 010AH (above).
  161. ;
  162. CLREOS:        CALL    JMP$ILPRT    ;                195H
  163.         DB    0,0,0,0,0    ;                198H
  164.         RET            ;                19DH
  165. ;
  166. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  167.         DB    0,0,0,0,0    ;                1A1H
  168.         RET            ;                1A6H
  169.     
  170. ;
  171. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  172.         DB    'North Star HORIZON'
  173.         DB    CR,LF,0
  174.         RET
  175. ;.....
  176. ;
  177. ;
  178. ;-----------------------------------------------------------------------
  179. ;
  180. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  181. ;     end of your last routine should terminate by 0400H (601 bytes
  182. ;     available after start of SYSVER) if using the Hayes Smartmodem
  183. ;     or by address 0C00H (2659 bytes) otherwise.
  184. ;
  185. ;-----------------------------------------------------------------------
  186. ;
  187. ; You can put in a message at this location which can be called up with
  188. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  189. ; desired.  End with a 0.
  190. ;
  191. LOGON:        DB    'How are you today?',CR,LF,0
  192. ;.....
  193. ;
  194. ;
  195. ; Add your own routine here to send a break tone to reset some time-share
  196. ; computers, if desired.
  197. ;
  198. SENDBRK:    RET
  199. ;.....
  200. ;
  201. ;
  202. ; Add your own routine here to put DTR low and/or send a break tone.
  203. ; Check other routines such as MDM709DP.ASM which is using this feature.
  204. ;
  205. GOODBYE:    RET
  206. ;.....
  207. ;
  208. ;
  209. ; You can use this area for any special initialization or setup you may
  210. ; wish to include.  Each must stop with a RET.  You can check the other
  211. ; available overlays for ideas how to write your own routines if that
  212. ; may be of some help.
  213. ;
  214. INITMOD:    MVI    A,1
  215.         STA    MSPEED
  216.         MVI    A,40H        ;RESET USART
  217.         OUT    MODCTL1
  218. INITMOD2:    MVI    A,01001111B    ;1STOP,64XCLK,8BIT,NO PAR
  219.         OUT    MODCTL1
  220.         MVI    A,37H
  221.         OUT    MODCTL1
  222.         IN    MODDATP
  223.         RET
  224. ;
  225. ;
  226. ; Setup routine to allow changing modem speed with the SET command.
  227. ;
  228. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  229.       CALL    JMP$ILPRT
  230.       DB    'Input Baud Rate (300, 1200): ',0
  231.       CALL    JMP$INBUF
  232.       LXI    D,BAUDBUF+2
  233.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  234.       DB    '300',0
  235.       JNC    OK300        ;GO IF GOT MATCH
  236.       CALL    JMP$INLNCOMP
  237.       DB    '1200',0
  238.       JNC    OK1200
  239.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  240.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  241.       JMP    SETUPR        ;TRY AGAIN
  242. ;
  243. OK300:      MVI    A,1
  244.       LHLD    BD300
  245.       JMP    LOADBD
  246. ;
  247. OK1200:      MVI    A,5
  248.       LHLD    BD1200
  249.       JMP    LOADBD
  250. ;
  251. LOADBD:      STA    INITMOD+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  252.       MOV    A,L        ;GET BAUDRATE BYTE
  253.       STA    INITMOD2+1    ;SEND TO USART FOR NEW BAUDRATE
  254.       JMP    INITMOD    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  255. ;
  256. ;
  257. ; TABLE OF BAUDRATE PARAMETERS
  258. ;
  259. BD300:      DW    01001111B
  260. BD1200:      DW    01001110B
  261. ;
  262. BAUDBUF:  DB    10,0
  263.       DS    10
  264. ;
  265. ;
  266. ; If using the Hayes Smartmodem this is unavailable without a special
  267. ; change.
  268. ;
  269. SPCLMENU:  RET
  270. ;
  271. ;
  272. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  273. ;                 0C00H (without Smartmodem)
  274. ;.....
  275. ;
  276.       END
  277. ;
  278.