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 / M7NA-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  9KB  |  301 lines

  1. ; M7NA-1.ASM -- North Star Advantage overlay for MDM7xx - 11/11/83
  2. ;
  3. ; Edit this file for your preferences then follow the "TO USE:" example
  4. ; shown below.
  5. ;
  6. ; Use the MDM7xx "SET" command to change the baudrate when desired.  It
  7. ; starts out at 300 baud when the program is first called up.
  8. ;
  9. ;
  10. ;    TO USE: First edit this file filling in answers for your own
  11. ;        equipment.  Then assemble with ASM.COM or equivalent
  12. ;        assembler.  Then use DDT to overlay the the results
  13. ;        of this program to the original .COM file:
  14. ;
  15. ;        A>DDT MDM7xx.COM
  16. ;        DDT VERS 2.2
  17. ;        NEXT  PC
  18. ;        4300 0100
  19. ;        -IM7NA-1.HEX        (note the "I" command)
  20. ;        -R            ("R" loads in the .HEX file)
  21. ;        NEXT  PC
  22. ;        4300 0000
  23. ;        -G0            (return to CP/M)
  24. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  25. ;
  26. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  27. ;
  28. ; 11/11/83 - Renamed to M7NA-1.ASM, no changes    - Irv Hoff
  29. ; 09/14/83 - Changed M712HZ.ASM TO M712AF.ASM    - Robert Lehman
  30. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  31. ; 02/17/83 - 1st version of M712HZ.ASM        - Irv Hoff
  32. ;
  33. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  34. ;
  35. BELL:        EQU    07H        ;bell
  36. CR:        EQU    0DH        ;carriage return
  37. ESC:        EQU    1BH        ;escape
  38. LF:        EQU    0AH        ;linefeed
  39. ;
  40. YES:        EQU    0FFH
  41. NO:        EQU    0
  42. ;
  43. ;
  44. PORT:        EQU    50H        ;Slot 1 for Advantage
  45. BAUDRP:        EQU    PORT+8
  46. MODDATP:    EQU    PORT        ;data port for Advantage
  47. MODCTL1:    EQU    PORT+1        ;status port for Advantage
  48. MODRCVB:    EQU    2        ;bit to test for received data
  49. MODRCVR:    EQU    2        ;modem receive ready
  50. MODSNDB:    EQU    1        ;bit to test for ready to send
  51. MODSNDR:    EQU    1        ;modem send ready bit
  52. ;
  53. ;
  54. ; The Advantage uses the 8251
  55. ;
  56. ;
  57.         ORG    100H
  58. ;
  59.         DS    3    ;(for  "JMP   START" instruction)
  60. ;
  61. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  62. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  63. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  64. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  65.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  66. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  67.                 ;6=2400 7=4800 8=9600 9=19200 default
  68. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  69.                 ;default time to send character in ter-
  70.                 ;minal mode file transfer for slow BBS.
  71. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  72.                 ;default time for extra wait after CRLF
  73.                 ;in terminal mode file transfer
  74. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  75. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  76. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  77. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  78.                 ;no=resend a record after a valid NAK
  79. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  80. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  81. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  82. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  83. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  84. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  85.                 ;terminal mode (added by remote echo)
  86. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  87. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  88.                 ;write logon sequence at location LOGON
  89. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  90. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  91.                 ;no=external command if EXTCHR precedes
  92. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  93. LSTTST:        DB    NO    ;yes=printer available on printer port    119H
  94. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  95.                 ;sending a file in terminal mode
  96. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  97.                 ;sending a file in terminal mode
  98. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  99. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  100. EXTRA1:        DB    0    ;for future expansion            11EH
  101. EXTRA2:        DB    0    ;for future expansion            11FH
  102. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  103. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  104. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  105. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  106. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  107. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  108. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        125H
  109. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        126H
  110. ;
  111. ;
  112.         DS    2        ;                128H
  113. ;
  114. IN$MODCTL1:    IN    MODCTL1 ! RET    ;in modem control port        12AH
  115.         DS    7
  116. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  117.         DS    7
  118. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  119.         DS    31
  120. ;
  121. LOGONPTR:    DW    LOGON        ;for user message.        160H
  122.         DS    6        ;                162H
  123. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  124. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  125.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  126.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  127.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  128. JMP$SETUPR:    JMP    SETUPR        ;                177H
  129. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  130. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  131. JMP$BREAK:    JMP    SENDBRK        ;                180H
  132. ;
  133. ;
  134. ; Do not change the following six lines.
  135. ;
  136. JMP$ILPRT:    DS    3        ;                183H
  137. JMP$INBUF    DS    3        ;                186H
  138. JMP$INLNCOMP:    DS    3        ;                189H
  139. JMP$INMODEM    DS    3        ;                18CH
  140. JMP$NXTSCRN:    DS    3        ;                18FH
  141. JMP$TIMER:    DS    3        ;                192H
  142. ;
  143. ;
  144. CLREOS:        CALL    JMP$ILPRT    ;                195H
  145.         DB    0FH,0,0,0,0    ;                198H
  146.         RET            ;                19DH
  147. ;
  148. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  149.         DB    1EH,0FH,0,0,0    ;CLEAR ENTIRE SCREEN        1A1H
  150.         RET            ;HOME THEN CLEAR
  151. ;
  152. ;
  153. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  154.         DB    'Version for North Star Advantage - Slot 1'
  155.         DB    CR,LF,0
  156.         DB    RET
  157. ;.....
  158. ;
  159. ;
  160. ;-----------------------------------------------------------------------
  161. ;
  162. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  163. ;     end of your last routine should terminate by 0400H (601 bytes
  164. ;     available after start of SYSVER) if using the Hayes Smartmodem
  165. ;     or by address 0C00H (2659 bytes available) otherwise.
  166. ;
  167. ;-----------------------------------------------------------------------
  168. ;
  169. ; You can put in a message at this location which can be called up with
  170. ; CTL-O if TRANLOGON has been set YES.    You can put in several lines if
  171. ; desired.  End with a 0.
  172. ;
  173. LOGON:      DB    'Hello from a North Star Advantage computer',CR,LF,0
  174. ;.....
  175. ;    
  176. ;
  177. ; This routine allows a 300 ms. break tone to be send to reset some
  178. ; time-share computers.
  179. ;
  180. SENDBRK:  MVI    A,08H        ;send a break tone for 300 ms.
  181.       JMP    GOODBYE1
  182. ;.....
  183. ;
  184. ;
  185. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  186. ; length of time to disconnect some modems such as the Bell 212a, etc.
  187. ;
  188. GOODBYE:  MVI    A,0AH        ;set break, DTR low
  189. ;
  190. GOODBYE1: OUT    MODCTL1        ;put command register out of mode
  191.       IN    MODCTL1        ;make sure it is now clear
  192.       IN    MODCTL1        ;try once more
  193.       MVI    B,3        ;delay for 300 ms.
  194.       CALL    JMP$TIMER
  195.       MVI    A,37H        ;reset RTS, flags, DTR low, enable R/T
  196.       OUT    MODCTL1        ;send to command register
  197.       IN    MODCTL1        ;clear any incoming chars.
  198.       IN    MODCTL1        ;try once more
  199.       XRA    A        ;clear the 'A' reg.
  200.       RET
  201. ;.....
  202. ;
  203. ;
  204. ; The following are used in setting up the slot 1.
  205. ;
  206. INITMOD:  MVI    A,1        ;default transfer time to 300 baud
  207.       STA    MSPEED
  208.       XRA    A        ;set RTS, flags, DTR, disable R/T
  209.       OUT    MODCTL1        ;put command register out of mode
  210.       IN    MODCTL1        ;make sure it is now clear
  211.       IN    MODCTL1        ;try once more
  212.       MVI    A,0AAH
  213.       OUT    MODCTL1
  214.       MVI    A,40H
  215.       OUT    MODCTL1
  216.       MVI    A,4EH        ;1 stop, no parity, 8 bits, 16x asynch
  217.       OUT    MODCTL1        ;send to mode register 1
  218. ;
  219. INITMOD1: MVI    A,40H        ;start with 300 baud, internal 4 clock
  220.       OUT    BAUDRP        ;send to baud rate port
  221.       MVI    A,37H        ;reset RTS, flags, DTR low, enable R/T
  222.       OUT    MODCTL1        ;send to command register
  223.       IN    MODCTL1        ;clear any incoming chars.
  224.       IN    MODCTL1        ;try once more
  225.       XRA    A        ;clear the 'A' reg.
  226.       RET
  227. ;.....
  228. ;
  229. ;
  230. ; The following changes the baud rate with the set command.
  231. ;
  232. SETUPR:      LXI    D,BAUDBUF
  233.       CALL    JMP$ILPRT
  234.       DB    'Input Baud Rate (300, 1200, 9600, 19200): ',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$INLNCOMP
  244.       DB    '9600',0
  245.       JNC    OK9600
  246.       CALL    JMP$INLNCOMP
  247.       DB    '19200',0
  248.       JNC    OK19200
  249.       CALL    JMP$ILPRT    ;all matches failed, ask again
  250.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  251.       JMP    SETUPR        ;try again
  252. ;
  253. OK300:      MVI    A,1
  254.       LHLD    BD300
  255.       JMP    LOADBD
  256. ;
  257. OK1200:      MVI    A,5
  258.       LHLD    BD1200
  259.       JMP    LOADBD
  260. ;
  261. OK9600:      MVI    A,8
  262.       LHLD    BD9600
  263.       JMP    LOADBD
  264. ;
  265. OK19200   MVI    A,9
  266.       LHLD    BD19200
  267. ;
  268. LOADBD:      STA    INITMOD+1
  269.       MOV    A,L        ;get least significant baud rate byte
  270.       STA    INITMOD1+1    ;store in INITMOD1
  271.       JMP    INITMOD        ;reset advantage slot 1 
  272. ;.....
  273. ;
  274. ;
  275. ; Table of baudrate parameters for hsio-4 board i/o
  276. ;
  277. BD300:      DW    0040H
  278. BD1200:      DW    0070H
  279. BD9600:      DW    007EH
  280. BD19200:  DW    007FH
  281. ;
  282. BAUDBUF:  DB    10,0
  283.       DS    10
  284. ;
  285. ;-----------------------------------------------------------------------
  286. ;
  287. ; The following routine could be used to display selections of interest
  288. ; to owners of this computer.  If using the Hayes Smartmodem this is
  289. ; unavailable without a special change.
  290. ;
  291. SPCLMENU: RET
  292. ;
  293. ;-----------------------------------------------------------------------
  294. ;
  295. ;
  296. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  297. ;                 0C00H (without Smartmodem)
  298. ;
  299.       END
  300. ;
  301.