TAL Programmer's Guide
Equivalencing Simple Pointers
Using Equivalenced Variables
096254 Tandem Computers Incorporated 10–7
When you equivalence extended pointers, you need not worry about byte and word
addressing mismatches, because extended pointers always point to byte addresses.
Thus, you can equivalence an extended INT pointer to an extended STRING pointer:
STRING .EXT xstrptr
:= %2000000D;
INT .EXT xintptr
= xstrptr;
Primary area of user data segment
399
Automatic extended data segment
XSTRPTR =
%2000000D
XINTPTR
%2000000D
.
.
.
Avoid Mixing Byte and Word Addressing
If you equivalence a STRING standard pointer to an INT standard pointer, the INT
pointer points to a word address and the STRING pointer points to a byte address.
Avoid the following practice:
INT .ptr1 := 200;
STRING .ptr2 = ptr1;
308
PTR2 = 200
G[200]
PTR1 = 200
.
.
.
.
.
.
G[200]
Byte address
Word address
Equivalencing Simple Pointers to Direct Variables
You can equivalence a simple pointer to a direct variable. The content of the simple
variable becomes the address of the data to which the pointer points.
You can equivalence a standard pointer to a simple variable:
INT dir := 200;
INT .ptr = dir;
PTR = 200
306
G[200]
DIR = 200
.
.
.