Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modem on Com4 with 1.1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a modem on com4 but the modem program i wrote and the tty program only work on 1 and 2. HELP
please don't send zip's and exe's
 
'Modify this a bit to use Com4
'use Com4 where it says Com3 and stuff
'from
DEFINT C
'-- read Com2 and Com3 adrresses
DEF SEG = 0
Com2 = PEEK(&H402) + 256 * PEEK(&H403)
Com3 = PEEK(&H404) + 256 * PEEK(&H405)
'Com4 = PEEK(&H406) + 256 * PEEK(&H407)

'-- swap the Com2 and Com3 adrresses
POKE &H402, Com3 AND 255
POKE &H403, Com3 \ 256

POKE &H404, Com2 AND 255
POKE &H405, Com2 \ 256

'** The following is a simple test **************************
'** Tested on a Hayes compatible modem (ON COM3) and my friends
'** voice telephone number. Since the ports have been swapped
'** you open COM2 instead of COM3

CLS

FINO = FREEFILE
OPEN "Com2:2400,N,8,1,RS,DS" FOR RANDOM AS #FINO LEN = 40

'--- Dial 999 9999 NB: please substitute this phone number
' it's my friend's and he won't like it if you call
' commas give the phone some time to respond before cutting off
PRINT #FINO, "ATDT 560 6441,,,,,,,,,,,,,"

PRINT "Press any key to hang up..."
k$ = INPUT$(1)

'--- Hang up the line
PRINT #FINO, "ATH+++"
CLOSE #FINO

'-- restore the Com2 and Com3 adrresses
'*** This is very important, if not done you'll have to reset
'*** your system before this test can work again. Also, if you have
'*** some thing connected to the ports, they may be messed up until
'*** after reset.

POKE &H402, Com2 AND 255
POKE &H403, Com2 \ 256

POKE &H404, Com3 AND 255
POKE &H405, Com3 \ 256

END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top