TAL Programmer's Guide
Accessing Structure Items
Using Structures
8–42 096254 Tandem Computers Incorporated
Copying Structure Occurrences Using Structure Pointers
You can copy structure occurrences using structure pointers:
LITERAL copies := 3;
STRUCT a_struct; !Definition structure
BEGIN
INT a;
STRING b;
END;
STRUCT b_struct (a_struct) [0:copies - 1];
!Referral structure
INT .EXT ptr0(a_struct) := $XADR (a_struct);
!Assign address of A_STRUCT to
! extended INT pointer PTR0
STRING .EXT ptr1(a_struct) := $XADR (b_struct);
!Assign address of B_STRUCT to
! extended STRING pointer PTR1
PROC n;
BEGIN
ptr1 ':=' ptr0 FOR copies ELEMENTS;
!Word move from A_STRUCT to B_STRUCT
ptr0 ':=' ptr1 FOR copies ELEMENTS;
!Byte move from B_STRUCT to A_STRUCT
END;