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 / MO700RV.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  20KB  |  896 lines

  1. ; NOTE:  This overlay is VERY dependent on version of the MODM7xx
  2. ;    that it is running with.  As of 5 Nov 84, it is configured
  3. ;    for MODM700.COM as distributed.  Be careful if configuring
  4. ;    for different versions of MODM7xx.
  5. ;    You should be able to configure it for your system just
  6. ;    by modifying the two routines SETDTRH and SETDTRL.  They
  7. ;    are USART-specific.  Then just overlay this file AFTER
  8. ;    overlaying your normal configure file.  Make sure that
  9. ;    your normal configure file doesn't go past 3FFH since this
  10. ;    one starts at 400H.
  11. ;
  12. ; MO700RV.ASM  Racal-Vadic VA212PA overlay for MODM700
  13. ;
  14. ; The Racal-Vadic VA212PA modem is configured as follows
  15. ;
  16. ;        1*2  STANDART OPTN     2*1  ASYNCH/SYNCH
  17. ;        3*2  DATA RATE SEL     4*1  103 OPERATION
  18. ;        5*3  CHARACTER LEN     6*1  ORIG/ANS MODE
  19. ;        7*2  SLAVE CLOCK     8*2  DTR CONTROL
  20. ;        9*2  ATT/UNATT DISC  10*1 LOSS CXR DISC
  21. ;        11*2 REC SPACE DISC  12*2 SEND SPACE DIS
  22. ;        13*1 ABORT DISC     14*1 REMOT TST RESP
  23. ;        15*4 DSR CONTROL     16*2 CXR CONTROL
  24. ;        17*1 AUTO LINKING     18*3 ALB CONTROL
  25. ;        19*6 AUTO ANSWER     20*1 TERMINAL BELL
  26. ;        21*1 LOCAL COPY     22*3 DIAL MODE
  27. ;        23*2 BLIND DIAL     24*1 CALL PROGRESS
  28. ;        25*2 FAIL CALL SEL     26*9 AUTO REDIAL
  29. ;
  30. ; #, K, and * may be used in the phone number command line,
  31. ; CAL #8K9Kxxx-xxx-xxxx (up to 31 digits).
  32. ;
  33. ; Initialization routines need to be changed to support your I/O devices
  34. ; are: SETDTRH and SETDTRL - Examples for USART
  35. ; initialization may be found in BYE2-16.LBR.  The modem is disconnected
  36. ; from on-line by dropping the DTR line, this must be implemented in the
  37. ; SETDTRL: routine in accordance with your I/O devices.  The modem is
  38. ; enabled by setting DTR high and must be implemented in your SETDTRH:
  39. ; routine.
  40. ;
  41. ;    To install the overlay make your changes for the USART
  42. ;    dependent routines.  This overlay may directly be used
  43. ;    if your system uses the Intel 8251 USART.
  44. ;
  45. ;    A>DDT MODM700.COM    <== Start with MODM700.COM (or .OBJ)
  46. ;    DDT VERS 2.2
  47. ;    NEXT   PC
  48. ;    4A00  0100
  49. ;    -IM7xx-1.HEX
  50. ;    -R            <== Read in your normal MDM7xx overlay
  51. ;    -IMO700RV.HEX
  52. ;    -R            <== Read in this to add PA212 support
  53. ;    NEXT   PC
  54. ;    4A00  0000
  55. ;    -G0
  56. ;
  57. ;    A>SAVE 73 MODM700.COM
  58. ;
  59. ; K, # and * are valid characters for the Racal (#8K9Kxxx-xxxx) and may
  60. ; be included in the phone number.  #8 is used by some PBX systems to
  61. ; have a clear phone line with no call waiting signals. INSURE ALL NAMES
  62. ; IN THE PHONE NUMBER LIBRARY HAVE LOWER CASE "k" and phone numbers upper
  63. ; case "K" if needed.
  64. ;
  65. ;***********************************************************************
  66. ;
  67. ; 11/5/84  - Adjusted for MODM700  -  mabry
  68. ; 3/28/84  - Adjusted equates for MDM730  -  mabry
  69. ; 3/16/84  - Adjusted equates for MDM728  -  mabry
  70. ; 3/5/84   - Adjusted equates for MDM727  -  mabry
  71. ; 2/18/84  - Adjusted equates for MDM724  -  mabry
  72. ; 2/16/84  - Adjusted equates for MDM723 and modified DIAL routine so
  73. ;    it can handle the new 36 number phone number library. - mabry
  74. ; 1/5/84   - Set up equates at end for MDM716 and removed all hardware-
  75. ;    specific routines (except SETDTRH and SETDTRL) so that
  76. ;    this file can be used with most other systems assuming
  77. ;    there is an overlay for those systems already. - mabry
  78. ; 11/11/83 - Renamed to M7RV-1.ASM, no changes    - Irv Hoff
  79. ; 10/15/83 - First version for Racal-Vadic    - Fred Willink
  80. ;
  81. ;***********************************************************************
  82. ;
  83. YES:        EQU    0FFH
  84. NO:        EQU    0
  85. ;
  86. CANCEL:        EQU    'X'-40H    ;^X = Cancel
  87. ESC:        EQU    '['-40H    ;^[ = escape
  88. BELL:        EQU    'G'-40H    ;^G = bell character
  89. LF:        EQU    'J'-40H    ;^J = linefeed
  90. CR:        EQU    'M'-40H    ;^M = carriage RETRN
  91. PRINT:        EQU    9
  92. BDOS:        EQU    0005H
  93. ;
  94. LIBLEN:        EQU    34    ; Length of each phone number
  95. ;
  96. ;=======================================================================
  97. ;
  98.         ORG    0100H
  99. ;
  100. ;
  101.         DS    3    ; Skip JMP START
  102. ;
  103. PMMIMODEM:    DB    NO
  104. SMARTMODEM:    DB    YES    ; yes=Racal-Vadic VA122PA the main
  105.                 ; program test this byte to use the
  106.                 ; new routines
  107.         DS    1
  108. CLOCK:        DS    1    ;clock speed x10, up to 25.5 mhz.
  109.                 ;2 MHz=20, 3.68 MH=37, 4 MHz=40, etc.
  110. MSPEED:        DS    1    ;sets display time for sending a file
  111.                 ;0=110    1=300  2=450  3=600  4=710
  112.                 ;5=1200 6=2400 7=4800 8=9600 9=19200
  113.         DS    3
  114. SETUPTST:    DS    1    ;yes=non-PMMI setup routine
  115. SCRNTEST:    DS    1    ;yes=home cursor and clear screen
  116.         DS    29
  117. ;
  118. ;
  119. ; Handles in/out ports for data and status
  120. ;
  121. IN$MODCTL1:    DS    10        ;in modem control port
  122. OUT$MODDATP:    DS    10        ;out modem data port
  123. IN$MODDATP:    DS    10        ;in modem data port
  124. ANI$MODRCVB:    DS    3        ;bit to test for receive ready
  125. CPI$MODRCVR:    DS    3        ;value of receive bit when ready
  126. ANI$MODSNDB:    DS    3        ;bit to test for send ready
  127. CPI$MODSNDR:    DS    3        ;value of send bit when ready
  128. ;
  129. IN$BAUDRP:    DS    3         ;in baudrate port
  130. OUT$BAUDRP:    DS    3         ;out baudrate port
  131. OUT$MODCTL1:    DS    3         ;out modem control port #1
  132. OUT$MODCTL2:    DS    3         ;out modem control port #2
  133. ;
  134. LOGONPTR:    DS    2
  135. JMP$DIAL:    JMP    DIAL        ; \
  136. JMP$DISCONNT:    JMP    DISCONNT    ;  > We change these vectors
  137. JMP$GOODBYE:    JMP    GOODBYE        ; /
  138. JMP$INITMOD:    DS    3
  139. JMP$NEWBAUD:    RET            ; Defeat this one...
  140.         DS    2
  141. JMP$NOPARITY:    RET            ;  ...and this one...
  142.         DS    2
  143. JMP$PARITY:    RET            ;  ...and this one...
  144.         DS    2
  145. JMP$SETUPR:    DS    3
  146. JMP$SPCLMENU:    RET            ;  ...and this one.
  147.         DS    2
  148. JMP$SYSVER:    DS    3
  149. JMP$BREAK:    DS    3
  150. ;
  151. JMP$ILPRT:    DS    3
  152. JMP$INBUF:    DS    3
  153. JMP$INLNCOMP:    DS    3
  154. JMP$INMODEM:    DS    3
  155. JMP$NXTSCRN:    DS    3
  156. JMP$TIMER:    DS    3
  157. ;
  158. ;.....
  159.  
  160. ; After all the absolute locations above will generally be the user's
  161. ;  hardware-specific subroutines.  We allow up to 3FFH for those and
  162. ;  then start some routines of our own that support the Racal-Vadic PA212
  163. ;  modem.  If the user's routines need more room, this might be able to
  164. ;  start a little lower, but just a few bytes probably.
  165.  
  166.     ORG    400H
  167. ;
  168. ; NOTE: You will have to change these next two routines if you don't
  169. ;    have an 8251A for your USART.
  170. ;
  171. ENABL    EQU    37H
  172. DTR    EQU    2
  173. ;
  174. ; Raise DTR to enable modem
  175. ;
  176. SETDTRH:  MVI    A,enabl
  177.       JMP    OUT$MODCTL1
  178. ;.....
  179. ;
  180. ;
  181. ; Drop DTR to disable modem
  182. ;
  183. SETDTRL:  MVI    A,enabl-dtr
  184.       JMP    OUT$MODCTL1
  185.       RET
  186. ;.....
  187. ;
  188. ;            End of USART dependent routines
  189. ;=======================================================================
  190. ;
  191. ;             RACAL-VADIC DIALING ROUTINES
  192. ;
  193. ;=======================================================================
  194. ;
  195. ; Dialing routine
  196. ;
  197. DIAL:      XRA    A        ; Zero out some flags
  198.       STA    CRFLAG
  199.       STA    RNGBKFL
  200.       STA    RINGFLG
  201.       STA    DOT        ; Indicates dot encountered in library
  202.       LXI    H,0
  203.       SHLD    DIALCT
  204.       LXI    H,CMDBUF+1    ; Point to character count of user
  205.       MOV    A,M        ;  input to prompt
  206.       CPI    3+1        ; More than 3 letters input ?
  207.       JC    DIAL1        ; No, then go display library of #'s
  208. ;
  209. ;
  210. ; If there were only 3 characters, then "CAL<RET>" was typed -- the user
  211. ; obviously expecting to get a phone number (or letter) from the library
  212. ; file.  If 4 or more, a number (or letter) was typed in from the menu
  213. ; command line, so move the characters down 4 to compensate.  Needed for
  214. ; auto-redialing of menu command line entries.
  215. ;
  216.       MOV    C,A
  217.       MVI    B,0
  218.       SUI    4        ; Adjust count down by 4
  219.       MOV    M,A        ; Store back in CMDBUF+1
  220.       INX    H        ; Point to CMDBUF+2
  221.       XCHG
  222.       LXI    H,CMDBUF+6
  223.       CALL    MOVER        ; Move buffer down by 4
  224.       JMP    DIAL4
  225. ;...
  226. ;
  227. ;
  228. ; Comes here if no phone number was manually entered after "CAL" and if
  229. ; no phone library letter was entered.    Displays the phone number li-
  230. ; brary, then asks for an entry.
  231. ;
  232. DIAL1:      MVI    C,18        ; Lines of phone numbers to display
  233.       LXI    H,NUMBLIB
  234.       LXI    D,BUFFER
  235.       CALL    NEWLINE
  236.       STAX    D
  237.       INX    D
  238. ;
  239. DIAL2:      MVI    B,LIBLEN
  240.       CALL    MOVE
  241.       CALL    SPACES
  242.       MVI    B,LIBLEN
  243.       CALL    MOVE
  244.       CALL    NEWLINE
  245.       DCR    C
  246.       JNZ    DIAL2
  247. ;
  248. DIAL3:      MVI    A,'$'
  249.       STAX    D
  250.       CALL    CLRTST        ;clear screen
  251.       MVI    C,PRINT
  252.       LXI    D,BUFFER    ;show library
  253.       CALL    BDOS
  254.       CALL    JMP$ILPRT
  255.       DB    CR,LF,'Enter library letter or phone number,',CR,LF
  256.       DB    'CTL-X quits while dialing or ringing: ',0
  257.       LXI    D,CMDBUF
  258.       CALL    INBUF        ;get input, library letter or phone #
  259. ;
  260. ;
  261. ; You now have either a library letter or a manually entered phone num-
  262. ; ber.    These either came from the menu command line or from the library
  263. ; command line.  Next we see if a letter, if so, get the corresponding
  264. ; line with phone number from the library.  If a number we ignore the
  265. ; library look-up.  (Ringback numbers must end with letter 'R'.)
  266. ;
  267. DIAL4:      LXI    H,CMDBUF+1
  268.       MOV    A,M        ; Get character count
  269.       ORA    A        ; No entry ?
  270.       JZ    DIALEXIT    ;  then exit
  271.       PUSH    H
  272.       CALL    DISCONNT    ;disconnect the modem and place in idle
  273.       POP    H
  274.       MOV    A,M        ; Get count again
  275.       CPI    1        ; One character (ie. get phone number
  276.       JZ    DIAL4A        ;  from library) ?
  277.       MVI    A,YES        ; Set dot flag so that we don't skip
  278.       STA    DOT        ;  anything user types in
  279.       JMP    DIAL9
  280. DIAL4A:
  281.       INX    H        ; Point to user entry
  282.       MVI    B,'A'        ; Need to compare against A-Z
  283.       MVI    E,0
  284.       MVI    C,'Z'-'A'+1    ; How many to check
  285.       MOV    A,M        ; Get user input character
  286. ;
  287. DIAL5:      CMP    B        ; Compare against letter (A-Z)
  288.       JZ    DIAL6        ; Got match
  289.       INR    B        ; Next letter
  290.       INR    E        ; Keep count
  291.       DCR    C
  292.       JNZ    DIAL5        ; Loop for all letters
  293. ; Checked all letters, now do numbers 0-9
  294.       MVI    B,'0'        ; Start at 0
  295.       MVI    C,'9'-'0'+1    ; How many to check
  296. DIAL5A:
  297.       CMP    B        ; Compare against number
  298.       JZ    DIAL6        ; Got match
  299.       INR    B        ; Next number
  300.       INR    E        ; Keep counter
  301.       DCR    C
  302.       JNZ    DIAL5A        ; Loop for all numbers (0-9)
  303.       JMP    DIAL9        ; This should only happen with illegal
  304.                 ;  entries.
  305. ;
  306. ;
  307. ; Now have a match between the requested letter and one in the library
  308. ; E-reg. holds the decimal equivalent (0-25) of the letter (A-Z) or
  309. ; (26-35) of the number (0-9).
  310. ;
  311. DIAL6:      LXI    H,NUMBLIB    ; Starting address of library
  312.       LXI    B,LIBLEN    ; Length of each entry of library
  313.       MOV    A,E
  314.       ORA    A
  315.       JZ    DIAL8
  316. ;
  317. DIAL7:      MOV    A,M
  318.       ORA    A        ; Make sure we don't go past library
  319.       JZ    DIALBAD        ; Jump if we do
  320.       DAD    B        ; Index into library by (E)*LIBLEN
  321.       DCR    E
  322.       JNZ    DIAL7
  323. ;
  324. ;
  325. ; Now have the line in the phone number library matching the requested
  326. ; letter so store that line starting at 'CMDBUF+1'
  327. ;
  328. DIAL8:      MVI    B,LIBLEN
  329.       LXI    D,CMDBUF+1
  330.       XCHG
  331.       MOV    M,B
  332.       XCHG
  333.       INX    D
  334.       CALL    MOVE
  335. ;
  336. ;
  337. ; Now have the full line including phone number in 'CMDBUF' area.
  338. ;
  339. DIAL9:      LDA    SMARTMODEM
  340.       ORA    A
  341.       CNZ    SMINIT
  342. ;    
  343. DIAL10:      LXI    H,CMDBUF+1
  344.       MOV    E,M
  345.       INX    H
  346. ;
  347. DIAL11:      MOV    A,M
  348.       ORA    A
  349.       JZ    DIALBAD
  350. ;
  351. ;
  352. ; Dial a digit, check keyboard for abort
  353. ;
  354.       CALL    DIALA
  355.       CALL    STAT
  356.       JZ    DIAL13
  357.       CALL    KEYIN
  358.       CPI    CANCEL
  359.       JNZ    DIAL13
  360.       JMP    DIALEXIT
  361. ;
  362. DIAL13:      INX    H
  363.       DCR    E
  364.       JNZ    DIAL11
  365. ;
  366. ;
  367. ; Show the number of dial attempts
  368. ;
  369.       MVI    B,CR        ;end with cr
  370.       CALL    SNDCHR
  371. ;
  372. EATIT:      CALL    JMP$INMODEM    ;gobble the modem response
  373.       JNC    EATIT
  374.       CALL    JMP$ILPRT
  375.       DB    ' - try #',0
  376.       LHLD    DIALCT
  377.       INX    H
  378.       SHLD    DIALCT
  379.       CALL    DECOUT
  380.       MVI    A,' '
  381.       CALL    TYPE
  382.       MVI    B,CR
  383.       CALL    SNDCHR
  384. ;
  385. DIAL14:      CALL    JMP$INMODEM
  386.       JNC    DIAL14
  387.       JMP    SMRESULT
  388. ;
  389. DIALAGN:  LDA    CRFLAG
  390.       ORA    A
  391.       JNZ    DIALAGN1
  392.       CALL    JMP$ILPRT
  393.       DB    ' Redial? '
  394.       DB    '(Y/N/C): ',BELL,0
  395.       CALL    KBDCHR
  396.       CALL    CRLF
  397.       CPI    'N'
  398.       JZ    DIALAGN2
  399.       CPI    'Y'
  400.       JZ    DIALAGN1
  401.       CPI    'C'
  402.       JNZ    DIALAGN
  403.       MVI    A,1
  404.       STA    CRFLAG
  405. ;
  406. DIALAGN1: MVI    B,35
  407.       CALL    JMP$TIMER
  408.       CALL    CRLF
  409.       LDA    RNGBKFL
  410.       ORA    A
  411.       JZ    DIAL4
  412.       STA    CMDBUF+1
  413.       JMP    DIAL4
  414. ;.....
  415. ;
  416. ;
  417. DIALAGN2: CALL    DIALBGN        ;disconnect the modem
  418.       JMP    MENU
  419. ;
  420. ;
  421. ; Connection has been made
  422. ;
  423. CONMADE:  CALL    JMP$ILPRT
  424.       DB    CR,LF,LF,'CONNECTION MADE',BELL,0
  425.       LDA    CRFLAG
  426.       ORA    A
  427.       JZ    RETRN
  428.       CALL    JMP$ILPRT
  429.       DB    ' - hit any key to stop the bell ',0
  430. ;
  431. CONMADE1: CALL    STAT
  432.       JZ    CONMADE2
  433.       CALL    KEYIN
  434.       XRA    A
  435.       JMP    RETRN
  436. ;
  437. CONMADE2: MVI    B,10
  438.       CALL    JMP$TIMER
  439.       MVI    A,BELL
  440.       CALL    TYPE
  441.       JMP    CONMADE1
  442. ;.....
  443. ;
  444. ;
  445. ; Automatic dialing routine, prints the number being dialed
  446. ;
  447. DIALA:      CALL    TYPE
  448.       CPI    'R'
  449.       JNZ    DIALA1
  450.       PUSH    PSW
  451.       MOV    A,E
  452.       CPI    1
  453.       JZ    RINGBK
  454.       POP    PSW
  455. ;
  456. DIALA1:      MOV    B,A
  457.       CALL    DIALAD
  458.       CPI    '.'        ; Are we at a dot in the string ?
  459.       JNZ    DIALA1A        ; Jump around if no
  460.       MVI    A,YES
  461.       STA    DOT        ; Set flag if yes
  462. DIALA1A:
  463.       LDA    DOT        ; Have we encountered a dot yet ?
  464.       ORA    A
  465.       RZ            ; RETRN if no
  466.       MOV    A,B
  467.       CPI    '*'        ;* is valid dial digit
  468.       JZ    DIALA2
  469.       CPI    '#'        ;# is valid dial digit
  470.       JZ    DIALA2
  471.       CPI    'K'        ;k indicates wait for next dial tone
  472.       JZ    DIALA2        ;all k's in phone # library should be
  473.       CPI    '0'        ;lower case.
  474.       RC
  475.       CPI    '9'+1
  476.       RNC
  477. ;
  478. ;
  479. ; Sends the digit to the modem.
  480. ;
  481. DIALA2:      MOV    C,A
  482.       JMP    SNDCHR
  483. ;
  484. ;
  485. ; Print bad library number message and abort if a null is encountered.
  486. ;
  487. DIALBAD:  CALL    JMP$ILPRT
  488.       DB    CR,LF,'++ Bad library number called ++',CR,LF,0
  489. ;
  490. DIALEXIT: CALL    DISCONNT
  491. ;
  492. DIALEXT1: CALL    CRLF
  493.       XRA    A
  494.       STA    CRFLAG
  495. ;
  496. DIALEXT2: CALL    JMP$INMODEM
  497.       JNC    DIALEXT2
  498.       CALL    JMP$GOODBYE
  499.       JMP    MENU
  500. ;.....
  501. ;
  502. ;
  503. DIALBGN:  JMP    DISCONNT
  504. ;
  505. ;
  506. ; Do any alternate dialing such as 'MCI' or 'SPRINT'
  507. ;
  508. DIALAD:      MOV    A,B
  509.       CPI    '<'
  510.       JNZ    DIALAD1
  511.       PUSH    H
  512.       LXI    H,ALTDL1
  513.       JMP    DIALAD2
  514. ;
  515. DIALAD1:  CPI    '>'
  516.       RNZ
  517.       PUSH    H
  518.       LXI    H,ALTDL2
  519. ;
  520. DIALAD2:  MOV    A,M
  521.       CPI    '$'
  522.       JZ    DIALAD3
  523.       CALL    TYPE
  524.       MOV    B,A
  525.       CALL    SNDCHR
  526.       INX    H
  527.       CALL    STAT
  528.       JZ    DIALAD2
  529.       CALL    KEYIN
  530.       CPI    CANCEL
  531.       JZ    DIALEXIT
  532.       JMP    DIALAD2
  533. ;
  534. DIALAD3:  MVI    A,' '
  535.       CALL    TYPE
  536.       POP    H
  537.       RET
  538. ;.....
  539. ;
  540. ;
  541. ; Disconnect the Smartmodem from the phone line
  542. ;
  543. GOODBYE:
  544. DISCONNT: CALL    SETDTRL        ;drop dtr
  545.       LXI    H,DISC0        ;send the idle command just in case
  546.       CALL    SENDMDM        ;the modem was in command mode instead
  547.                 ;of on line
  548. DISCONN2: CALL    JMP$INMODEM    ;gobble the idle message from the
  549.       JNC    DISCONN2    ;modem after the 'I' command is
  550.       MVI    B,10        ;sent and give it time to
  551.       CALL    JMP$TIMER    ;reinitialize
  552.       CALL  SETDTRH        ; Set DTR active again
  553.       RET
  554. ;.....
  555. ;
  556. ;
  557. DISC0:      DB    'I',CR,'$'
  558. DOT:      DS    1        ; Flag for don encountered
  559. ;.....
  560. ;
  561. ;
  562. ; Set Smartmodem for dialing
  563. ;
  564. SMINIT:      CALL    SETDTRH        ;enable dtr
  565.       LXI    H,SM$DAL1    ;put racal in command mode
  566.       CALL    SENDMDM
  567.       JMP    SMRESULT    ;get results (hello:i'M READY)
  568. ;
  569. SMINIT0:  MVI    B,10
  570.       CALL    JMP$TIMER
  571.       LXI    H,SM$DAL2    ;put racal in dial mode
  572.       CALL    SENDMDM
  573.       CALL    JMP$INMODEM    ;gobble the modem echo smresult 
  574.                 ;will take care of the the rest
  575.       JMP    SMRESULT    ;number?
  576. ;
  577. SMINIT1:  RET
  578. ;.....
  579. ;
  580. ;
  581. SM$DAL1:  DB    'E'-40H,CR,'$'    ;get into command mode
  582. ;
  583. SM$DAL2:  DB    'D',CR,'$'    ;dial
  584. ;
  585. ;
  586. ; Send the string pointed to by 'HL' to both the CRT and the modem.
  587. ;
  588. SENDOUT:  PUSH    H
  589.       CALL    SNDNOW
  590.       POP    H
  591.       MOV    A,M
  592.       CPI    '$'
  593.       RZ
  594.       MOV    A,M
  595.       CALL    OUT$MODDATP
  596.       CALL    TYPE
  597.       INX    H
  598.       JMP    SENDOUT
  599. ;.....    
  600. ;
  601. ;
  602. ; Send the string pointed to by 'HL' to the modem only
  603. ;
  604. SENDMDM:  PUSH    H
  605.       CALL    SNDNOW
  606.       POP    H
  607.       MOV    A,M
  608.       CPI    '$'
  609.       RZ
  610.       CALL    OUT$MODDATP
  611.       INX    H
  612.       JMP    SENDMDM
  613. ;......
  614. ;
  615. ;
  616. ; Checks for answer from Smartmodem
  617. ;
  618. SMRESULT: LXI    H,RESULBUF
  619.       PUSH    H
  620. ;
  621. SMRESUL2: CALL    RCVRDY
  622.       JZ    SMRESUL1
  623.       CALL    STAT
  624.       JZ    SMRESUL2
  625.       CALL    KEYIN
  626.       CPI    CANCEL
  627.       JNZ    SMRESUL2
  628.       MVI    B,CR
  629.       CALL    SNDCHR
  630.       POP    H
  631.       JMP    DIALEXT1
  632. ;
  633. RESULBUF: DS    16
  634. ;
  635. SMRESUL1: CALL    JMP$INMODEM
  636.       JC    SMRESUL4
  637. ;
  638. SMRESUL6: ANI    7FH
  639.       CPI    ' '
  640.       JZ    SMRESUL1    ;throw away spaces, lf, cr, nuls
  641.       CPI    LF        ;bell, and * in the resulbuf
  642.       JZ    SMRESUL1
  643.       CPI    00H
  644.       JZ    SMRESUL1
  645.       CPI    '*'
  646.       JZ    SMRESUL1
  647.       CPI    CR
  648.       JZ    SMRESUL1
  649.       CPI    BELL
  650.       JZ    SMRESUL1
  651.       POP    H
  652.       MOV    M,A
  653.       INX    H
  654.       PUSH    H
  655.       JMP    SMRESUL2
  656. ;
  657. ;
  658. ; Compare the Racal response
  659. ;
  660. SMRESUL4: POP    H
  661.       LXI    D,RESULBUF
  662.       CALL    JMP$INLNCOMP
  663.       DB    'HE',0            ;hello:i'M READY
  664.       JNC    SMINIT0
  665.       CALL    JMP$INLNCOMP
  666.       DB    'NU',0            ;number?
  667.       JNC    SMINIT1
  668.       CALL    JMP$INLNCOMP
  669.       DB    'BU',0            ;busy
  670.       JNC    NUM$BUSY
  671.       CALL    JMP$INLNCOMP
  672.       DB    'DI',0            ;dialing...
  673.       JNC    SMRESULT
  674.       CALL    JMP$INLNCOMP
  675.       DB    'RI',0            ;ringing...
  676.       JNC    RING
  677.       CALL    JMP$INLNCOMP
  678.       DB    'AN',0            ;answer tone
  679.       JNC    SMRESULT
  680.       CALL    JMP$INLNCOMP
  681.       DB    'ON',0            ;on line
  682.       JNC    CONMADE
  683.       CALL    JMP$INLNCOMP
  684.       DB    'NO',0            ;no dial tone
  685.       JNC    NO$DT
  686.       CALL    JMP$INLNCOMP
  687.       DB    'FA',0            ;failed call
  688.       JNC    FAILCAL
  689.       CALL    JMP$INLNCOMP
  690.       DB    'VO',0            ;voice
  691.       JNC    VOICE
  692.       CALL    JMP$INLNCOMP
  693.       DB    'ID',0            ;idle
  694.       JNC    FAILCAL
  695. ;
  696. SMDM1:      JMP    FAILCAL
  697. ;.....
  698. ;
  699. ;
  700. VOICE:      CALL    CRLF
  701.       CALL    JMP$ILPRT
  702.       DB    'VOICE !!! pick up reciever and enter RETRN ',BELL,0
  703.       CALL    KBDCHR
  704.       CPI    CR
  705.       JNZ    VOICE
  706.       CALL    SNDCHR
  707. ;
  708. VOICE1:      CALL    JMP$INMODEM    ;gobble modem response
  709.       JNC    VOICE1
  710.       CALL    DISCONNT
  711.       JMP    MENU
  712. ;
  713. ;
  714. ; Failed call is the result of no answer after 60 sec of ringing, wrong
  715. ; baud rate, or an incorrect response from the modem.
  716. ;
  717. FAILCAL:  CALL    CRLF
  718.       CALL    JMP$ILPRT
  719.       DB    'No answer... Failed call....',0
  720.       JMP    DIALAGN
  721. ;
  722. ;
  723. ; No dial tone can occur when using the alternate dialing option and a
  724. ; dial tone is not detected after the pause 'K' or within 5 sec after 
  725. ; the start of the modem dialing routine
  726. ;
  727. NO$DT:      CALL    CRLF
  728.       CALL    JMP$ILPRT
  729.       DB    'No dial tone present....',0
  730.       JMP    DIALAGN
  731. ;
  732. NUM$BUSY: CALL    CRLF
  733.       CALL    JMP$ILPRT
  734.       DB    'Number busy....',0
  735.       JMP    DIALAGN
  736. ;
  737. RING:      LDA    RINGFLG
  738.       ORA    A
  739.       JZ    SMRESULT
  740.       JMP    RINGBK1
  741. ;
  742. ;
  743. ; Handles the special ringback numbers.  Dials, lets it ring only once,
  744. ; hangs up and then redials.
  745. ;
  746. RINGFLG:  DB    0
  747. ;
  748. RINGBK:      POP    PSW
  749.       LDA    CMDBUF+1
  750.       STA    RNGBKFL
  751.       STA    RINGFLG
  752.       SUI    1
  753.       STA    CMDBUF+1
  754.       RET
  755. ;.....
  756. ;
  757. ;
  758. ; Hang up and redial
  759. ;
  760. RINGBK1:  CALL    HANGUP
  761.       MVI    B,50
  762.       CALL    JMP$TIMER
  763.       CALL    CRLF
  764.       JMP    DIAL9
  765. ;.....
  766. ;
  767. ;
  768. HANGUP:   MVI    B,CR        ;abort the dialing process
  769.       CALL    SNDCHR
  770.       XRA    A
  771.       STA    RINGFLG        ;clear flag for next dial
  772. ;
  773. HANGUP1:  CALL    JMP$INMODEM    ;wait for the modem to complete its
  774.       JNC    HANGUP1        ;response to the cr
  775.       JMP    DISCONNT    ;RETRN here
  776. ;.....
  777. ;
  778. ;
  779. ; Time-out routine.  Must be called with mask in 'D' reg. for input at
  780. ; relative port 2 and number of seconds (times 10) in 'C' reg.
  781. ;
  782. WAIT:      MVI    B,2
  783.       CALL    JMP$TIMER
  784.       CALL    IN$MODCTL1
  785.       ANA    D
  786.       RZ
  787.       PUSH    B
  788.       PUSH    D
  789.       CALL    STAT
  790.       JZ    WAIT1
  791.       CALL    KEYIN
  792.       CPI    CANCEL
  793.       JZ    WAIT2
  794. ;
  795. WAIT1:      POP    D
  796.       POP    B
  797.       DCR    C
  798.       JNZ    WAIT
  799.       STC
  800.       RET
  801. ;.....
  802. ;
  803. ;
  804. WAIT2:      POP    D
  805.       POP    B
  806.       JMP    DONETD
  807. ;.....
  808. ;
  809. ;
  810. ; Patch for STUPENT: to prevent sending of Hayes commands to Racal
  811. ;
  812. ;
  813.       ORG    STUPENT
  814. ;
  815. ;
  816.       LDA    SETUPTST
  817.       ORA    A
  818.       JZ    NOTVLD
  819.       CALL    JMP$SETUPR
  820.       JMP    XPRT
  821. ;
  822. ;
  823. ;
  824. ; Lets fix the byebye routine. It calls GOODBYE: directly  and not
  825. ; through the jump vectors at the begining so make it use the jump
  826. ; vectors.
  827. ;
  828. ;
  829.       ORG    BYEBYE
  830. ;
  831. ;
  832.       LDA    PMMIMODEM
  833.       ORA    A
  834.       CNZ    JMP$GOODBYE
  835.       LDA    SMARTMODEM
  836.       ORA    A
  837.       CNZ    JMP$GOODBYE
  838.       CALL    JMP$ILPRT
  839.       DB    CR,LF,'<<Exit to CP/M>>',CR,LF,0
  840.       JMP    EXIT
  841. ;.....
  842. ;
  843. ;
  844. ; Fix for DONETD: the routines GOODBYE: and DISCONNT: are the same so
  845. ; no need to call twice.
  846. ;
  847. ;
  848.       ORG    DONETD
  849. ;
  850. ;
  851.       CALL    JMP$ILPRT
  852.       DB    CR,LF,'<< DISCONNECTED >>',BELL,CR,LF,0
  853.       CALL    JMP$GOODBYE
  854.       JMP    MENU0
  855. ;
  856. ;
  857. ;
  858. ; M730RV.ASM uses these routines located in the main program.
  859. ;  These equates have to be set for particular releases of MDM7xx.
  860. ;  Currently they are set for MDM730.
  861. ;
  862. ALTDL1:   EQU    0DCEH        ;alt dial 1
  863. ALTDL2:   EQU    0DE6H        ;alt dial 2
  864. BUFFER:      EQU    4F00H
  865. BYEBYE:      EQU    404DH
  866. CLRTST:      EQU    4862H        ;clear screen test
  867. CMDBUF:      EQU    49A7H        ;cmd buffer
  868. CRFLAG:      EQU    4992H        ;cr flag
  869. CRLF:      EQU    2B7BH        ;print crlf
  870. DECOUT:      EQU    2BBDH
  871. DIALCT:      EQU    4987H
  872. DONETD:   EQU    2B04H
  873. EXIT:      EQU    2C5AH
  874. INBUF:      EQU    2F3EH
  875. KBDCHR:      EQU    2BAAH        ;wait for keyboard input
  876. KEYIN:      EQU    2B93H        ;kbd input
  877. MENU:      EQU    32EDH        ;menu
  878. MENU0:      EQU    32A6H
  879. MOVE:      EQU    2C9BH
  880. MOVER:      EQU    30DFH        ;move routine
  881. NEWLINE:  EQU    4814H
  882. NOTVLD:      EQU    3F78H
  883. NUMBLIB:  EQU    0E00H        ;number library
  884. RCVRDY:   EQU    1E38H        ;receiver ready
  885. RETRN:    EQU    197EH
  886. RNGBKFL:  EQU    49A2H        ;ring back flag
  887. SNDCHR:   EQU    2CA4H        ;send character
  888. SNDNOW:   EQU    1E4AH
  889. STUPENT:  EQU    46F1H
  890. SPACES:      EQU    481DH
  891. STAT:      EQU    2B88H        ;console status
  892. TYPE:      EQU    2B9DH        ;type
  893. XPRT:      EQU    3DFEH
  894. ;
  895.       END
  896.