TAL Programmer's Guide
Accessing Operands
Using Expressions
096254 Tandem Computers Incorporated 5–27
A program can deal with arithmetic overflows in one of four ways:
Desired Effect Method
Abort on all overflows Use the system’s default trap handler.
Recover globally from overflows Use a user-supplied trap handler.
Recover locally from statement overflows Turn off overflow trapping and use $OVERFLOW.
Ignore all overflows Turn off overflow trapping throughout the program.
For information on turning off overflow trapping and using $OVERFLOW, see the
description of $OVERFLOW in the TAL Reference Manual.
The following operations are not portable to future software platforms:
Passing the overflow bit as an implicit parameter into a procedure or
subprocedure
Returning the overflow bit as an implicit result from a procedure or subprocedure
Accessing Operands The remainder of this section discusses different ways of accessing operands:
Getting the address of a variable
Dereferencing a simple variable
Extracting a bit field
Shifting a bit field
For information on bit deposits, see the TAL Reference Manual.
Getting the Address
of Variables
To get the address of a variable, prefix the variable identifier with @. For example, you
can assign the address of an array element to a simple variable as follows:
INT .array[0:2]; !Declare array
INT var; !Declare simple variable
var := @array[2]; !Assign address of ARRAY[2] to VAR
Dereferencing
Simple Variables
You can dereference an INT simple variable in a statement by prefixing the variable
identifier with the dereferencing operator (.). The content of the INT simple variable
then becomes the standard word address of another data item. You can use the
dereferencing operator in any INT arithmetic expression.
The dereferencing operator is not portable to future software platforms and is
described here only to explain its use in existing programs.
The following example uses the dereferencing operator to store data at the standard
word address that is saved in A:
INT a := 5; !Declare A; initialize it with 5
.a := 0; !The 5 contained in A becomes an address;
! thus 0 is stored at address G[5]