DATA FORMATS
Variables
Variables are stored
in
the Variable Area of user program memory (see
Figure
6-2).
These are simple (unsubscripted) variables; arrays are stored
in
a separate area. The variables may be floating point, integer,
or
string and
are freely intermixed
in
the Variable Area. Each variable, regardless of its
type, occupies
se
ven
bytes of memory. The first
two
bytes contain the variable
name. and the remaining five bytes further define the variable. Variables are en-
tered into the variable table
as
they are encountered during execution of the user
program. A variable
that
is
not in the table
is
assumed to have a value of zero for
numeric variables or null for a string variable.
Floating Point Variable Format
Byte: 2
3 4 5 6
7
1st 1
2nd
1 Expo- ,
char
+,
char or 0
nent-:
1
1.
Fraction
1
Byte 1 contains the first character of the variable name. Byte 2 con-
tains the second character of the variable
na
me
or,
if
there is
no
second
character, byte 2 contains a zero.
The characters are stored in standard ASCII
codes
(see
Appendix
A). For example. the name A
is
stored
as
65. 0 whereas the
name
AO
is
stored
as
65. 48. A f10ating point variable
is
denoted by variable
names having stored ASCII values of
90
or
below.
Bytes 3 through 7 contain the value of the floating point variable in standard
normalized. excess
128 format. Byte 3 contains the exponent
in
ex
cess
128
format. The exponent determines the magnitude of the number. In
ex
cess 128
format. 128
is
added
to
the true exponent (after normalization of the significant
digits)
so
that
the smallest exponent representation contains ail zeros. The largest
exponent representable contains ail ones. A true exponent of zero
is
represented
by
an
exponent value of 128 {0+128l. Excess 128
format
eliminates having
to
consider a sign in the exponent.
Examples:
Exponent
255
162
127
2
o
Approximate
Value
10
38
(maximum exponent)
1010
10-
1
10-
38
10-
39
{minimum
exponent-number
is
zero)
317