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

  1.  
  2. ; M7XE-1.ASM -- XEROX 820 and 820-II overlay file for MDM7xx.  11/11/83
  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 XEROX 820 and 820-II computers to MDM7xx.
  7. ;
  8. ; Much of the information contained here is not in the MDM7xx.ASM file.
  9. ;
  10. ; Edit this file for your preferences then follow the "TO USE:" example
  11. ; shown below.
  12. ;
  13. ; Use the "SET" command to change the baudrate when desired.  It starts
  14. ; out at 300 baud when the program is first called up.
  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. ;        -IM7XE-1.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 MDM7xx.COM    (now have a modified .COM file)
  31. ;
  32. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  33. ;
  34. ; 11/11/83 - Renamed to M7XE-1.ASM, no changes    - Irv Hoff
  35. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  36. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  37. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  38. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  39. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  40. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  41. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  42. ; 03/03/83 - Modified MDM705KP for XEROX
  43. ;         820-II computers with external
  44. ;         modems                - David Wurz    
  45. ;
  46. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  47. ;
  48. BELL:        EQU    07H        ;bell
  49. CR:        EQU    0DH        ;carriage return
  50. ESC:        EQU    1BH        ;escape
  51. LF:        EQU    0AH        ;linefeed
  52. ;
  53. YES:        EQU    0FFH
  54. NO:        EQU    0
  55. ;
  56. ;
  57. PORT:        EQU    04H        ;XEROX 820, II serial output port
  58. MODCTL1:    EQU    PORT+2        ;Modem control port
  59. MODDATP:    EQU    PORT        ;Modem data port
  60. MODCTL2:    EQU    PORT+2        ;Modem status port
  61. MODRCVB:    EQU    01H        ;Your bit to test for receive
  62. MODRCVR:    EQU    01H        ;Your value when receive ready
  63. MODSNDB:    EQU    04H        ;Your bit to test for send
  64. MODSNDR:    EQU    04H        ;Your value when send ready        
  65. ;
  66. ;
  67.         ORG    100H
  68. ;
  69. ;
  70. ; Change the clock speed to suit your system
  71. ;
  72.         DS    3    ;(for  "JMP   START" instruction)
  73. ;
  74. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  75. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    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    1    ;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    NO    ;Cursor control routine         10CH
  90. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  91.                 ;no=resend a record after a valid NAK
  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. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  96. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    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    YES    ;yes=printer available on printer port    119H
  107. XOFFTST:    DB    NO    ;yes=check 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. 20H
  117. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  118. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  119. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  120. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  121. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  122. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  123. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  124. ;
  125. ;
  126.         DS    2        ;                128H
  127. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts    12AH
  128.         OUT    MODCTL1
  129.         IN    MODCTL1        ;get the status bits
  130.         RET
  131.         DS    3
  132. ;
  133. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  134.         DS    7
  135. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  136.         DS    7
  137. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  138. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  139. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  140. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  141.         DS    6        ;                154H
  142. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port     15AH
  143. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  144. ;
  145. ;
  146. LOGONPTR:    DW    LOGON        ;for user message.        160H
  147.         DS    6        ;                162H
  148. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  149. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  150.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  151.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  152.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  153. JMP$SETUPR:    JMP    SETUPR        ;                177H
  154. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  155. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  156. JMP$BREAK:    JMP    SENDBRK        ;                180H
  157. ;
  158. ;
  159. ; Do not change the following six lines.
  160. ;
  161. JMP$ILPRT:    DS    3        ;                183H
  162. JMP$INBUF    DS    3        ;                186H
  163. JMP$INLNCOMP:    DS    3        ;                189H
  164. JMP$INMODEM    DS    3        ;                18CH
  165. JMP$NXTSCRN:    DS    3        ;                18FH
  166. JMP$TIMER:    DS    3        ;                192H
  167. ;
  168. ;
  169. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  170. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  171. ;
  172. CLREOS:        CALL    JMP$ILPRT    ;                195H
  173.         DB    0,0,0,0,0    ;                198H
  174.         RET            ;                19DH
  175. ;
  176. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  177.         DB    0,0,0,0,0    ;                1A1H
  178.         RET            ;                1A6H
  179. ;
  180. ;
  181. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  182.         DB    'Version for XEROX 820 II serial port 04H'
  183.         DB    CR,LF,0
  184.         RET
  185. ;.....
  186. ;
  187. ;
  188. ;-----------------------------------------------------------------------
  189. ;
  190. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  191. ;     end of your last routine should terminate by 0400H (601 bytes
  192. ;     available after start of SYSVER) if using the Hayes Smartmodem
  193. ;     or by address 0C00H (2659 bytes) otherwise.
  194. ;
  195. ;-----------------------------------------------------------------------
  196. ;
  197. ; You can put in a message at this location which can be called up with
  198. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  199. ; desired.  End with a 0.
  200. ;
  201. ;
  202. LOGON:        DB    'This is a Xerox 820 computer',CR,LF,0
  203. ;.....
  204. ;
  205. ;
  206. ; This routine allows a 300 ms. break tone to be sent to reset some
  207. ; time-shar computers.
  208. ;
  209. SENDBRK:  MVI    A,5
  210.       OUT    MODCTL1
  211.       MVI    A,0F8H        ;SEND A BREAK TONE
  212.       JMP    GOODBYE1
  213. ;.....
  214. ;
  215. ;
  216. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  217. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  218. ;
  219. GOODBYE:  MVI    A,5
  220.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  221.       MVI    A,68H        ;TURN OFF DTR
  222. ;
  223. GOODBYE1: OUT    MODCTL1
  224.       MVI    B,3        ;WAIT FOR 300 MS.
  225.       CALL    JMP$TIMER
  226.       MVI    A,5
  227.       OUT    MODCTL1
  228.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  229.       OUT    MODCTL1
  230.       RET
  231. ;.....
  232. ;
  233. ;    
  234. ; XEROX 820 II initialization -- sets CTC timer 00H for send and receive
  235. ; baudrate.
  236. ;
  237. INITMOD:  MVI    A,0        ;SELECT REGISTER
  238.       OUT    MODCTL1
  239.       MVI    A,18H        ;THROW OUT OF MODE
  240.       OUT    MODCTL1
  241.       MVI    A,04H        ;SELECT REGISTER
  242.       OUT    MODCTL1
  243.       MVI    A,44H        ;SET ASCII PARAMETERS
  244.       OUT    MODCTL1
  245.       MVI    A,03H        ;SELECT REG.
  246.       OUT    MODCTL1
  247.       MVI    A,0C1H        ;ENABLE RECEIVE
  248.       OUT    MODCTL1
  249.       MVI    A,05H        ;SELECT REG.
  250.       OUT    MODCTL1
  251.       MVI    A,0EAH        ;ENABLE SEND, 'DTR', 'RTS'
  252.       OUT    MODCTL1
  253. ;
  254. INITMOD1: MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  255.       STA    MSPEED
  256.       MVI    A,47H        ;DEFAULT TO 300 BAUD
  257.       OUT    00H        ;SEND TO 'CTC' TIMER
  258. ;
  259. INITMOD2: MVI    A,05H        ;INITIALIZE TO 300 BAUD
  260.       OUT    00H
  261.       RET
  262. ;.....
  263. ;
  264. ;
  265. ; Setup routine to allow changing modem speed with the SET command.
  266. ;
  267. SETUPR:      LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  268.       CALL    JMP$ILPRT
  269.       DB    'Input Baud Rate (300, 600, 1200, 9600): ',0
  270.       CALL    JMP$INBUF
  271.       LXI    D,BAUDBUF+2
  272.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  273.       DB    '300',0
  274.       JNC    OK300        ;GO IF GOT MATCH
  275.       CALL    JMP$INLNCOMP
  276.       DB    '600',0
  277.       JNC    OK600
  278.       CALL    JMP$INLNCOMP
  279.       DB    '1200',0
  280.       JNC    OK1200
  281.       CALL    JMP$INLNCOMP
  282.       DB    '9600',0
  283.       JNC    OK9600
  284.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  285.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  286.       JMP    SETUPR        ;TRY AGAIN
  287. ;
  288. OK300:      MVI    A,1
  289.       LHLD    BD300
  290.       JMP    LOADBD
  291. ;
  292. OK600:      MVI    A,3
  293.       LHLD    BD600
  294.       JMP    LOADBD
  295. ;
  296. OK1200:      MVI    A,5
  297.       LHLD    BD1200
  298.       JMP    LOADBD
  299. ;
  300. OK9600:      MVI    A,8
  301.       LHLD    BD9600
  302. ;
  303. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  304.       MOV    A,L        ;GET BAUDRATE BYTE
  305.       STA    INITMOD2+1    ;SEND TO 'CTC' TIMER FOR NEW BAUDRATE
  306.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  307. ;
  308. ;
  309. ; TABLE OF BAUDRATE PARAMETERS
  310. ;
  311. BD300:      DW    0005H
  312. BD600:      DW    0006H    
  313. BD1200:      DW    0007H
  314. BD9600:      DW    000EH
  315. ;
  316. BAUDBUF:  DB    10,0
  317.       DS    10
  318. ;
  319. ;-----------------------------------------------------------------------
  320. ;
  321. ; The following routine can be used as an auxiliary menu for notes of
  322. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  323. ; this is unavailable without a special address change.
  324. ;
  325. SPCLMENU: RET
  326. ;
  327. ;-----------------------------------------------------------------------
  328. ;
  329. ;
  330. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  331. ;                 0C00H (without Smartmodem)
  332. ;
  333.       END
  334. ;
  335.