Texas Instruments 990 Operation Manual page 105

Prototyping system
Hide thumbs Also See for 990:
Table of Contents

Advertisement

Jd7S\ _ _ _ _ _ _ _
~
945255-9701
the second statement will cause a new value
0
to replace the previously calculated value. The
calculated sum A + B will therefore be lost. If, on the other hand, the program contains the
statement
E=A+B
and, later in the program, the statement
D=C+E
the value of E will be preserved when
0
is calculated by the second statement. The programmer
can examine the memory location containing the value of E to determine the calculated sum A +
B.
After a computation is completed, reconstruction of the results of a program run involves
distinguishing which decision paths have been taken through the program's code and determining
what variables are relevant in calculating the results of a computation.
When the source code is written, it is often simple to store intermediate results in extra memory
to record those results, branch paths, or the number of passes through loops. Such statements
can be nagged with a character string (e.g., **DEBUG**) in the comment field. When the source
code is ready for production, PX9EDT can be used to locate and remove the code that stores
intermediate results.
3.6.1.2 Checking the Program. Once a program has been successfully assembled, a thorough
check of the program can often tum up errors which are hard to detect when the program is
executing. In addition to making sure that the program is a correct implementation of the
algorithm, it is often worthwhile to read through the program looking for specific errors:
Register errors. Using the wrong register; referencing a register not in the current
workspace; using a register as an immediate value (e .g., AI R I ,R2 instead
0
fAR I , R2
or AI Rl,2); using byte-level operations or data where the data is in the wrong half of
the register; or using byte-level data with the other half of the register containing
incorrect data which affects the computation.
Variable names. Misspelling of variable names such as TO and TO; or using a single
variable to contain different quantities.
Initialization errors. Referencing values which may not have been properly initialized.
This often occurs when a program is re-executed.
Buffer initialization. Omitting an instruction to clear an input buffer between input
operations when variable length records are read into a common fixed-length buffer.
Branch conditions and loop terminations. Using the wrong branch instruction (espe-·
cially JH, JL, JGT, JLE, JLT, JHE, or JOC with subtracts); or executing a loop one
time too many or one time too few.
Inconsistent techniques. Using conventions or debug elements which are inconsistent
with the coding practice for the module.
3-67
Digital Systems Divisiol

Advertisement

Table of Contents
loading

Table of Contents