TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-44
Examples of $XADR Function
Examples of $XADR Function
1. This example initializes an extended pointer with the extended (32-bit) address that
$XADR returns from a standard (16-bit) address:
INT .array[0:49]; !ARRAY has 16-bit address
STRING .EXT xptr := $XADR (array);
!Initialize XPTR with 32-bit
! address returned by $XADR
2. In this example, $XADR returns an extended address for an INT variable to which
a standard simple pointer points, and then assigns the extended address to an
extended simple pointer:
INT .std_ptr := %1000; !Declare 16-bit simple pointer
INT .EXT ext_ptr; !Declare 32-bit simple pointer
@ext_ptr := $XADR (std_ptr);
!Assign 32-bit address
3. In this example, $XADR returns the extended address of an extended indirect
array:
INT .EXT ext_ptr;
INT .EXT xarray[0:9]; !XARRAY has 32-bit address
ext_ptr := $XADR (ext_array[5]);
!Assign 32-bit address
Built-in Functions
TAL supports many pTAL built-in functions. pTAL built-in functions provide the
functions of required CISC instructions that standard pTAL features and millicode
routines do not provide.
pTAL does not define built-ins for instructions whose functions are:
Available through standard pTAL constructs
Available via calls to RISC millicode routines
Not needed to run programs on RISC processors
In a few cases, pTAL defines a built-in because the equivalent millicode routine cannot
be called from pTAL. pTAL supports each built-in by a combination of RISC instructions
and calls to system routines.
Many built-ins can be executed only by processes running in privileged mode. Most
built-ins are executable statements rather than functions that return values, such as:
$ATOMIC_ADD(a, b);