TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-43
Example of $USERCODE Function
Example of $USERCODE Function
In this example, $USERCODE returns the content of a word located at a label in the
current user code segment:
PROC p; !Declare procedure
BEGIN
INT a, b, c; !Declare variables
!Some code here
u_code_location: !Label a location
a := a + b;
!More code here
c := $USERCODE (@u_code_location); !Get content of word
END; ! located at label
$XADR Function
The $XADR function converts a standard address to an extended address.
variable
is the identifier of a simple variable, pointer, array element, structure, or structure
data item. For any other variable, the compiler issues a warning.
Usage Considerations
$XADR returns an extended address from the standard address of variable. (If variable
is a pointer, $XADR returns the extended address of the data to which the pointer
points, not the address of the pointer itself.) If
variable already has an extended
address, $XADR returns the extended address; in this case, $XADR behaves like the
@ operator.
If a structure spans the 32K-word boundary of the user data segment, $XADR cannot
return an extended address from the standard address of a byte-addressed structure
item.
You cannot use $XADR at the global level because $XADR uses compiler-generated
code to compute the extended address.
$XADR (
)
variable
VST1446.vsd