Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 258

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

Advertisement

odelll TRSDOS
Trailer Blocks
Each program file ends with a single trailer block which tells TRSDOS what to do
next:
A. Jump to a specified "transfer" address.
- or-
B. Return to the caller.
Trailer blocks consist ofthe following:
Byte #
1
2
3-4
Notes
Contents
Block Identifier (= 2 or 3)
Length(= 2)
Transfer address in LSB-MSB sequence
1. For trailer blocks, the identifier can equal binary' '2" or "3" .
Ifm = 2, TRSDOS will jump to the transfer address after loading the program.
Ifm =
3,
TRSDOS will not jump to the transfer address, but will return to the
caller after loading the program, with the following prime registers set:
HL'
=
Transfer address taken from trailer block
DE'
=
Address of last usable byte
Be'
=
First byte following the program just loaded.
2. The transfer address is in LSB-MSB sequence. It must be in the user area of RAM
(see' 'Memory Requirements of TRSDOS' ').
Procedure for Writing a Program File
Program files must have fixed length records of length 256, and must have the "P"
(Program) access type. Both of these attributes are set when the file is created
(Creation code 1 or2). SeeSvCOPEN.
The TRSDOS program loader treats the program file as a serial byte stream,
independent of the record-boundaries. The loader assumes the program blocks are
"back-to-back" , i.e., there are no unused bytes between blocks. It is the
programmer's responsibility to:
1. Store the correct byte sequence in the logical record area
2. Call the disk write SVC(DIRWR) when each 256-byte record is filled. Blocks can
and must' 'span" sectors. The only unused bytes in the file will be after the
trailer block. See the illustration on page 4/87.
294

Advertisement

loading