TAL Programmer's Guide
Arithmetic Guidelines
Improving Performance
096254 Tandem Computers Incorporated C–3
Arithmetic Guidelines A single complex arithmetic expression might cause more memory references than
several smaller expressions that are equivalent to the single complex expression. The
excessive memory references are triggered by register stack overflow, which is
especially likely if indexes are involved. Use of an index might cause part of the
computation to be pushed on the stack and later popped off. Doubleword or
quadrupleword operands fill the register stack quickly.
For quadrupleword operations, do not nest index calculations in larger arithmetic
expressions because register stack overflow is likely to result. Use a separate
statement for the index calculations, saving the results in a temporary area. The
expression can then reference this area.
The IF and CASE forms of arithmetic expressions do not generate efficient machine
code, especially when used to test complex conditions. To evaluate a complex
condition, include separate IF or CASE statements that perform proper assignments in
all possible branches of the condition.