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 / M7PX-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  13KB  |  387 lines

  1. ; M7PX-1.ASM -- Epson PX-8 overlay file for MDM7xx.  10/24/84 <pms>
  2. ;
  3. ;
  4. ;   This overlay file supports the EPSON PX-8 "Geneva" microcomputer.
  5. ;It was derived from the M7VT-2 file that supports the DEC VT180,
  6. ;Rainbow and DECmate II computers with CP/M.
  7. ;
  8. ;   It uses the RS232c port of the Epson PX-8.    Baud-rates must be set
  9. ;prior to using the program with the vendor-supplied "CONFIG.COM"
  10. ;program.  Since the RS-232C port is I/O-wise Reader/Punch, it uses
  11. ;the BDOS calls to those devices.
  12. ;
  13. ;   To test for COMM-status, it uses I/O byte redirection in conjunction
  14. ;with a direct BIOS-CONSTAT call.
  15. ;
  16. ;   This technique, although a little bit slower than direct port I/O
  17. ;using Interrupt on INPUT, is general enough to be system independent.
  18. ;It may be used on most microcomputers once the I/O byte is decoded.
  19. ;
  20. ;   Many thanks for this technique to:
  21. ;
  22. ;    - B. Eiben DEC Large System Marketing Marlboro Mass
  23. ;
  24. ;    How to get it onto your EPSON PX-8
  25. ;
  26. ;   The vendor-supplied "TERM.COM" program will allow for ASCII text
  27. ;file transfer without any error checking.  I had a marked degree of
  28. ;success in getting stuff onto the EPSON PX-8 computer by first changing
  29. ;the .COM files into the INTEL HEX format using UNLOAD.COM from the
  30. ;CP/M user group disk xx.  I then used MODEM7 to send the INTEL HEX
  31. ;format file to the Epson PX-8 from my machine.  Since the screen display
  32. ;on the PX-8 is a little slower than 1200 baud, and since TERM wants to
  33. ;display all received characters, insert a 200 millisecond delay after
  34. ;each carriage return on the sending machine.  Once the .HEX file was
  35. ;sent to the EPSON, I used the LOAD.COM (supplied with the EPSON PF-10
  36. ;floppy drive) to reconstitute the .COM file.
  37. ;
  38. ;   According to the information in the manuals for the Epson PX-8, the
  39. ;UART is described as the 82C51.  I was unable to find the port addresses
  40. ;in any of the documentation that I had, and SURVEY showed me 111 active
  41. ;ports.  If you wish to set up a fancier version with baud rate setting
  42. ;etc. built in, it would seem that the place to start might be the Datapoint,
  43. ;NorthStar, Vector, or Intertec overlays as those use the 8251 UART.
  44. ;
  45. ;   Hope you enjoy it!
  46. ;
  47. ;    Paul M. Sittler
  48. ;    Department of Veterinary Public Health
  49. ;    College of Veterinary Medicine
  50. ;    Texas A&M University
  51. ;    College Station, TX 77843-4468
  52. ;    VPH RBBS/RCPM (409) 845-0509 24 Hours @ 300/1200 baud.
  53. ;
  54. ;
  55. ;***********************************************************************
  56. ;
  57. ; You will want to look this file over carefully.  There are a
  58. ; number of options that you can use to configure the program to
  59. ; suit your taste.  This file places particular emphasis on using
  60. ; an external modem that does not match one of the other special
  61. ; overlays.  You would use the normal CP/M "CONFIG.COM" program to
  62. ; set the RS-232C port to whatever baud rate you would normally use
  63. ; such as 300 or 1200, etc.)
  64. ;
  65. ;  You could look at other overlay files to see how the GOODBYE
  66. ; and/or SETUPR areas are handled.  You could then adapt one of
  67. ; those, if appropriate, for your equipment in this overlay.  Some
  68. ; examples:
  69. ;
  70. ;     "DP"  Datapoint 1560 overlay using 8251 I/O and CTC timers for
  71. ;           setting baud rates
  72. ;     "H8"  Heath H89 overlay for 8250 I/O and programmable baud rates
  73. ;     "HZ"  Zenith 120 overlay for 2661B initialization and baud rates
  74. ;     "XE"  Xerox 820II overlay for Z80-SIO intialization, etc.
  75. ;
  76. ;  Edit  this  file for your preferences then follow the "TO USE:"
  77. ; example shown below.
  78. ;
  79. ;    TO USE: First edit this file filling in answers for your own
  80. ;        equipment.  Assemble with ASM.COM or equivalent
  81. ;        assembler.  Then. use DDT to overlay the the results
  82. ;        of this program to the original .COM file:
  83. ;
  84. ;        A>DDT
  85. ;        DDT VERS 2.2
  86. ;        NEXT   PC
  87. ;        0100  0100
  88. ;        F100 C000 00        (fill memory from 100 to C000
  89. ;        -IMDM7xx.COM         with zeros for housekeeping)
  90. ;        -RMDM7xx.COM
  91. ;        NEXT  PC
  92. ;        4A00 0100
  93. ;        -IM7PX-1.HEX        (note the "I" command)
  94. ;        -R            ("R" loads in the .HEX file)
  95. ;        NEXT  PC
  96. ;        4A00 0000
  97. ;        -G0            (return to CP/M)
  98. ;
  99. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  100. ;
  101. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  102. ;
  103. ; 10/23/84 - Revised to work with Epson PX-8    - Paul M. Sittler
  104. ; 11/24/83 - Changed to add Rainbow and Decmate - B.G.E.
  105. ; 11/11/83 - Renamed to M7VT-1.ASM, no changes    - Irv Hoff
  106. ; 08/09/83 - Revised to work with a VT180    - Michael Gwilliam
  107. ; 04/04/83 - First version of this file     - Irv Hoff
  108. ;
  109. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  110. ;
  111. BELL:        EQU    07H        ;bell
  112. CR:        EQU    0DH        ;carriage return
  113. ESC:        EQU    1BH        ;escape
  114. LF:        EQU    0AH        ;linefeed
  115. ;
  116. TRUE:        EQU    0FFH
  117. FALSE:        EQU    0
  118. YES:        EQU    0FFH
  119. NO:        EQU    0
  120. ;
  121. ;
  122. ; Change the following information to match your equipment
  123. ;
  124. EPSNPX        EQU    TRUE        ;For EPSON PX-8 Computer
  125. ;
  126. BDOS:        EQU    0005        ;address of BDOS entry
  127. PUNCH:        EQU    4        ;punch function
  128. READER:     EQU    3        ;reader function
  129. MODDCDB:    EQU    0FFH        ;carrier detect bit
  130. MODDCDA:    EQU    0FFH        ;value when active
  131. MODRCVB:    EQU    0FFH        ;bit to test for receive
  132. MODRCVR:    EQU    0FFH        ;value when ready
  133. MODSNDB:    EQU    0FFH        ;bit to test for send
  134. MODSNDR:    EQU    0FFH        ;value when ready
  135. ;
  136. ;
  137.         ORG    100H
  138. ;
  139. ;
  140. ; Change the clock speed to suit your system
  141. ;
  142.         DS    3    ;(for  "JMP   START" instruction)
  143. ;
  144. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  145. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  146. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  147. CLOCK:        DB    01    ;clock speed in MHz x10, 25.5 MHz max.    106H
  148.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  149.                 ;When EPSON PX8 CLOCK is set to 100 KHZ it
  150.                 ;times out in 14.4 second intervals.  <pms>
  151. MSPEED:     DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  152.                 ;6=2400 7=4800 8=9600 9=19200 default
  153. BYTDLY:     DB    3    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  154.                 ;default time to send character in ter-
  155.                 ;minal mode file transfer for slow BBS.
  156. CRDLY:        DB    3    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  157.                 ;default time for extra wait after CRLF
  158.                 ;in terminal mode file transfer
  159. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  160. SETUPTST:    DB    NO    ;yes=user-added Setup routine        10BH
  161. SCRNTEST:    DB    no    ;Cursor control routine         10CH
  162. ACKNAK:     DB    YES    ;yes=resend a record after any non-ACK    10DH
  163.                 ;no=resend a record after a valid-NAK
  164. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  165. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  166. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  167. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  168. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  169. BADDLF:     DB    NO    ;no=no LF after CR to send file in    113H
  170.                 ;terminal mode (added by remote echo)
  171. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  172. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  173.                 ;write logon sequence at location LOGON
  174. SAVCCP:     DB    YES    ;yes=do not overwrite CCP        116H
  175. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  176.                 ;no=external command if EXTCHR precedes
  177. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  178. LSTTST:     DB    YES    ;yes=printer available on printer port    119H
  179. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  180.                 ;sending a file in terminal mode
  181. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  182.                 ;sending a file in terminal mode
  183. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  184. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  185. EXTRA1:     DB    0    ;for future expansion            11EH
  186. EXTRA2:     DB    0    ;for future expansion            11FH
  187. BRKCHR:     DB    '@'-40H ;^@ = Send 300 ms. break tone        120H
  188. NOCONNCT:    DB    'N'-40H ;^N = Disconnect from the phone line    121H
  189. LOGCHR:     DB    'L'-40H ;^L = Send logon            122H
  190. LSTCHR:     DB    'P'-40H ;^P = Toggle printer            123H
  191. UNSAVE:     DB    'R'-40H ;^R = Close input text buffer        124H
  192. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  193. SAVECHR:    DB    'Y'-40H ;^Y = Open input text buffer        126H
  194. EXTCHR:     DB    '^'-40H ;^^ = Send next character        127H
  195.                 ;changed to be closer to KERMIT (B.G.E)
  196. ;
  197. ;
  198.         DS    2        ;                128H
  199. ;
  200. IN$MODCTL1:    JMP    INCTL        ;in modem control port        12AH
  201.         DS    7
  202. OUT$MODDATP:    JMP    OUTDATA     ;out modem data port        134H
  203.         DS    7
  204. IN$MODDATP:    JMP    INDATA        ;in modem data port        13EH
  205.         DS    7
  206. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    148H
  207.  
  208. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14BH
  209. ANI$MODSNDB:    MVI    A,MODSNDB ! RET ;bit to test for send ready    14EH
  210. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    151H
  211.         DS    6        ;Together these do nothing    156H
  212. ;
  213. OUT$MODCTL1:    RET ! NOP ! NOP     ;out modem control port #2    15AH
  214. OUT$MODCTL2:    RET ! NOP ! NOP     ;out modem control port #1    15DH
  215. ;
  216. LOGONPTR:    DW    LOGON        ;for user message.        160H
  217.         DS    6        ;                162H
  218. JMP$GOODBYE:    JMP    GOODBYE     ;                168H
  219. JMP$INITMOD:    JMP    INITMOD     ;go to user written routine    16BH
  220.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  221.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  222.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  223. JMP$SETUPR:    JMP    SETUPR        ;                177H
  224. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  225. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  226. JMP$BREAK:    JMP    SENDBRK     ;                180H
  227. ;
  228. ;
  229. ; Do not change the following six lines.
  230. ;
  231. JMP$ILPRT:    DS    3        ;                183H
  232. JMP$INBUF    DS    3        ;                186H
  233. JMP$INLNCOMP:    DS    3        ;                189H
  234. JMP$INMODEM    DS    3        ;                18CH
  235. JMP$NXTSCRN:    DS    3        ;                18FH
  236. JMP$TIMER    DS    3        ;                192H
  237. ;
  238. ;
  239. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  240. ; SCRNTEST to YES at 010AH (above).
  241. ;
  242. CLREOS:     CALL    JMP$ILPRT    ;                195H
  243.         DB    0,0,0,0,0    ;                198H
  244.         RET            ;                19DH
  245. ;
  246. CLRSCRN:    JMP    JMP$ILPRT    ;                19EH
  247.         DB    0,0,0,0,0    ;                1A1H
  248.         RET            ;                1A6H
  249.     
  250. ;
  251. SYSVER:     CALL    JMP$ILPRT    ;                1A7H
  252.         DB    'Version for Epson PX-8'
  253.         DB    CR,LF
  254.         DB    'RS-232c port with external modem'
  255.         DB    CR,LF,0
  256.         RET
  257. ;.....
  258. ;
  259. ;
  260. ; Modem I/O primitive
  261. ;
  262. ; Subroutine to output a character to the modem.
  263. ; This routine does it's own status checking.
  264. ;
  265. OUTDATA:  PUSH    B        ;save...
  266.       PUSH    D        ;...the...
  267.       PUSH    H        ;...registers.
  268.       MOV    E,A        ;move output byte into E
  269.       MVI    C,PUNCH     ;use the BDOS function
  270.       CALL    BDOS        ;go
  271.       POP    H        ;restore...  
  272.       POP    D        ;...the...
  273.       POP    B        ;...registers.
  274.       RET
  275. ;.....
  276. ;
  277. ;
  278. ; Subroutine to input a character from the modem.
  279. ; This routine will wait until one becomes available.
  280. ;
  281. INDATA:   PUSH    B        ;save...
  282.       PUSH    D        ;...the...
  283.       PUSH    H        ;...registers.
  284.       MVI    C,READER    ;use the BDOS function
  285.       CALL    BDOS        ;go
  286.       POP    H        ;restore...
  287.       POP    D        ;...the...
  288.       POP    B        ;...registers.
  289.       RET
  290. ;.....
  291. ;
  292. ; The Check for characters at COMM-Port using I/O redirection
  293. ;
  294. IOBYTE    EQU    3        ; some definitions
  295.  
  296. DEFIO    EQU    0A9H        ; the standard setting
  297. BATIO    EQU    6AH        ; for the Epson PX-8
  298.  
  299. INCTL:    PUSH    B
  300.     PUSH    D
  301.     PUSH    H        ; save the environment
  302.     MVI    A,BATIO     ; change I/O byte
  303.     STA    IOBYTE
  304.     CALL    BCONST        ; call BIOS direct - see INITMOD
  305.     PUSH    A
  306.     MVI    A,DEFIO     ; change I/O byte back
  307.     STA    IOBYTE
  308.     POP    A
  309.     POP    H        ; restore environment
  310.     POP    D
  311.     POP    B
  312.     RET
  313. ;.....        
  314. ;        
  315. ;        
  316. ;-----------------------------------------------------------------------
  317. ;        
  318. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  319. ;     end of your last routine should terminate by 0400H (601 bytes
  320. ;     available after start of SYSVER) if using the Hayes Smartmodem
  321. ;     or by address 0C00H (2659 bytes) otherwise.
  322. ;
  323. ;-----------------------------------------------------------------------
  324. ;
  325. ; You can put in a message at this location which can be called up with
  326. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  327. ; desired.  End with a 0.
  328. ;
  329. LOGON:      DB    'Howdy from an EPSON PX-8 computer!',CR,LF,0
  330. ;.....
  331. ;
  332. ;
  333. ; Add your own routine here to send a break tone to reset some time-share
  334. ; computers, if desired.
  335. ;
  336. SENDBRK:  RET
  337. ;.....
  338. ;
  339. ;
  340. ; Add your own routine here to put DTR low and/or send a break tone.
  341. ; Check other routines such as MDM709DP.ASM which is using this feature.
  342. ;
  343. GOODBYE:  RET
  344. ;.....
  345. ;
  346. ;
  347. ; You can use this area for any special initialization or setup you may
  348. ; wish to include.  Each must stop with a RET.    You can check the other
  349. ; available overlays for ideas how to write your own routines if that
  350. ; may be of some help.
  351. ;
  352. INITMOD:  LHLD    1        ; Get BIOS Jump-table adress
  353.       LXI    D,3
  354.       DAD    D        ; CONSTAT routine in BIOS
  355.       SHLD    BCONST+1    ; modify our "routine"
  356.       RET
  357. ;
  358. BCONST:   JMP    $-$        ; address "filled in" by above code
  359. ;
  360. SETUPR:   RET
  361. ;
  362. ;
  363. ; If using the Hayes Smartmodem this is unavailable without a special
  364. ; change.
  365. ;
  366. SPCLMENU: RET
  367. ;
  368. ;
  369. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  370. ;                 0C00H (without Smartmodem)
  371. ;.....
  372. ;
  373.       END
  374. ;
  375. 
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386. 0H (with Smartmodem)
  387. ;                 0C00H (wit