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

  1. ; M7IM-1.ASM -- IMS 5000 with IMS 440 I/O overlay for MDM712.  09/29/83
  2. ;
  3. ; You will want to look this file over carefully. There are a number of
  4. ; options that you can use to configure the program to suit your taste.
  5. ; This file places particular emphasis on using the IMS 5000 equip-
  6. ; ment with IMS 440 I/O board.  Much of the information contained here is
  7. ; not in the main file.  If not using IMS 5000 equipment
  8. ; some of the routines here will illustrate what you could do with your
  9. ; unit.
  10. ;
  11. ; Use the "SET" command to change baudrate when desired.
  12. ;
  13. ; Edit this file for your preferences then follow the "TO USE:" example
  14. ; shown below.
  15. ;
  16. ;
  17. ;    TO USE: First edit this file filling in answers for your own
  18. ;        equipment.  Then assemble with ASM.COM or equivalent
  19. ;        assembler.  Then use DDT to overlay the the results
  20. ;        of this program to the original .COM file:
  21. ;
  22. ;        A>DDT MDM715.COM
  23. ;        DDT VERS 2.2
  24. ;        NEXT  PC
  25. ;        4300 0100
  26. ;        -IM7IM-1.HEX        (note the "I" command)
  27. ;        -R            ("R" loads in the .HEX file)
  28. ;        NEXT  PC
  29. ;        4300 0000
  30. ;        -G0            (return to CP/M)
  31. ;        A>SAVE 68 MDM715.COM    (now have a modified .COM file)
  32. ;
  33. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  34. ;
  35. ; 12/26/83 - Renamed to match standard overlay file names.  DDT directions
  36. ;            changed to reflect new size of MDM715 - Robert Flagg
  37. ;
  38. ; 09/29/83 - First version of this file   - Steve Noland
  39. ;
  40. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  41. ;
  42. BELL:        EQU    07H        ;bell
  43. CR:        EQU    0DH        ;carriage return
  44. ESC:        EQU    1BH        ;escape
  45. LF:        EQU    0AH        ;linefeed
  46. ;
  47. YES:        EQU    0FFH
  48. NO:        EQU    0
  49. ;
  50. ;
  51. ; Change the value at MODDATP if it does not match what you are using.
  52. ;
  53. BAUDRP:        EQU    15H        ;baud rate port on counter/timer
  54. MODDATP:    EQU    013H        ;data port for IMS 440
  55. MODCTL1:    EQU    012H         ;status port for IMS 440
  56. MODRCVB:    EQU    1        ;bit to test for received data
  57. MODRCVR:    EQU    1        ;modem receive ready
  58. MODSNDB:    EQU    2          ;bit to test for ready to send
  59. MODSNDR:    EQU    2          ;modem send ready bit
  60. ;
  61. ;
  62.         ORG    100H
  63. ;
  64. ; Change the clock speed if needed, to match your system
  65. ;
  66.         DS    3    ;(for  "JMP   START" instruction)
  67. ;
  68. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  69. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-Hayes    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    0    ;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    2    ;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    YES    ;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    YES    ;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    NO     ;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 a 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. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  129. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    14EH
  130. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  131.         DS    12        ;PMMI only calls        154H
  132. ;
  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 routine)    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. ; The following clear the screen for the TVI 925 terminal
  158. ;
  159. CLREOS:        CALL    JMP$ILPRT    ;                195H
  160.         DB    ESC,79H,0,0,0    ;ESC 'y' - clear to eos     198H
  161.         RET            ;                19DH
  162. ;
  163. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  164.         DB    ESC,2AH,0,0,0    ;ESC "*" - clear and home cursor1A1H
  165.         RET            ;                1A6H
  166. ;
  167. ;
  168. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  169.         DB    'Version for IMS 5000 with 440 I/O'
  170.         DB    CR,LF,0
  171.         RET
  172. ;.....
  173. ;
  174. ;
  175. ;-----------------------------------------------------------------------
  176. ;
  177. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  178. ;     end of your last routine should terminate by 0400H (601 bytes
  179. ;     available after start of SYSVER) if using the Hayes Smartmodem
  180. ;     or by address 0C00H (2659 bytes) otherwise.
  181. ;
  182. ;-----------------------------------------------------------------------
  183. ;
  184. ; You can put in a message at this location which can be called up with
  185. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  186. ; desired.  End with a 0.
  187. ;
  188. LOGON:      DB    'Hello from an IMS 5000 user',CR,LF,0
  189. ;.....
  190. ;
  191. ;
  192. ; This routine sends a 300 ms. break tone to reset some time-share
  193. ; computers.
  194. ;
  195. SENDBRK:  RET
  196. ;.....
  197. ;
  198. ;
  199. ; This routine sends a 300 ms. break tgone and set DTR low for the same
  200. ; length of time to disconnect some modems such as the Bell 212A, etc.
  201. ;
  202. GOODBYE:  RET
  203. ;
  204. ;.....
  205. ;
  206. ;
  207. ; The following is used to initialize UART 1 on the IMS 440 board
  208. ;
  209. INITMOD:  MVI    A,1        ;default transfer speed to 300 baud
  210.       STA    MSPEED
  211.       DI            ;turn off interrupts for init.
  212.       MVI    A,76H        ;select UART1 counter
  213.       OUT    17H       
  214. ;
  215. LSPSPD:      MVI    A,00H        ;default 'LSP' speed for 300 baud
  216.       OUT    BAUDRP         ;load into counter divisor register 
  217. ;
  218. MSPSPD:      MVI    A,01H        ;default 'MSP' speed for 300 baud
  219.       OUT    BAUDRP       ;load into counter divisor register 
  220. ;
  221.       MVI    A,19H        ;8-level, 1 stop bit, no parity
  222.       OUT    MODCTL1       ;load into UART control register
  223.       EI            ;restore interrupts to normal
  224.       RET
  225. ;.....
  226. ;
  227. ;
  228. ; The following routine changes the baud rate for the IMS 440 with the SET
  229. ; command.
  230. ;
  231. SETUPR:      LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  232.       CALL    JMP$ILPRT
  233.       DB    'Input Baud Rate (300, 450, 600, 1200, 9600): ',0
  234.       CALL    JMP$INBUF
  235.       LXI    D,BAUDBUF+2
  236.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  237.       DB    '300',0
  238.       JNC    OK300        ;go if got match
  239.       CALL    JMP$INLNCOMP
  240.       DB    '450',0
  241.       JNC    OK450
  242.       CALL    JMP$INLNCOMP
  243.       DB    '600',0
  244.       JNC    OK600
  245.       CALL    JMP$INLNCOMP
  246.       DB    '1200',0
  247.       JNC    OK1200
  248.       CALL    JMP$INLNCOMP
  249.       DB    '9600',0
  250.       JNC    OK9600
  251.       CALL    JMP$ILPRT    ;all matches failed - tell operator
  252.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  253.       JMP    SETUPR        ;try again
  254. ;
  255. OK300:      MVI    A,1        ;MSPEED 300 baud value
  256.       LHLD    BD300        ;get 300 baud parameters in HL
  257.       JMP    LOADBD        ;go load them
  258. ;
  259. OK450:      MVI    A,2
  260.       LHLD    BD450
  261.       JMP    LOADBD
  262.  
  263. OK600:      MVI    A,3
  264.       LHLD    BD600
  265.       JMP    LOADBD
  266. ;
  267. OK1200:      MVI    A,5
  268.       LHLD    BD1200
  269.       JMP    LOADBD
  270. ;
  271. OK9600:      MVI    A,8
  272.       LHLD    BD9600
  273. ;
  274. LOADBD:      STA    INITMOD+1    ;store speed to show transfer time 
  275.       MOV    A,L        ;get least significant baud rate byte
  276.       STA    LSPSPD+1    ;store in INITMOD
  277.       MOV    A,H        ;get most signifcant baud rate byte
  278.       STA    MSPSPD+1    ;store in INITMOD
  279.       JMP    INITMOD        ;reset H89 8250
  280. ;
  281. ;
  282. ; Table of baud rate parameters 
  283. ;
  284. BD300:      DW    256
  285. BD450:      DW    171
  286. BD600:      DW    128
  287. BD1200:      DW    64
  288. BD9600:      DW    8
  289. ;
  290. BAUDBUF:  DB    10,0
  291.       DS    10
  292. ;
  293. ;-----------------------------------------------------------------------
  294. ;
  295. ; This routine can be used for your equipment, be sure to end with RET
  296. ; If using the Hayes Smartmodem this is unavailable without a special
  297. ; change.
  298. ;
  299. SPCLMENU: RET
  300. ;
  301. ;-----------------------------------------------------------------------
  302. ;
  303. ;
  304. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  305. ;                 0C00H (without Smartmodem)
  306. ;
  307.       END
  308. ;
  309.