Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 218

Disk operating system
Hide thumbs Also See for TRS-80 Model II:

Advertisement

Model II
TRSDOS
Meaning
Read-only
Read/Write a data file
Write a program file
However, if the record length is 24 (not an even divisor of256), then some
records will have to be spanned. In this case, you will need to reserve 512
bytes.
With Variable Length Record files, you must always reserve 512 bytes for
processing. This is because spanning may be required, depending on the
lengths of the individual records in the file.
RECADR (Record Address). This two-byte field must point to the
beginning of the Record Area.
For disk reads, this is where
TRSDOS
will place the record. For disk writes, this
is where you put the record to be written.
Exception: For
FLR
files with a record length of 256, this address is not used.
Your record will be in the buffer area pointed to by
BUFADR.
For Fixed Length Record files with record length not equal to 256, this buffer
should be the same size as the record length. For Variable Length Files, this
area should be long enough to contain the longest record in the file (including
the length-byte).
If
you are not sure what the longest record will be, reserve
256 bytes.
EODAD (End of Data Address). This two-byte field can be used to give
TRSDOS
a transfer address to use in case the end of file is reached during an
attempted read; control win transfer to the
EODAD
address if the end of tile is
reached during a read operation.
IfEODAD
=
0 and end offile is reached, the
svc
will simply return with the end of file error code in register A.
ACCESS Type
The seventh byte specifies the type of access that is desired. It can be any of the
following:
ASCII
Character
R
W
P
The last option is new. It allows a programmer to create a file which can be loaded
and executed directly from
TRSDOS.
The
TRSDOS DUMP
command also creates
program files, and should be used except for unusual cases. This file will appear in
the
DIR
with the" P" attribute.
It is the programmer's responsibility to ensure that the program bytes are written in
the correct format and sequence, as defined in the section, Programming with
TRSDOS.
254

Advertisement

loading