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 / M7AQ-4.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  18KB  |  655 lines

  1. ; M7AQ-4.ASM Apple Micromodem overlay file for MDM730  05/18/84
  2. ;
  3. ; This overlay file for MDM730 program is based on M712AP.ASM to support
  4. ; the AppliCard or Softcard and the Micromodem ][.  Please note the specific
  5. ; equates for 6MHz on AppliCard.  Since code changes in the main sec-
  6. ; tion were necessary to support auto-dial with the Micromodem, MDM730
  7. ; specific equates are defined in this overlay.
  8. ;
  9. ; In the code section of this overlay, code sections, labels, etc. which
  10. ; go to the main program are listed in <lower-case>.  Code that is called
  11. ; through established MDM7xx overlay vectors are listed in <UPPER CASE>
  12. ; and, therefore, can be modified.  Take care in changing code which
  13. ; overlays main program.
  14. ;
  15. ; NOTE: When using this overlay, be careful to save the working file un-
  16. ; der a different name than original file since major changes are made
  17. ; in the main program by this overlay.    MDM730 requires 73 sectors be
  18. ; saved rather than 66 or more as in earlier MDM7xx programs.
  19. ;                    - Henry Middlebrook
  20. ;
  21. ;----------------------------------------------------------------------
  22. ;
  23. ; This overlay file enables Apple ][ computers to use the following
  24. ; Apple modem configuration at 300 baud only:
  25. ;
  26. ;    > Hayes Micromodem ][ and 6 MHz PCPI AppliCard <
  27. ;    > Hayes Micromodem ][ and Microsoft Softcard or equivalent <
  28. ;    
  29. ; It can be modified to be used with most of the available Z-80 processor
  30. ; boards available for the Apple including SoftCard and PCPI Applicard.
  31. ;
  32. ; You will want to look this file over carefully.  There are a number of
  33. ; options that you can use to configure the program to suit your taste.
  34. ;
  35. ; Edit this file for your preferences then follow the "TO USE:" example.
  36. ;
  37. ;    TO USE: First edit this file filling in answers for your own
  38. ;        equipment.  Then assemble with ASM.COM or equivalent
  39. ;        assembler.  Then use DDT to overlay the the results
  40. ;        of this program to the original .COM file:
  41. ;
  42. ;        A>DDT MDM730.COM
  43. ;        DDT VERS 2.2
  44. ;        NEXT  PC
  45. ;        4A00 0100
  46. ;        -IM7AQ-4.HEX        (note the "I" command)
  47. ;        -R            ("R" loads in the .HEX file)
  48. ;        NEXT  PC
  49. ;        4A00 0000
  50. ;        -G0            (return to CP/M)
  51. ;        A>SAVE 73 M730.COM    (now have a new .COM file)
  52. ;
  53. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  54. ;
  55. ; 05/18/84 - Renamed to avoid confusion with another M7AQ-3 which
  56. ;         didn't have as many features.    - Keith Petersen
  57. ; 04/22/84 - Added conditionals for Softcard, fixed so no hangup
  58. ;         if program exited and restarted, revised with
  59. ;         MDM730 addresses            - Ross Alford
  60. ; 03/15/84 - Revised with MDM729 addresses    - Henry Middlebrook
  61. ; 03/10/84 - Revised with MDM727 addresses    - Henry Middlebrook
  62. ; 02/29/84 - Revised with MDM724 addresses    - Henry Middlebrook
  63. ; 02/28/84 - Revised for MM][ Auto Dial     - Henry Middlebrook
  64. ; 08/27/83 - Revised to work with Applicard    - William Cook
  65. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  66. ; 02/12/83 - Used MDM703CF to make this file
  67. ;         for Apple computers using a var-
  68. ;         iety of serial interface cards
  69. ;         with external modem.        - Bruce Kargol
  70. ;
  71. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  72. ;
  73. ;    SPECIAL EQUATES FOR OVERLAYING ROUTINES IN MAIN PROGRAM
  74. ;    -------------------------------------------------------
  75. ;
  76. ;        These equates are specific to MDM730!
  77. ;
  78. DIAL18:        EQU    05DFH
  79. CONMADE:    EQU    06AFH
  80. DIALA2:        EQU    072BH
  81. DIALBGN:    EQU    07AFH
  82. DISCONNT:    EQU    0826H
  83. GOODBYE:    EQU    DISCONNT
  84. RINGBK:        EQU    0950H
  85. RINGBK2:    EQU    0989H
  86. WAIT:        EQU    09C6H
  87. PMMI$MENU:    EQU    09EDH    ;SPCLMENU entry in main program
  88. SPCLMENU$DB:    EQU    09F8H    ;SPCLMENU data area
  89. TIMER:        EQU    0CBBH
  90. RESTART1:    EQU    1433H
  91. BREAK:        EQU    20AEH    
  92. BREAK1:        EQU    20CBH    
  93. ;
  94. ;
  95. ;-------------- START OF MAIN OVERLAY ---------------------------------
  96. ;
  97. BELL:        EQU    07H    ;bell
  98. CR:        EQU    0DH    ;carriage return
  99. ESC:        EQU    1BH    ;escape
  100. LF:        EQU    0AH    ;linefeed
  101. FSW:        EQU    15H    ;Data format byte for Micromodem, see manual
  102. ;
  103. YES:        EQU    0FFH
  104. NO:        EQU    0
  105. ;
  106. SOFTCARD:    EQU    YES    ;Yes for Softcard, Z-Card, etc.
  107. APPLICARD:    EQU    NO    ;Yes for Applicard
  108. MMII:        EQU    YES    ;YES for Micromodem II
  109. ;
  110.         IF    APPLICARD
  111. OFFSET:        EQU    0C000H
  112.         ENDIF        ;Applicard
  113. ;
  114.         IF    SOFTCARD
  115. OFFSET:        EQU    0E000H
  116.         ENDIF        ;Softcard
  117. ;
  118. MODDATP:    EQU    0A7H + OFFSET    ;data port of MMII
  119. MODCTLP:    EQU    0A6H + OFFSET    ;status port of MMII
  120. MODCTLP2:    EQU    0A5H + OFFSET    ;control port 2 of MMII
  121. ;
  122.         IF    APPLICARD
  123. RDBYTE:        EQU    0FFE0H    ;read a byte from Apple (A = byte)
  124. WRBYTE:        EQU    0FFE3H    ;write a byte to Apple (C = byte)
  125. RDWORD:        EQU    0FFE6H    ;read 2 bytes from Apple (DE = bytes)
  126. WRWORD:        EQU    0FFE9H    ;write 2 bytes to Apple (DE = bytes)
  127. RDNBYTS:    EQU    0FFECH    ;read n bytes (DE = count, HL = buffer)
  128. WRNBYTS:    EQU    0FFEFH    ;write n bytes (DE = count, HL = buffer)
  129. ;
  130. PEEK1BYTE:    EQU    6    ;command to peek 1 byte in the Apple
  131. POKE1BYTE:    EQU    7    ;command to poke 1 byte in the Apple
  132.         ENDIF        ;Applicard
  133. ;
  134. ;
  135. ; Status bit equates for 6850 in Micromodem ][
  136. ;
  137. MODSNDB:    EQU    02H    ;bit to test for send
  138. MODSNDR:    EQU    02H    ;value when ready
  139. MODRCVB:    EQU    01H    ;bit to test for receive
  140. MODRCVR:    EQU    01H    ;value when ready
  141. ;
  142. ;----------------------------------------------------------------------
  143. ;
  144.         ORG    100H
  145. ;
  146.         DS    3    ;(for  "JMP   START" instruction)
  147. ;
  148. PMMIMODEM:    DB    YES    ;MUST be yes for MM ][            103H
  149. SMARTMODEM:    DB    NO    ;MUST be no for MM ][ implementation    104H
  150. TOUCHPULSE:    DB    'P'    ;T=touch, P=pulse (Smartmodem-only)    105H
  151. ;
  152.         IF    APPLICARD
  153. CLOCK:        DB    6    ;clock speed in MHz x10, 25.5 MHz max.    106H
  154.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  155.                 ;Applicard values should not be multiplied
  156.                 ;by 10 because of 6502 overhead
  157.         ENDIF        ;Applicard
  158. ;
  159.         IF    SOFTCARD
  160. CLOCK:        DB    20
  161.         ENDIF        ;Softcard
  162. ;
  163. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  164.                 ;6=2400 7=4800 8=9600 9=19200 default
  165. BYTDLY:        DB    0    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  166.                 ;default time to send character in ter-
  167.                 ;minal mode file transfer for slow BBS.
  168. CRDLY:        DB    0    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  169.                 ;default time for extra wait after CRLF
  170.                 ;in terminal mode file transfer
  171. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  172. SETUPTST:    DB    NO    ;yes=user-added Setup routine        10BH
  173. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  174. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  175.                 ;no=resend a record after a valid NAK
  176. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  177. CRCDFLT:    DB    NO    ;yes=default to CRC checking        10FH
  178. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  179. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  180. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  181. ADDLF:        DB    NO    ;no=no LF after CR to send file in'     113H
  182.                 ;terminal mode (added by remote echo)
  183. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  184. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  185.                 ;write logon sequence at location LOGON
  186. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  187. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  188.                 ;no=external command if EXTCHR precedes
  189. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  190. LSTTST:        DB    NO    ;yes=printer available on printer port    119H
  191. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  192.                 ;sending a file in terminal mode
  193. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  194.                 ;sending a file in terminal mode
  195. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  196. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  197. EXTRA1:        DB    0    ;for future expansion            11EH
  198. EXTRA2:        DB    0    ;for future expansion            11FH
  199. BRKCHR:        DB    'B'-40H    ;ESC = Send 300 ms. break tone        120H
  200. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  201. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  202. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  203. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  204. TRANCHR:    DB    'T'-40H    ;^T = Transmit file to remote        125H
  205. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  206. EXTCHR:        DB    'Z'-40H    ;^Z = Send next character        127H
  207.         DS    2    ;for PMMI control chars         128H
  208. ;
  209. ;
  210. IN$MODCTLP:    JMP    RD$MODCTLP    ;                12AH
  211.         DS    7
  212. OUT$MODDATP:    JMP    WR$MODDATP    ;                134H
  213.         DS    7
  214. IN$MODDATP:    JMP    RD$MODDATP    ;                13EH
  215.         DS    7
  216. ;
  217. ;
  218. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  219. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  220. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  221. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  222.         DS    12        ;PMMI only calls        154H
  223. ;
  224. ;
  225. LOGONPTR:    DW    LOGON        ;for user message.        160H
  226. JMP$DIAL:    DS    6        ;to main dial routines        162H
  227. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  228. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  229. JMP$NEWBAUD:    RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  230. JMP$NOPARITY:    RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  231. JMP$PARITY:    RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  232. JMP$SETUPR:    JMP    SETUPR        ;                177H
  233. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  234. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  235. JMP$BREAK:    JMP    SENDBRK        ;                180H
  236. ;
  237. ;
  238. ; Do not change the following six lines.
  239. ;
  240. JMP$ILPRT:    DS    3        ;IN-LINE print routine        183H
  241. JMP$INBUF:    DS    3        ;get kbd input routine        186H
  242. JMP$INLNCOMP:    DS    3        ;IN-LINE compare routine    189H
  243. JMP$INMODEM:    DS    3        ;100 msec or char recd routine    18CH
  244. JMP$NXTSCRN:    DS    3        ;prints mess and then next scrn 18FH
  245. JMP$TIMER:    DS    3        ;.1 sec X 'B' reg timer     192H
  246. ;
  247. ;
  248. CLREOS:        CALL    JMP$ILPRT    ;                195H
  249.         DB    ESC,0D9H,0,0,0    ;for Soroc/Televideo        198H
  250.         RET            ;(or VideoTerm)            19DH
  251. ;
  252. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  253.         DB    ESC,0AAH,0,0,0    ;for Soroc/Televideo        1A1H
  254.         RET            ;(or VideoTerm)            1A6H
  255. ;
  256. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  257. ;
  258.         IF    SOFTCARD
  259.         DB    'Modem 730 for Softcard '
  260.         ENDIF
  261. ;
  262.         IF    APPLICARD
  263.         DB    'Modem 730 for 6 Mhz Applicard '
  264.         ENDIF
  265. ;
  266.         DB    'and Micromodem ][',CR,LF,0
  267.         RET
  268. ;.....
  269. ;
  270. ;
  271. ; User routines can be added after SYSVER routine.  With this overlay
  272. ; all user added routines and data blocks must end before 0400H since
  273. ; PMMI routines are used.
  274. ;
  275. ;---------------- START OF LOCAL OVERLAY ROUTINES ---------------------
  276. ;
  277. ; The following routines communicate with hardware in Apple Slots
  278. ; directly from Applicard.
  279. ;
  280. ;
  281. ; Read the modem control port
  282. ;
  283. RD$MODCTLP:
  284.     PUSH    D
  285.     LXI    D,MODCTLP
  286.     CALL    PEEK
  287.     POP    D
  288.     RET
  289. ;.....
  290. ;
  291. ;
  292. ; Write the modem control port
  293. ;
  294. WR$MODCTLP:
  295.     PUSH    D
  296.     LXI    D,MODCTLP
  297.     CALL    POKE
  298.     POP    D
  299.     RET
  300. ;.....
  301. ;
  302. ;
  303. ; Write the modem control port 2
  304. ;
  305. WR$MODCTLP2:
  306.     PUSH    D
  307.     LXI    D,MODCTLP2
  308.     CALL    POKE
  309.     POP    D
  310.     RET
  311. ;.....
  312. ;
  313. ;
  314. ; Read the modem data port
  315. ;
  316. RD$MODDATP:
  317.     PUSH    D
  318.     LXI    D,MODDATP
  319.     CALL    PEEK
  320.     POP    D
  321.     RET
  322. ;.....
  323. ;
  324. ;
  325. ; Write the modem data port
  326. ;
  327. WR$MODDATP:
  328.     PUSH    D
  329.     LXI    D,MODDATP
  330.     CALL    POKE
  331.     POP    D
  332.     RET
  333. ;.....
  334. ;The peek and poke routines are only necessary for the Applicard,
  335. ;but are just redefined for the Softcard
  336. ;
  337.     IF    APPLICARD
  338. ;
  339. ;
  340. ; Peek at 1 byte in the Apple
  341. ;   Entry: DE = address
  342. ;   Exit:  A  = data
  343. ;
  344. PEEK:    PUSH    B
  345.     MVI    C,PEEK1BYTE
  346.     CALL    WRBYTE
  347.     CALL    WRWORD
  348.     CALL    RDBYTE
  349.     POP    B
  350.     RET
  351. ;.....
  352. ;
  353. ;
  354. ; Poke 1 byte into the Apple
  355. ;   Entry: DE = address
  356. ;   Exit:  A  = data
  357. ;
  358. POKE:    PUSH    B
  359.     MOV    B,A
  360.     MVI    C,POKE1BYTE
  361.     CALL    WRBYTE
  362.     CALL    WRWORD
  363.     MOV    C,B
  364.     CALL    WRBYTE
  365.     POP    B
  366.     RET
  367. ;
  368.     ENDIF        ;Applicard complicated I/O
  369. ;
  370.     IF    SOFTCARD
  371. PEEK:    LDAX    D
  372.     RET
  373. ;
  374. POKE:    STAX    D
  375.     RET
  376. ;
  377.     ENDIF        ;Softcard simple I/O
  378. ;.....
  379. ;
  380. ;
  381. ; You can put in a message at this location which can be called up with
  382. ; CTL-L if TRANLOGON has been set TRUE.  You can put in several lines if
  383. ; desired.  End with a 0.
  384. ;
  385. LOGON:        DB    CR,'vax',CR,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  386.         DB    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  387. ;.....
  388. ;
  389. ;
  390. ; This routine will send a BREAK through MM ][.  Routine is called
  391. ; through patch in main program and JMP$BREAK vector here.
  392. ;
  393. SENDBRK:
  394.     MVI    A,60H        ;BREAK byte to ACIA
  395.     CALL    WR$MODCTLP    ;send to ACIA
  396.     PUSH    B
  397.     LXI    B,300        ;send break for 300 msecs
  398.     CALL    DELAY
  399.     POP    B
  400.     MVI    A,FSW        ;re-init modem w/current status
  401.     CALL    WR$MODCTLP
  402.     RET
  403. ;.....
  404. ;
  405. ;
  406. ; This routine initializes MM ][ on first entry to MDM730 and is
  407. ; used after that to re-initialize modem to current status.
  408. ;
  409. DTR:    DB    8FH        ;300 baud, orig, carrier on, off-hook
  410. ;
  411. MODSTAT:
  412.     DB    00H        ;value of 00 indicates cold start, no hangup
  413. ;
  414. INITMOD:
  415.     MVI    A,1        ;MSPEED 300 baud value
  416.     STA    MSPEED
  417. ;
  418. INITMOD2:
  419.     MVI    A,3        ;reset ACIA
  420.     CALL    WR$MODCTLP
  421.     MVI    A,FSW        ;Send word status to ACIA
  422.     CALL    WR$MODCTLP
  423.     LDA    MODSTAT        ;get current modem params
  424.     ORA    A        ;if 00, is a cold start, dont bother
  425.     RZ            ;initializing in case connected
  426.     CALL    WR$MODCTLP2
  427.     RET
  428. ;.....
  429. ;
  430. ;
  431. ; This routine is called from main program with MODSTAT set for
  432. ; disconnect of MM][.
  433. ;
  434. HANGUP$MM:
  435.     CALL    INITMOD2
  436.     PUSH    B
  437.     LXI    B,1000        ;wait 1 second for MM][ disconnect
  438.     CALL    DELAY
  439.     POP    B
  440.     RET
  441. ;.....
  442. ;
  443. ;
  444. ; The following routine can be used to change baud rate or word/parity
  445. ; settings.  This routine is called each time a menu entry is selected
  446. ; and is designed to allow setup changes before entry to terminal mode.
  447. ;
  448. SETUPR:    RET
  449. ;.....
  450. ;
  451. ;
  452. ; The following routine can be used to display commands on the screen
  453. ; of interest to users of this equipment.  If using the Hayes Smartmodem
  454. ; this is unavailable without a special address change.  In this overlay
  455. ; a datablock is overlayed on the original PMMI special menu and this
  456. ; routine is called by JMP$SPCLMENU vector in main program.  The info
  457. ; screen can be eliminated by replacing this code with a simple RET.
  458. ;
  459. SPCLMENU:
  460.     JMP    PMMI$MENU    ;this jumps to main program
  461.     RET
  462. ;.....
  463. ;
  464. ;
  465. ; This routine on 6 MHz AppliCard will delay for the number of
  466. ; milliseconds passed in 'BC' register.  PSW, DE, HL registers saved.
  467. ; For a 4MHz AppliCard change number of timing loops from 3 to 2.
  468. ;
  469. DELAY:    PUSH    PSW
  470.     PUSH    H
  471.     PUSH    D        ;contains delay time
  472. ;
  473.     IF    APPLICARD
  474.     MVI    A,3        ;loop through 3 times
  475.     ENDIF
  476. ;
  477.     IF    SOFTCARD
  478.     MVI    A,1        ;loop through 1 time
  479.     ENDIF
  480. ;
  481. DELAY0:    PUSH    B
  482.     INR    B        ;will later be decremented
  483. ;
  484. DELAY1:    MVI    E,126        ;count for .1 msec Z-80 at 2 MHz
  485. ;
  486. DELAY2:    DCR    E
  487.     JNZ    DELAY2
  488.     DCR    C        ;run down LO byte then..
  489.     JNZ    DELAY1
  490.     DCR    B        ;..HI byte back down
  491.     JNZ    DELAY1        ;If not done keep going
  492.     POP    B        ;Otherwise, get delay time back...
  493.     DCR    A        ;...and loop back again...
  494.     JNZ    DELAY0        ;...for 3 times (6 MHz).
  495.     POP    D
  496.     POP    H
  497.     POP    PSW        ;unload stack
  498.     RET
  499. ;.....
  500. ;
  501. ;
  502. ;------------ START OF ROUTINES TO BE OVERLAYED IN MAIN PROGRAM --------
  503. ;
  504. ; These routines have been written such that Smartmodem routines are
  505. ; not disturbed.  Conditional assembly routines can be added to support
  506. ; serial I/O cards and Smartmodem.
  507. ;.....
  508. ;
  509. ;
  510. ; This routine is called after dialing is complete; routine expects
  511. ; modem to return with Carrier Detect, then passes control
  512. ; to CONMADE routine.
  513. ;
  514. OVL1:    ORG    DIAL18
  515. ;
  516.     MVI    A,3        ;clear ACIA port 1
  517.     CALL    WR$MODCTLP
  518.     MVI    B,1        ;read modem or come back in .1 secs
  519.     CALL    TIMER
  520.     MVI    A,8DH        ;set modem for off-hook, orig, etc
  521.     CALL    WR$MODCTLP2
  522.     MVI    D,4        ;mask for Carrier Detect
  523.     MVI    C,96H        ;time limit for CD (about 30 secs)
  524.     CALL    WAIT
  525.     JNC    CONMADE        ;got it, then continue
  526.     CALL    DISCONNT    ;no, then drop..
  527. ;.....
  528. ;
  529. ;
  530. ; This routine replaces the original disconnect routine. It resets
  531. ; all modem values to standby, onhook status.
  532. ;
  533. OVL2:    ORG    DISCONNT+7
  534. ;
  535.     MVI    A,0DH        ;restores modem defaults
  536.     STA    MODSTAT
  537.     CALL    HANGUP$MM
  538.     RET
  539. ;.....
  540. ;
  541. ;
  542. ; This CALL is to replace PMMI call..reads modem port for CD status.
  543. ;
  544. OVL3:    ORG    WAIT+5
  545. ;
  546.     CALL    RD$MODCTLP    ;check for Carrier Detect
  547. ;
  548. ;.....
  549. ;
  550. ; This routine replaces unnecessary PMMI code. Jump is forced to
  551. ; overlay SETUPR routine.
  552. ;
  553. OVL4:    ORG    RESTART1+12
  554. ;
  555.     CNZ    SETUPR
  556. ;.....
  557. ;
  558. ;
  559. OVL5:    ORG    BREAK+4
  560. ;
  561.     JMP    BREAK1        ;jump over PMMI routine, use
  562. ;.....                ;BREAK routine here
  563. ;
  564. ;
  565. ; This routine replaces PMMI dialing routine in main program.
  566. ;
  567. OVL6:    ORG    DIALA2+8
  568. ;
  569. PULSE:    PUSH    B        ;digit dialed is in 'B' reg
  570.     MVI    A,0DH        ;set modem on-hook..
  571.     CALL    WR$MODCTLP2
  572.     LXI    B,61        ;..for 61 msecs
  573.     CALL    DELAY
  574.     MVI    A,8DH        ;set modem off-hook..
  575.     CALL    WR$MODCTLP2
  576.     LXI    B,39        ;..for 39 msecs
  577.     CALL    DELAY
  578.     POP    B        ;get back number from stack
  579.     DCR    C        ;..one less pulse
  580.     JNZ    PULSE        ;go back for next pulse if not done
  581.     LXI    B,600        ;otherwise, wait 600 msecs
  582.     CALL    DELAY
  583.     RET
  584. ;.....
  585. ;
  586. ;
  587. ; This routine is called after number is entered or found in library,
  588. ; but before dial-pulsing routine is called. Off-hook status saved
  589. ; for re-init after dialing.
  590. ;
  591. OVL7:    ORG    DIALBGN+5
  592. ;
  593.     LDA    DTR        ;get DTR byte
  594.     STA    MODSTAT        ;save for post dial re-init
  595.     MVI    A,8DH        ;set modem off-hook
  596.     CALL    WR$MODCTLP2
  597.     LXI    B,3000        ;wait 3 secs for dialtone
  598.     CALL    DELAY
  599.     ORA    A        ;must return with carry clear
  600.     RET
  601. ;.....
  602. ;
  603. ;
  604. ; This routine re-inits modem ACIA registers and modem status
  605. ; from MODSTAT set at DIALBGN (above).
  606. ;
  607. OVL8:    ORG    CONMADE
  608. ;
  609.     LDA    MODSTAT        ;Do nothing step since we are...
  610.     CALL    INITMOD2    ;...going to re-init ACIA anyway!
  611. ;.....
  612. ;
  613. ;
  614. ; This text block overlays original PMMI special menu data and is
  615. ; called through jumps in overlay code and back to start of the
  616. ; PMMI menu. This data section must end prior to 0CB4H!!
  617. ;
  618. OVL9:    ORG    SPCLMENU$DB
  619. ;
  620.     DB    '           '
  621.     DB    'Additional Information for Micromodem ][ Users',CR,LF
  622.     DB    '           '
  623.     DB    '---------- ----------- --- ---------- -- -----'
  624.     DB    CR,LF,LF,LF
  625.     DB    '          '
  626.     DB    'This overlay allows the MM ][ to operate in the',CR,LF
  627.     DB    '          '
  628.     DB    'originate mode only at 300 baud.  Word status is',CR,LF
  629.     DB    '          '
  630.     DB    'fixed to 7 Data Bits, Even parity, and 1 Stop Bit.'
  631.     DB    CR,LF,LF,LF
  632.     DB    0
  633.     RET
  634. ;.....
  635. ;
  636. ;
  637. ; The Micromodem ][ cannot be used for RingBack dialing.  This patch
  638. ; defeats PMMI routine and gives error message.
  639. ;
  640. OVL10:    ORG    RINGBK+5
  641. ;
  642.     JMP    RINGBK2
  643. ;
  644. ;
  645.     ORG    RINGBK2+3
  646. ;
  647.     DB    CR,LF,'+ No Ringback for Micromodem ][ +',0
  648. ;.....
  649. ;
  650. ;
  651. ;------------- END OF PATCHES TO MAIN PROGRAM AREA --------------------
  652. ;
  653. ;
  654.       END
  655.