TRS-80 MODEL III
Forall
of
the above variables, addresses
(K
-1)
and
(K
2) will store the
TRS-80
CharacterCodefor the variable name. Address
(K
- 3) will contain a descriptor code
that tells the Computerwhat the variable type is. Integer is
02; single precision is
04; double precision is 08; and string is 03.
V
ARPTR(
array variable) will return the address for the first byte
of
that element in
the array. Theelement will consist
of2
bytes
if
it is an integerarray; 3 bytes
if
it
is
a
string
array; 4 bytes
if
it is a singleprecision array; and 8bytes
if
it
is
a double
precision array.
The first element in the array is preceded by:
1.
A sequence
of
two bytes per dimension, each two-byte pair indicating the
,'depth"
of
each respective dimension.
2. A single byte indicating the total number
of
dimensions in the array.
3. A two-byte pair indicating the total number
of
elements in the array.
4. A two-byte paircontaining the ASCII-coded array name.
5. A one-byte type-descriptor (02 = Integer, 03 = String, 04 = Single-Precision,
08 = Double-Precision).
Item
(1) immediately precedes the first element, Item (2) precedes Item (1),
and so on.
Theelements
of
the array are stored sequentially with the first dimension-subscripts
varying'
'fastest",
then the second, etc.
Examples:
LSB
(K)
o
Next
MSB
(K +
1)
o
MSB
(K+2)
o
A!
= 2 will be stored as follows
2 = 10 Binary, represented
as
.IE2
=
.1
x 2
2
So exponent
of
A is 128 + 2 130 (called excess 128)
MSB
of
A is 10000000;
however, the high bit is changedto zero since the value is positive (called hidden or
implied leading one).
So
A!
is stored as
Exponent (K + 3)
130
A!
= - .5 will be stored as
Exponent (K + 3)
MSB
(K+2)
Next
MSB
(K +
1)
LSB
(K)
128
128
0 0
A!
= 7 will be stored as
Exponent (K + 3)
MSB
(K+2)
Next
MSB
(K +
1)
LSB
(K)
131
96
0
0
A!=
-7:
Exponent (K + 3)
MSB
(K+2)
Next
MSB
(K +
1)
LSB
(K)
131
224
0
0
Zerois simply stored as a zero-exponent. The other bytes are insignificant.
8/10