pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Table 70 Built-In Routines for Nonatomic Operations (continued)
Can Set ...DescriptionRoutine
Converts a WADDR address to an
EXTADDR address
$WADDR_TO_EXTADDR
$CARRYWrites a segment-page table entry$WRITEPTE
1, 2, 3
Returns the address of the specified
variable or struct as type EXTADDR.
6
$XADR
Returns the address of the specified
variable or struct as type
EXT32ADDR4.
6
$XADR32
4
Returns the address of the specified
variable or struct as type
EXT64ADDR4.
6
$XADR64
4
1
pTAL privileged procedure (see Privileged Mode (page 274))
2
Only procedures operating in privileged mode can execute this routine (see Privileged Mode (page 274)).
3
The EpTAL compiler does not support this routine.
4
64-bit addressing functionality added to the EpTAL compiler starting with SPR T0561H01^AAP. For more information,
see Appendix E, “64-bit Addressing Functionality” (page 531).
5
The pTAL compiler does not support this routine.
6
The desired address is returned only if there exists a valid, explicit type conversion from @var or @struct to the desired
extended address type.
$ABS
$ABS returns the absolute value of its argument. The returned value has the same data type as the
argument.
NopTAL privileged procedure
NoCan be executed only by privileged procedures
NoSets condition code
NoSets $CARRY
YesSets $OVERFLOW
expression
is an expression (as described in Chapter 5 (page 69)).
If the absolute value of a negative INT, INT(32), or FIXED expression cannot be represented in
two’s complement form (for example, if expression has the INT value -32,768), $ABS traps if
overflow traps are enabled (see Chapter 13 (page 234)); otherwise, $ABS ignores the problem.
Example 231 $ABS Routine
INT int_val := -5;
INT abs_val;
abs_val := $ABS(int_val); ! Return 5, the absolute value of -5
$ALPHA
$ALPHA tests the right byte of an INT value for the presence of an alphabetic character.
Nonatomic Operations 291