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 / ENTERPRS / CPM / UTILS / S / ZDB18C.LBR / ZDB18SRC.LYR / ZDB18.B < prev    next >
Text File  |  1993-04-12  |  2KB  |  96 lines

  1. ;;; Mods per Al Hawley/Terry Hazen 02/05/92
  2. ;## Mod per JIM 04/12/92 to allow long enough delay to handle credit card
  3. ;   strings
  4. ;
  5. ; ZDB18.B
  6. ; phone dialing module for use within ZDB 
  7. ; 01/29/92
  8. ; Joe Mortensen
  9. ;    adapted from a standalone program (DIALER.COM) by Bruce Morgen
  10. ;
  11. ; Dials phone number in phone field of ZDB record
  12. ;
  13. dial:    call    clrmnu
  14.     dc    1,'Turn on Modem, Pick Up Phone, Press RET (^C to Abort)',2
  15.     call    cin
  16.     cp    3        ; ^C aborts
  17.     jp    z,menu
  18. ;
  19. ; check for valid phone number
  20. ;
  21.     ld    hl,phon        ; point to phone field
  22.     ld    a,(hl)
  23.     cp    ' '        ; is there a leading space?
  24.     jr    z,done
  25.     or    a        ; is field empty?
  26.     jr    z,done
  27.     push    hl        ; save phone field address
  28. ;
  29. ; initialize the modem    
  30. ;
  31.     call    mreset        ;;; Send 'ATZ; to reset modem
  32.     ld    hl,init        ; send 'ATX0S7=0' string to modem
  33.     call    pstr        ; X0=dialtone and busy signal not recognized
  34.                 ; S7=0 = no wait for dialtone/busy signal
  35. ;                
  36. ; send 'ATDT' string to modem
  37. ;
  38.     ld    hl,tone        ; send tone dial string 'ATDT'
  39. tonelp:ld    a,(hl)
  40.     or    a
  41.     jr    z,tonelp0
  42.     call    pout        ; send char to modem
  43.     inc    hl
  44.     call    waitp1s        ; give modem time to handle it
  45.     jr    tonelp
  46.     
  47. tonelp0:call    clrmnu
  48.     dc    1,'Dialing....' ,2
  49.     
  50.     
  51. ;
  52. ; send phone number to modem    
  53. ;
  54.     pop    hl        ; get back phone field address
  55. diallp:    ld    a,(hl)        ; send phone number to modem
  56.     cp    ' '        ; is char a space?
  57.     jr    z,tstr        ; yes, end of string
  58.     or    a
  59.     jr    z,tstr        ; yes, end of string
  60. ;
  61.     call    cout        ; print char on screen
  62.     call    pout        ; send char to modem
  63.     call    waitp1s        ; pause
  64.     inc    hl        ; increment to next digit
  65.     jr    diallp        ; repeat loop
  66. ;
  67. tstr:    ld    a,cr
  68.     call    pout
  69.     ld    b,0        ; ## changed from 40 to allow long enough
  70.                 ; delay for long credit card call strings
  71.                 ; Hawley/Hazen mod below caused problem
  72.     call    halflp
  73.     call    mreset        ;;;
  74. done:    jp    menu
  75. ;    
  76. halfsec:ld    b,5        ; delay loop to allow modem time to
  77. halflp:    call    waitp1s        ; handle strings
  78.     djnz    halflp
  79.     ret
  80.  
  81. mreset:    ld    hl,dflt        ;;; Reset modem
  82. ;
  83. pstr:    ld    a,(hl)        ; send string to modem
  84.     or    a
  85.     jr    nz,pstr0
  86.     ld    a,cr
  87.     call    pout
  88.     jr    halfsec
  89. pstr0:    call    pout
  90.     inc    hl
  91.     jr    pstr
  92.  
  93. dflt:    db    'ATZ',0        ; Hayes reset to defaults command
  94. init:    db    'ATX0S7=0',0    
  95. tone:    db    'ATDT',0
  96.