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 / M7FA-2.AQM / M7FA-2.ASM
Assembly Source File  |  2000-06-30  |  15KB  |  415 lines

  1. ; M7FA-2.ASM Franklin ACE overlay file for MDM7xx.  07/12/84
  2. ;
  3. ; This overlay file enables Franklin ACE computers with the Dual
  4. ; Interface Card and external modem to use the MDM7xx phone modem program.
  5. ;
  6. ;************************************************************************
  7. ;*                                    *
  8. ;*            TESTED <<ONLY>> UP TO MDM740            *
  9. ;*                                    *
  10. ;************************************************************************
  11. ;
  12. ; You will want to look this file over carefully. There are a number of
  13. ; options that you can use to configure the program to suit your taste.
  14. ; Much of the information contained here is not in the MDM7xx.ASM file.
  15. ;
  16. ; Edit this file for your preferences then follow the "TO USE:" example.
  17. ;
  18. ; Use the "SET" command to change the baudrate when desired.  
  19. ;
  20. ;---------------------------------------------------------------------
  21. ;
  22. ;       TO USE: First edit this file filling in answers for your own
  23. ;               equipment.  Then assemble with ASM.COM or equivalent
  24. ;               assembler.  Then use DDT to overlay the the results
  25. ;               of this program to the original .COM file:
  26. ;
  27. ;               A>DDT MDM7xx.COM
  28. ;               DDT VERS 2.2
  29. ;               NEXT  PC
  30. ;               yy00 0100
  31. ;               -IM7FA-2.HEX            (note the "I" command)
  32. ;               -R                      ("R" loads in the .HEX file)
  33. ;               NEXT  PC
  34. ;               yy00 0000
  35. ;               -G0                     (return to CP/M)
  36. ;               A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  37. ;
  38. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  39. ;
  40. ; 07/12/84 - Fixed bug causing program to    - Jim McAfee
  41. ;            crash on start-up; added and 
  42. ;         changed some routines.  
  43. ;         Works with MDM740.
  44. ; 05/12/84 - Removed all non-ACE code           - Pete Holsberg
  45. ; 10/24/84 - Added code for Franklin ACE Dual
  46. ;         Interface Card                     - Dave Warker
  47. ; 08/08/83 - Renamed to work with MDM712
  48. ; 07/27/83 - Renamed to work with MDM712        - Irv Hoff
  49. ; 07/01/83 - Revised to work with MDM711        - Irv Hoff
  50. ; 06/22/83 - Revised to work with MDM710        - Irv Hoff
  51. ; 05/27/83 - Updated to work with MDM709        - Irv Hoff
  52. ; 05/15/83 - Revised to work with MDM708        - Irv Hoff
  53. ; 04/11/83 - Updated to work with MDM707        - Irv Hoff
  54. ; 04/04/83 - Updated to work with MDM706        - Irv Hoff
  55. ; 02/27/83 - Updated to work with MDM705        - Irv Hoff
  56. ; 02/12/83 - Used MDM703CF to make this file
  57. ;            for Apple computers using a var-
  58. ;            iety of serial interface cards
  59. ;            with external modem.               - Bruce Kargol
  60. ;
  61. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  62. ;
  63. BELL:           EQU     07H     ;bell
  64. CR:             EQU     0DH     ;carriage return
  65. ESC:            EQU     1BH     ;escape
  66. LF:             EQU     0AH     ;linefeed
  67. ;
  68. YES:            EQU     0FFH
  69. NO:             EQU     0
  70. ;
  71. ;
  72. ;
  73. ; *** FOR 2661 UART:
  74. ;
  75. ;EQUATES FOR MODE REGISTER 1
  76. BRF    EQU    00000010B    ;asynchronous mode
  77. CHARL    EQU    00001100B    ;8 bits
  78. PARITY    EQU    00000000B    ;no parity
  79. STOPBIT EQU    01000000B    ;1 stop bit
  80.  
  81. ;EQUATES FOR MODE REGISTER 2
  82. BAUDDIV EQU    00000110B    ;300 baud
  83. TXCRXC    EQU    00110000B    ;internal clocks
  84.  
  85. ;EQUATES FOR COMMAND REGISTER
  86. OPMODE    EQU    00000000B    ;normal operation
  87. RTS    EQU    00100000B    ;RTS logic true
  88. RESETER EQU    00010000B    ;reset error flags
  89. NOBREAK EQU    00000000B    ;no break
  90. BREAKON EQU    00001000B    ;send break
  91. RXTXEN    EQU    00000101B    ;enable transmitter and receiver
  92. DTR    EQU    00000010B    ;DTR logic true
  93. ;
  94. ;
  95. ACEPROM        EQU    0C200H     ;base of slot code for serial port
  96. MODDATP         EQU     0CE00H  ;data port of 2661-2 serial I/O chip
  97. MODCTL1         EQU     0CE01H  ;status port 
  98. MODREG         EQU    0CE02H    ;baud rate and char format port
  99. CMDREG        EQU    0CE03H    ;command port
  100. ;
  101. MODRCVB         EQU     02H     ;bit to test for char received
  102. MODRCVR         EQU     02H     ;  value when ready
  103. MODSNDB         EQU     01H     ;bit to test for send
  104. MODSNDR         EQU     01H     ;  value when ready
  105. ;
  106. ;
  107.                 ORG     100H
  108. ;
  109.                 DS      3       ;(for  "JMP   START" instruction)
  110. ;
  111. PMMIMODEM:      DB      NO      ;yes=PMMI S-100 Modem                   103H
  112. SMARTMODEM:     DB      YES     ;yes=HAYES Smartmodem, no=non-pmmi      104H
  113. TOUCHPULSE:     DB      'T'     ;T=touch, P=pulse (Smartmodem-only)     105H
  114. CLOCK:          DB      60      ;clock speed in MHz x10, 25.5 MHz max.  106H
  115.                                 ;20=2 MHz, 37=3.68 MHz, 40=4 MHz, etc.
  116. MSPEED:         DB      1       ;0=110 1=300 2=450 3=600 4=710 5=1200   107H
  117.                                 ;6=2400 7=4800 8=9600 9=19200 default
  118. BYTDLY:         DB      5       ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   108H
  119.                                 ;default time to send character in ter-
  120.                                 ;minal mode file transfer for slow BBS.
  121. CRDLY:          DB      5       ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  122.                                 ;default time for extra wait after CRLF
  123.                                 ;in terminal mode file transfer
  124. NOOFCOL:        DB      5       ;number of DIR columns shown            10AH
  125. SETUPTST:       DB      YES     ;yes=user-added Setup routine           10BH
  126. SCRNTEST:       DB      YES     ;Cursor control routine                 10CH
  127. ACKNAK:         DB      YES     ;yes=resend record after any non-ACK    10DH
  128.                                 ;no=resend only on valid NAK
  129. BAKUPBYTE:      DB      NO      ;yes=change any file same name to .BAK  10EH
  130. CRCDFLT:        DB      YES     ;yes=default to CRC checking            10FH
  131. TOGGLECRC:      DB      YES     ;yes=allow toggling of CRC to Checksum  110H
  132. CONVRUB:        DB      NO      ;yes=convert rub to backspace           111H
  133. TOGGLERB:       DB      YES     ;yes=allow toggling of rub to bksp      112H
  134. ADDLF:          DB      NO      ;no=no LF after CR to send file in      113H
  135.                                 ;terminal mode (added by remote echo)
  136. TOGGLELF:       DB      YES     ;yes=allow toggling of LF after CR      114H
  137. TRANLOGON:      DB      YES     ;yes=allow transmission of logon        115H
  138.                                 ;write logon sequence at location LOGON
  139. SAVCCP:         DB      YES     ;yes=do not overwrite CCP               116H
  140. LOCONEXTCHR:    DB      NO      ;yes=local command if EXTCHR precedes   117H
  141.                                 ;no=external command if EXTCHR precedes
  142. TOGGLELOC:      DB      YES     ;yes=allow toggling of LOCONEXTCHR      118H
  143. LSTTST:         DB      YES     ;yes=printer available on printer port  119H
  144. XOFFTST:        DB      NO      ;yes=checks for XOFF from remote while  11AH
  145.                                 ;sending a file in terminal mode
  146. XONWAIT:        DB      NO     ;yes=wait for XON after CR while        11BH
  147.                                 ;sending a file in terminal mode
  148. TOGXOFF:        DB      YES     ;yes=allow toggling of XOFF checking    11CH
  149. IGNORCTL:       DB      YES     ;yes=CTL-chars above ^M not displayed   11DH
  150. EXTRA1:         DB      0       ;for future expansion                   11EH
  151. EXTRA2:         DB      0       ;for future expansion                   11FH
  152. ;
  153. ;>>> NOTE: some of the following characters have been changed from
  154. ;       what is reported in the menu of MDM7xx.  Use DU or EDFILE
  155. ;       to change the menu to match.
  156. ;
  157. BRKCHR:         DB      '@'-40H ;^B = Send 300 ms. break tone           120H
  158. NOCONNCT:       DB      'N'-40H ;^N = Disconnect from the phone line    121H
  159. LOGCHR:         DB      'O'-40H ;^L = Send logon                        122H
  160. LSTCHR:         DB      'P'-40H ;^P = Toggle printer                    123H
  161. UNSAVE:         DB      'R'-40H ;^R = Close input text buffer           124H
  162. TRANCHR:        DB      'T'-40H ;^T = Transmit file to remote           125H
  163. SAVECHR:        DB      'Y'-40H ;^Y = Open input text buffer            126H
  164. EXTCHR:         DB      '^'-40H ;^^ = Send next character               127H
  165.                 DS      2       ;                                   128H
  166. ;
  167. IN$MODCTL1:     PUSH    D        ;in modem control port        12AH
  168.         LXI    D,MODCTL1
  169.         CALL    PEEK
  170.         POP    D 
  171.         RET   
  172.                 DS      1
  173. ;
  174. OUT$MODDATP:    PUSH    D        ;out modem data port            134H
  175.                 LXI    D,MODDATP
  176.         CALL    POKE
  177.         POP    D
  178.         RET
  179.         DS      1
  180. ;
  181. IN$MODDATP:     PUSH    D        ;in modem data port             13EH
  182.         LXI    D,MODDATP
  183.         CALL    PEEK
  184.         POP    D
  185.                 RET      
  186.         DS    1
  187. ;
  188. ANI$MODRCVB:    ANI     MODRCVB ! RET   ;bit to test for receive ready  148H
  189. CPI$MODRCVR:    CPI     MODRCVR ! RET   ;value of rcv. bit when ready   14BH
  190. ANI$MODSNDB:    ANI     MODSNDB ! RET   ;bit to test for send ready     14EH
  191. CPI$MODSNDR:    CPI     MODSNDR ! RET   ;value of send bit when ready   151H
  192.                 DS      12              ;PMMI only calls                154H
  193. ;
  194. LOGONPTR:       DW      LOGON           ;for user message.              160H
  195.                 DS      6               ;                               162H
  196. JMP$GOODBYE:    JMP     GOODBYE         ;                               168H
  197. JMP$INITMOD:    JMP     INITMOD         ;go to user written routine     16BH
  198.                 RET  !  NOP  !  NOP     ;(by-passes PMMI routine)       16EH
  199.                 RET  !  NOP  !  NOP     ;(by-passes PMMI routine)       171H
  200.                 RET  !  NOP  !  NOP     ;(by-passes PMMI routine)       174H
  201. JMP$SETUPR:     JMP     SETUPR          ;                               177H
  202. JMP$SPCLMENU:   JMP     SPCLMENU        ;                               17AH
  203. JMP$SYSVER:     JMP     SYSVER          ;                               17DH
  204. JMP$BREAK:      JMP     SENDBRK         ;                               180H
  205. ;
  206. ;
  207. ; Do not change the following six lines.
  208. ;
  209. JMP$ILPRT:      DS      3               ;                               183H
  210. JMP$INBUF:      DS      3               ;                               186H
  211. JMP$INLNCOMP:   DS      3               ;                               189H
  212. JMP$INMODEM:    DS      3               ;                               18CH
  213. JMP$NXTSCRN:    DS      3               ;                               18FH
  214. JMP$TIMER:      DS      3               ;                               192H
  215. ;
  216. ;
  217. CLREOS:         CALL    JMP$ILPRT       ;                               195H
  218. EOSCLR:         DB      1BH,59H,0,0,0   ;                198H
  219.                 RET                     ;                               19DH
  220. ;
  221. CLRSCRN:        CALL    JMP$ILPRT       ;                               19EH
  222.                 DB      1BH,2AH,0,0,0   ;                1A1H
  223.                 RET                     ;                               1A6H
  224. ;
  225. SYSVER:         CALL    JMP$ILPRT       ;                               1A7H
  226.                 DB      'Version for FRANKLIN ACE',CR,LF,0
  227.                 RET
  228. ;.....
  229. ;
  230. ;
  231. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  232. ;        end of your last routine should terminate by 0400H (601 bytes
  233. ;        available after start of SYSVER) if using the Hayes Smartmodem
  234. ;        or by address 0C00H (2659 bytes) otherwise.
  235. ;
  236. ;
  237. ; You can put in a message at this location which can be called up with
  238. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  239. ; desired.  End with a 0.
  240. ;
  241. LOGON:  DB      'Hello',CR,0
  242. ;
  243. ;
  244. ; You can add your own routine here to send a break tone to reset time-
  245. ; share computers, if desired.
  246. ;
  247. SENDBRK:RET
  248. ;
  249. ;
  250. ; You can add your own routine here to set DTR low and/or send a break
  251. ; tone to disconnect.
  252. ;
  253. GOODBYE:RET
  254. ;
  255. ;------------------------------------------------------------------
  256. ;
  257. RDBYTE    EQU    0FFE0H    ;read a byte from the ACE accumulator
  258. WRBYTE    EQU    0FFE3H    ;write a byte to the ACE (register C)
  259. RDWORD  EQU    0FFE6H    ;read 2 bytes from DE
  260. WRWORD    EQU    0FFE9H    ;write 2 bytes to DE
  261. ;
  262. PEEK1BYTE    EQU    6
  263. POKE1BYTE    EQU    7
  264. ;
  265. ;
  266. ;-------------------------------------------------------------------
  267. ;
  268. ;Enable Dual Interface Card expansion memory
  269. ;
  270. ENBEXP:    PUSH    D
  271.     LXI    D,0CFFFH    ;disable expansion mem
  272.     CALL    PEEKX
  273.     LXI    D,ACEPROM    ;enable ours
  274.     CALL    PEEKX
  275.     POP    D
  276.     RET
  277. ;
  278. ;---------------------------------------------------------------------
  279. ;PEEK at one byte
  280. ;
  281. ;ENTER with address in DE
  282. ;EXIT  with byte in A
  283. ;
  284. PEEK:    CALL    ENBEXP
  285. PEEKX:    PUSH    B
  286.     MVI    C,PEEK1BYTE
  287.     CALL    WRBYTE
  288.     CALL    WRWORD
  289.     CALL    RDBYTE
  290.     POP    B
  291.     RET
  292. ;
  293. ;------------------------------------------------------------
  294. ;POKE one byte
  295. ;
  296. ;ENTRY: DE = address
  297. ;EXIT:  A  = data
  298. ;
  299. POKE:    PUSH    PSW
  300.     CALL    ENBEXP
  301.     POP    PSW
  302. POKEX:    PUSH    B
  303.     MOV    B,A
  304.     MVI    C,POKE1BYTE
  305.     CALL    WRBYTE
  306.     CALL    WRWORD
  307.     MOV    C,B
  308.     CALL    WRBYTE
  309.     POP    B
  310.     RET
  311. ;
  312. ;---------------------------------------------------------------
  313. ;
  314. INITMOD:MVI    A,1        ;set speed byte    (default to 300)
  315.     STA    MSPEED
  316.     DI
  317. ;
  318.     MVI    A,BRF+CHARL+PARITY+STOPBIT
  319.     LXI    D,MODREG     ;mode register 1
  320.     CALL    POKE
  321. BDDIV:    MVI    A,BAUDDIV
  322.     ADI    TXCRXC
  323.     LXI    D,MODREG     ;mode register 2 (cycles automatically)
  324.     CALL    POKEX
  325. ;
  326.     MVI    A,OPMODE+RTS+NOBREAK+RXTXEN+DTR
  327.     LXI    D,CMDREG    ;command register
  328.     CALL    POKEX
  329. ;
  330.     EI
  331.     RET
  332. ;
  333. ;
  334. ;--------------------------------------------------------------------
  335. ;
  336. ; The following routine changes the baud rate for the ACE with the SET
  337. ; command.
  338. ;
  339. SETUPR:   LXI    D,BAUDBUF    ;point to input buffer for INLNCOMP
  340.       CALL    JMP$ILPRT
  341.       DB    'Input Baud Rate (300, 600, 1200, 4800, 9600): ',0
  342.       CALL    JMP$INBUF
  343.       LXI    D,BAUDBUF+2
  344.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  345.       DB    '300',0
  346.       JNC    OK300        ;go if got match
  347.       CALL    JMP$INLNCOMP
  348.       DB    '600',0
  349.       JNC    OK600
  350.       CALL    JMP$INLNCOMP
  351.       DB    '1200',0
  352.       JNC    OK1200
  353.       CALL  JMP$INLNCOMP
  354.       DB    '4800',0
  355.       JNC    OK4800
  356.       CALL    JMP$INLNCOMP
  357.       DB    '9600',0
  358.       JNC    OK9600
  359.       CALL    JMP$ILPRT    ;all matches failed - tell operator
  360.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  361.       JMP    SETUPR        ;try again
  362. ;
  363. OK300:      MVI    A,1        ;MSPEED 300 baud value
  364.       LHLD    BD300        ;get 300 baud parameters in HL
  365.       JMP    LOADBD        ;go load them
  366. ;
  367. OK600:      MVI    A,3
  368.       LHLD    BD600
  369.       JMP    LOADBD
  370. ;
  371. OK1200:   MVI    A,5
  372.       LHLD    BD1200
  373.       JMP    LOADBD
  374. ;
  375. OK4800:      MVI    A,7
  376.       LHLD    BD4800
  377.       JMP    LOADBD
  378. ;
  379. OK9600:   MVI    A,8
  380.       LHLD    BD9600
  381. ;
  382. LOADBD:   STA    INITMOD+1    ;store speed to show transfer time 
  383.       MOV    A,L        ;get least significant baud rate byte
  384.       STA    BDDIV+1     ;store in INITMOD
  385.       JMP    INITMOD     ;reset ACE 2661
  386. ;
  387. ;
  388. ; Table of baud rate parameters
  389. ;                           
  390. BD300:    DB    06H
  391. BD600:    DB    07H 
  392. BD1200: DB    08H  
  393. BD4800:    DB    0CH
  394. BD9600: DB    0DH
  395. ;
  396. BAUDBUF:DW        10,0            ;TELLS CLEARBUF ROUTINE IT CAN..
  397.         DS      10              ;..CLEAR NEXT 10 BYTES
  398. ;
  399. ;-----------------------------------------------------------------------
  400. ;
  401. ; The following routine can be used to display commands on the screen
  402. ; of interest to users of this equipment.  If using the Hayes Smartmodem
  403. ; this is unavailable without a special address change.
  404. ;
  405. SPCLMENU: RET
  406. ;
  407. ;-----------------------------------------------------------------------
  408. ;
  409. ; NOTE: MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  410. ;                               0C00H (without Smartmodem)
  411. ;
  412.         END
  413.  
  414.  
  415.