On the other hand, you might see every character you type displayed twice. This
would happen if you have the Model
100
set for Half Duplex and the remote system
is
set for Full Duplex.
If
this happens, press
~
to toggle from Half to Full Duplex.
You can transfer'fiIes over the modem using the Upload and Download capabilities
of
the terminal. Refer
to
the previous lesson on serial communications which discusses
how to do this and how to use the other features
of
the terminal mode. The only
change required
is
to specify
"M"
for the baud rate, R,
so
that communication
is
through the built-in modem.
Experiment
#3
Log-On from a BASIC Program
The built-in modem can be used from BASIC
to
communicate with other devices. The
procedure, however, is not especially easy, and is therefore recommended only for
advanced or adventuresome programmers. While it is probably easiest to transfer files
and communicate with other systems using TELCOM, there are times when it
is
desirable to use BASIC. For example, you can write a BASIC program to call a stock
quotation service on a periodic basis, say every hour, and save the hourly quotes
in
a
data file for later analysis.
The following program segment will dial and log-on to the hypothetical
IS
(Information Service) from the previous two experiments:
100
0$
=
"123-45G7<'·WM?U87GB,453'·M?PT
....
lo-tone
h
M?
SNewshM)"
110
M = VARPTR(O$)
120
D = PEEKCM+1l +
PEEKCM+2l*25G
130
CALL
21200
:
CALL
21283,0,0
Line
166
The telephone number and-log
on
sequence are stored
in
the string variable
D$.
Line
116
The V
ARPTR
function returns an address M which helps locate the string
D$. Location M contains the length
of
the string variable, location M +1 contains the
least significant byte
of
the two byte starting address
of
the string, and location M +2
contains the corresponding
most significant byte
of
the address.
Line 128 The address of the string variable
D$
is computed and stored in the numeric
variable
D.
The function PEEK(x) returns the decimal value
of
the contents
of
memory location x.
Line
136
The CALL statement
is
used to call a machine language subroutine. The
general form
is
CALL adr,A,HL
where adr
is
the starting address
of
the subroutine, A is an optional eight bit value to
be passed through the A register, and
HL
is an optional
16
bit value to be passed
through the HL register. The first statement
CALL
21200
calls a machine language subroutine in the Model 100 ROM which "takes the
182