home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / PRO98SRC.ZIP / DSR.BAS < prev    next >
BASIC Source File  |  1994-01-29  |  1KB  |  22 lines

  1. SUB ModemStatus(BaseAddress%,DeltaCTS%,DeltaDSR%,DeltaRI%,DeltaRLSD%,CTS%,DSR%,RI%,RLSD%)
  2. 'Modem Status                       &H3FE
  3. 'Do an Input to read this status register.
  4. '  1 - Bit 0 says that not CTS inp to processor has chng since last read
  5. '  2 - Bit 1 says that not DSR inp to processor has chng since last read
  6. '  4 - Bit 2 is trail of TERI, ind not RI ahgd since last read
  7. '  8 - DRLSD ind not RLSD inp chgd since last read
  8. ' 16 - Complement of CTS, if = logic 1 is equiv to RTS in the MCR
  9. ' 32 - Complement of DSR, if = logic 1 is equiv to DTR in the MCR
  10. ' 64 - Complement of RI, if MCR = logic 1 then equiv to out 1 in the MCR
  11. '128 - Complement of RLSD if MCR = logic 1 then equiv to out 2 in the MCR
  12. MSR%=INP(BaseAddress%+6)
  13. IF (MSR% AND &B00000001) THEN DeltaCTS%=1 ELSE DeltaCTS%=0
  14. IF (MSR% AND &B00000010) THEN DeltaDSR%=1 ELSE DeltaDSR%=0
  15. IF (MSR% AND &B00000100) THEN DeltaRI%=1 ELSE DeltaRI%=0
  16. IF (MSR% AND &B00001000) THEN DeltaRLSD%=1 ELSE DeltaRLSD%=0
  17. IF (MSR% AND &B00010000) THEN CTS%=1 ELSE CTS%=0
  18. IF (MSR% AND &B00100000) THEN DSR%=1 ELSE DSR%=0
  19. IF (MSR% AND &B01000000) THEN RI%=1 ELSE RI%=0
  20. IF (MSR% AND &B10000000) THEN RLSD%=1 ELSE RLSD%=0
  21. END SUB
  22.