Download Print this page

Radio Shack TRS-80 PC-2 Owner's Manual page 16

Hide thumbs Also See for TRS-80 PC-2:

Advertisement

I
File is ended with a null line (carriage return only).
• After compression, a maximum of 80 characters are
allowed.
To merge ASCII format program with the resident
program, through the RS-232C, use a command sequence
similar to the following:
SETDEV CI
MERGEa "PROGRAM"
INSTAT
Input Statuts
INSTAT
INSTAT reads the current RS-232C status and returns it
as an integer from 0 to 31. To interpret the status, con-
vert th is integer to its binary equivalent (O's and 1's).
A 1 will mean the line is "ready;" a 0 will mean the line
is "not ready."
This number is a binary bit image of the RS-232C's hand-
shake signal whose bits are defined as follows:
Bit
Signal
0 (write)
DTR (Data Terminal Ready)
1 (write)
RTS (Request To Send)
2 (read)
CTS (Clear To Send)
3 (read)
CD (Carrier Detect)
4
(read)
DTR (Data Terminal Ready)
5 and up
not used
26
For instance, if you type INSTAT
(ENTER)
and
10
appears on the Display, you should convert this number
to its binary equivalent:
00001010
Since bit counting starts at the right, Bit 0 (DTR) is "not
ready," Bit 1 (RTS) is "ready," Bit 2 (CTS) is "not
ready," Bit 3 (CD) is "ready," and Bit 4 (DTR) is "not
ready."
Note that this means the device the PC-2 is communicat-
ing with should have the opposite status.
INSTAT can be used in either RUN or PRO mode and
should be used with the same syntax as any function
which returns numeric information.
For example, A
=
INSTAT and PRINT INSTAT are both valid.
The following program would display whether or not a
"clear to send" status is present (bit 2 is set) during execu-
tion of a BASIC program:
100 WAIT 0
110 CLS
120 A
=
INSTAT
130 IF (A AND 4)
=
0 PRINT "NOT ";
140 WAIT
150 PRINT "CLEAR TO SEND."
27

Advertisement

loading