pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Table 60 Built-In Type-Conversion Routines (continued)
To ...Converts ...Routine
Rounded FIXED valueINT, INT(32), REAL, REAL(64), or FIXED
value
$FIXR
REAL valueINT, INT(32), FIXED(fpoint), REAL, or
REAL(64) value
$FLT
Rounded REAL valueINT, INT(32), FIXED(fpoint), REAL, or
REAL(64) value
$FLTR
INT valueUpper 16 bits of an INT(32) or
EXTADDR value
$HIGH
FIXED(fpoint ) valueSigned INT value$IFIX
INT value$INT INT, INT(32), FIXED, UNSIGNED
(1-31), REAL, or REAL(64) value
Some address types
Same as $INT, but sets $OVERFLOW
in some cases
$INT_OV
Rounded INT value$INTR Low-order 16 bits of an INT, INT(32),
or FIXED value
REAL or REAL(64) value
FIXED(fpoint ) valueUnsigned INT value$LFIX
INT(32) valueUnsigned INT value$UDBL
FIXED
2
INT(32)$UFIX
1
1
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).
2
Zero extends the INT(32) value to FIXED; does not sign extend.
Type-conversion routines that convert an argument from a smaller data type to a larger data type,
such as $DFIX, perform a sign extension of the expression to the high bits.
Type-conversion routines whose names end in R, such as $DBLR, round their results. All other
type-transfer routines truncate their results.
Type-conversion routines round values as follows:
(IF value < 0 THEN value - 5 ELSE value + 5) / 10
That is:
1. If value is negative, 5 is subtracted; if value is positive, 5 is added.
2. Integer division by 10 truncates the result; therefore, if the absolute value of the least significant
digit of the result after initial truncation is 5 or more, one is added to the absolute value of
the final least significant digit.
Rounding has no effect on INT, INT(32), or FIXED expressions.
Address-Conversion Routines
An address-conversion routine converts one address type to another address type.
Table 61 Built-In Address-Conversion Routines
To ...Converts ...Routine
EXTADDR addressBADDR address$BADDR_TO_EXTADDR
WADDR addressBADDR address$BADDR_TO_WADDR
Nonatomic Operations 283










