Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 82

Mini-disk operation, trsdos disk operating system, disk basic programming language
Hide thumbs Also See for TRS-80 model III:

Advertisement

TRSDOS
DCB
while
$OPEN
Address
Length
Explanation
DCB
+
3
Reserved
+
3
2
Physical Buffer
address
(lsb/msb)
+
5
Offset
to
delimiter
at
end
of
current record
+
6
File
drive
number
residence
+
7
Reserved
+
8
eof
offset of
last
delimiter
in
last
physical record
+
9
lrl
(logical
record
length)
+
10
2
nrn
(next
record
#
$open
sets
=
x'ooocr
lsb/msb)
+
12
2
ern
(ending record
#
(last
in
file)
lsb/msb)
+
14
50
Reserved
NRN
Next Record
Number
defines
which
record
is
to
be
read
or written
by
the
next
system
call
for
$read
or
$write.
It is
automatically
incremented
by one
after
each system
call.
In
order
to
process
random
files,
use
the
$posn
call to
direct
trsdos
to
the
record
you
wish
to
transfer next.
ERN
Ending Record
Number
is
the
last
record
number
currently
in
the
file. It
is
put
into the
directory
at
$close
time, so
if
it
is
expected
to
be
correct, the
user
must
close
his
files
after
adding
records
to
a
file.
This value
may
also
be used
to
position
to
end
of
file
so
that
new
records
may
be
added
to
the
end
of
the
file.
To
position
to
the
end
of
file
use a
call to
$posn
with
a
record
number
of
ern
+
l
$posn
is
described
later.
Physical
and
Logical
Records
in
TRSDOS
A
physical record
is
defined
as
one
sector
of
disk.
One
sector
of disk contains
256
user data bytes.
The
artificial
term
'"granule"
is
defined
to
be
3 sectors
of
disk space.
There
are
6 granules
on
each
of
the
40
tracks
on
the disk.
A
granule
is
the
least
amount
of space
allocated
by trsdos. For programming
purposes,
the
physical records
in
a
file
are
numbered from
to
N.
The
largest
record
number
(N)
in
a
file
will
then be
3
times
the
number
of granules
allocated
minus
one ((3*G)
-
1).
All
trsdos
granule
allocations are
made
as
needed
at the
time
of
write,
not
when
the
file
is
created.
Bytes
Sectors
Granules
Tracks
Disk
.
256
1
768
3
1
4608
18
6
1
184320
720
240
40
Disk Space
Table:
For each
5
l
A'
f
Disk Drive
A
logical
record
is
defined
by
the user
of
trsdos.
It
may
be
anywhere from
1
to
255
bytes
in
length.
Once
a
file is
opened
with
a
specific
lrl
(Logical
Record
77

Advertisement

loading