Radio Shack TRS-80 User Manual page 40

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

What?
A
number
times
its
reciprocal
is
supposed
to equal
1
exactly.
So what
gives?
You
have
discovered the
Computer's
limit
of accuracy. Just
like
a calculator
(or
a person), a
computer
can never
be
perfectly accurate
all
the time.
For
short arithmetic expressions, the
TRS-80
is
accurate
to
the
fifth
or sixth
decimal
place.
In longer,
more complex
expressions,
a
minute
error
in
the
sixth place
can be magnified
to
where
it
becomes
significant. All
pro-
grammers
have
to
cope with
this
kind of
built-in error.
We'll discuss
one
way
of handling
it
in a later
chapter.
Calculator
Mode
for
Troubleshooting
Suppose
a
program
isn't
giving
you
the
answers
you
expect.
How
can
you
troubleshoot the
program?
One way
is
to
ask the
Computer
to
tell
you what
it
knows
about
the
variables
used
in
the resident
program.
Example:
PRINT
X.
The Computer
will
tell
you what
the present value
of
X
is.
Another
thought:
Something
is
stored
in
every
memory
cell
{even
if
YOU
have not put
anything
there).
Enter
and
RUN
this
instruction
in
the calculator
mode:
Comdex
programs.
dpmmlndasyoit
get
into
more
v>-i-.-
::-'"
'.'"-'t'
'.'.."";
PRINT
A,B,C,D,E,F
T
G,H,I,J,K,L,M,N,0,P,Q,R
t
S,T,U,V,W,X,Y,Z
The
answers
depend on
the
values
last
given
those
variables
even
from
much
earlier
pro-
grams.
If
you
turned
off the
Computer
since
last
using
some
of the
variables,
the
numbers
stored
in
those locations
will
be completely
arbitrary
and
meaningless.
The
Memory
Command
Since the
programs
you
write
do occupy
space
in
the
Computer's
memory,
and program
size
is
limited to
how
much memory
you
have purchased,
it
may
be important
to
know how
much
memory
you
are using for a given
program.
That's
what
the
Memory Command
is
for.
The
least
amount
of
memory
available in
the
TRS-80
is
4K.
This
means
there
are
about
4,999
different
memory
locations to store
and
process
your
programs.
(Actually,
4096.)
(If
you
have
8K
of
memory,
the
number
is
8192;
for
16K
it is
16384.)
This
manual
is
meant
to
be
forth*
computer
»
operator
and
programmer,
so
we
are studiously
avoiding
computer
efeetronies
theory
^whea
possible.
Owners
interested
in
that
phase
of
this
interesting subject are referred to their locaf
Radio Shack
store for
books which
specifically
:
addressitJ
.
-;:
':':.:,'.
To
get
some
idea
what
this
means,
type:
NEW
PRINT MEM
38

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents