Details Of Block Structure - Radio Shack TRS-80 Operation Manual

Ptc-64 printer controller
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

2.
Comment
blocks.
These
contain
documentation
for the
programmer.
Comment
blocks
are
not loaded or
examined by
the loader.
Comment
blocks
are
prefixed
by two
bytes
of
header
information.
3.
Trailer blocks.
Each program
file
ends
with a
trailer
block.
It
marks
the
end
of
file
and
tells
the Printer Controller
to transfer
control
to
a specified address. Trailer
blocks
are
always
four bytes long.
The
length of the blocks
will
vary,
depending on
the
type of block
and
the
amount
of
information
in
that
block.
The
blocks
must
be contiguous:
there
can be no unused
bytes
after
the
end
of
one block and
the
beginning of
the next.
The
first
byte
in
a
block
identifies
the
block type
as
follows:
Contents of Byte
#
Block
Type
Hex
01
Program
data
05
Comment
block
02
Trailer
block
jump
after
loadin
all
others
ignored
Details
of
Block
Structure
Program
data blocks consist of
the following:
Byte
#
Contents
1
Block
Identifier
(=1)
2
Length
number
of
bytes
of
program
data plus
two
for
load address
3-4
Load
address
where
the
following
program
data
starts
loading
into
RAM, LSB-MSB
format.
5-end
Program
data
Notes:
1.
The
block
identifier
always
equals binary
"1"
for
a
program
data block.
2.
The
length byte gives the
number
of
bytes
in
the
rest
of
the
block
following
the
two-byte
load address. This
sum may
range
from
three
(two-byte addresses
plus
one
byte of
data)
to
258
(two-byte addresses
plus
256
bytes
of
data),
but
it
must
be
translated into the
range 0-255.
To
do
this,
take the
number
of
program
bytes
and increment
by
two.
Note
that
values
greater
than
255
"wrap
around"
to 0,
1,
and
2.
Here
is
a
table:
Number
of
bytes
after
the
address
Use
this
value
for
(program
data only)
the length
byte
itself
1
3
2
4
3
5
253
255
254
255
1
256
2
22

Advertisement

Table of Contents
loading

Table of Contents