Tandy TRS-80 Owner Manual & Programming Manual page 72

Color computer disk system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

TECHNICAL INFORMATION
SPECIAL INPUT/OUTPUT
COMMANDS
BASIC
offers
two
special
input/output
commands.
These
commands
input
and
output data
directly to
a particular
sector.
They
do
this
through
bypass-
ing the entire
disk's filing
system.
The
first,
DSKI$,
inputs the data
from
the
sector
you
specify.
This
is its
format:
DSKI$
drive
number,
track, sector,
string
vari-
ablel, string
variable2
The
first
128 bytes
of
the
sector
are input
into
string variablel.
The
second 128 bytes
are input
into string variable2.
For example:
50
EXT$(0)
60
DSKI$
0,
17,
1
,
A*, B$
(ENTER)
inputs the contents of sector
1,
track 17
of
the disk
in
drive
0. It
inputs the
first
128 bytes
into
A$
and
the
second 128 bytes
into
B$. After typing
this
command, you
can
display the contents
of this
sec-
tor
with:
PRINT A$i B$
(ENTER)
Since
DSKI$
will
read
any
sector
on
the
disk,
it
is
the only
BASIC command
which
will
read
the
directory
sector.
This
sample program
uses
DSKI$
to
search the directory
for
filenames
with
the
extension
"DAT":
10
FOR
X
=
3
TO
11
20
DSKI$
0,17»X»A$»B$
30 C$
=
A$
+
LEFT$(B$»127)
40
NAH$(0)
=
LEFT$(C$,8)
=
MID*(C*,9,3)
TO
7
=
MID$(C*»N*32+1
,8)
=
MID$(C$,9+N*32»3)
FOR
N=l
70
NAM*(N)
80
EXT$(N)
90
NEXT
N
100 FOR N=0 TO
7
110
IF
EXT$(N)
=
"DAT" AND
LEFT*(NAM$(N) ,1)<>CHR$(0) THEN PRINT
NAM$(N)
120
NEXT
N
130
NEXT
X
The
second
command,
DSKO$,
outputs data
directly
to
the
sector
you
specify.
Since
it
bypasses
the disk
filing
system,
it
will
output data without
opening a
file
and
listing
its
location in
the
direc-
tory.
For
this
reason
you need
to
be
careful:
1.
not
to
output data over the
directory sectors
unless
you no
longer plan
to
use the
directory.
2.
not
to
output data over other data
you
presently
have
stored
on
the
disk.
The
format
of
DSKO$
is:
DSKO$
drive
number,
track, sector, stringl,
string2
Stringl
will
go
in
the
first
128 bytes
of
the
sector.
String2
will
go
in
the next 128
bytes.
For example:
DSKO*
0,
1.
3,
"FIRST STRING", "SECOND
STRING"
(ENTER)
Outputs
data
to
sector
3,
track
1,
on
the disk
in
drive
0.
"FIRST
STRING"
will
go
in
the
first
128
bytes
of this
sector.
"SECOND
STRING"
will
go
in
the second 128
bytes.
62

Advertisement

Table of Contents
loading

Table of Contents