home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / sigmv060.ark / FLIP4.ASM < prev    next >
Assembly Source File  |  1984-04-29  |  3KB  |  130 lines

  1. ;    title    'FLIP - flip originate/answer mode under "bye"'
  2. ;    Originally written by Bruce Ratoff.
  3. ;
  4. ;    updated 6/2/80 to uppercase message and require exactly
  5. ;        control-c or return, ignoring all else. (BR)
  6. ;    updated 6/6/80 to work with PMMI modem and to re-ask for
  7. ;        input if invalid answer. Keith Petersen, W8SDZ.
  8. ;    updated 8/8/80 to add conditional assembly for either
  9. ;        PMMI or D C Hayes modem cards (BR)
  10. ;    updated 8/20/81 to add conditional assembly for either
  11. ;        BYE or non-BYE remote systems. Howard Booker, W8IU
  12. ;
  13. ;
  14. ;It should be understood that when using FLIP with the
  15. ;DC Hayes modem which combines the baud rate select and
  16. ;modem control port, you will automatically select the
  17. ;highest rate (either 300 or 450 baud). Hence, if you
  18. ;are not equipped to communicate at these rates then
  19. ;FLIP should not be used. If you still desire to use
  20. ;this program with the DC Hayes but would like to avoid
  21. ;this problem, then all functions sent to the modem control
  22. ;port on your system should passed to a ram location.
  23. ;Hence to change to originate, this locataion can be
  24. ;ored with 04 and written to the control port. (HB)
  25. ;
  26. ;
  27.  
  28. FALSE    EQU    0    ;BASIC LOGIC DEFINITIONS
  29. TRUE    EQU    NOT FALSE
  30. ;
  31. FASTCLK    EQU     TRUE    ;SET TRUE IF 4MHZ SYSTEM CLOCK
  32. ;
  33. BYE    EQU    TRUE    ;SET TRUE IF RUNNING UNDER BYE
  34. ;
  35. PMMI    EQU    FALSE    ;SET TRUE IF PMMI MODEM
  36. DCH    EQU     TRUE    ;SET TRUE IF D C HAYES MODEM
  37. ;
  38.     IF    DCH
  39. MODCTL    EQU    82H    ;D C HAYES MODEM CONTROL PORT ADDRESS
  40.     ENDIF
  41. ;
  42.     IF    PMMI
  43. MODCTL    EQU    0C0H    ;PMMI MODEM CONTROL PORT ADDRESS
  44.     ENDIF
  45. ;
  46. BDOS    EQU    5
  47. DBUFF    EQU    80H
  48. ;
  49. PMESSG    EQU    9
  50. CHRINP    EQU    1
  51. ;
  52.     ORG    100H
  53. ;
  54. FLIP:    IF    BYE
  55.     LXI    H,0
  56.     DAD    SP
  57.     SHLD    SAVRET
  58.     LXI    SP,SAVRET+100
  59.     ENDIF
  60. ;
  61.     MVI    C,PMESSG
  62.     LXI    D,MESSG
  63.     CALL    BDOS
  64. ;
  65. FLIP1:    MVI    C,PMESSG
  66.     LXI    D,MESSG2
  67.     CALL    BDOS
  68.     MVI    C,CHRINP
  69.     CALL    BDOS
  70.     CPI    3    ;CTL-C?
  71. ;
  72.     IF    BYE
  73.     JZ    CPMRET
  74.     ENDIF
  75.     JZ    0    ;YES, EXIT TO CP/M WARM BOOT
  76.     CPI    13    ;CARRIAGE RETURN?
  77.     JNZ    FLIP1    ;NO, ASK FOR ANOTHER INPUT
  78. ;
  79. ;SET MODEM FOR OFF-HOOK ORIGINATE
  80.     IF    PMMI
  81.     MVI    A,1DH
  82.     ENDIF
  83.     IF    DCH
  84.     MVI    A,87H    ;ALSO HIGH BAUD
  85.     ENDIF
  86.     OUT    MODCTL
  87.     IF    FASTCLK
  88.     MVI    C,20    ;10 SECONDS AT 4MHZ
  89.     ENDIF
  90.     IF    NOT FASTCLK
  91.     MVI    C,10    ;10 SECOND COUNT
  92.     ENDIF
  93. ;
  94. ;DELAY LOOP - NUMBER OF SECONDS IN C REGISTER
  95. CTLP:    LXI    H,0    ;ONE SECOND DELAY LOOP
  96.     LXI    D,1
  97. ;
  98. SLO:    DAD    D    ;DONE WITH ONE SECOND LOOP?
  99.     JNC    SLO    ;NO, DO ANOTHER LOOP
  100.     DCR    C    ;ONE LESS SECOND
  101.     JNZ    CTLP    ;NOT DONE WITH COUNT
  102. ;
  103.     IF    PMMI
  104. ;SET PMMI MODEM CHIP SO IT CAN HANG UP ON LOSS OF CARRIER
  105.     MVI    A,1CH    ;SET PMMI MODEM FOR ORIGINATE
  106.     OUT    MODCTL
  107.     ENDIF
  108. ;
  109.     IF    NOT BYE
  110.     JMP    0    ;EXIT TO CP/M WARM BOOT
  111.     ENDIF
  112. ;
  113. CPMRET:    LHLD    SAVRET
  114.     SPHL
  115.     RET
  116. ;
  117. ;
  118. MESSG:
  119.     DB    'IF YOU HIT RETURN, YOU HAVE 15 SECONDS TO SWITCH',13,10
  120.     DB    'TO ANSWER MODE OR YOU WILL LOSE THE CONNECTION.',13,10
  121.     DB    'IF YOUR MODEM INTERRUPTS THE PHONE LINE WHILE',13,10
  122.     DB    'REVERSING, YOU WILL LOSE THE CALL UNLESS YOU',13,10
  123.     DB    'PICK UP THE PHONE FIRST.',13,10,'$'
  124. ;
  125. MESSG2:    DB    13,10,'TYPE RETURN TO SWITCH, CONTROL-C TO ABORT: $'
  126. ;
  127. SAVRET: DW    1
  128. ;
  129.     END
  130.