pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
maxdigits
input
uINT:value
is the maximum number of ASCII digits to read from bufferaddr.
remainingdigits
output
uINT:variable
is the number of bytes that $ASCIITOFIXED did not convert because it encountered a
nonnumeric ASCII byte. remainingdigits must be an INT variable; it cannot be a
STRING, UNSIGNED, or USE variable or a bit field.
qvaluein
input
FIXED(*):value
is a value that $ASCIITOFIXED adds to the result of converting the bytes at bufferaddr.
$ASCIITOFIXED multiplies qvaluein by 10 for each digit it converts from ASCII to FIXED.
After it converts the last digit at bufferaddr, $ASCIITOFIXED adds qvaluein to the result of
the conversion to establish the value that it returns qvalueout.
qvalueout
output
FIXED(*):variable
is a quadrupleword integer value that holds the final result of the conversion.
$ASCIITOFIXED converts a string of ASCII-coded digits at bufferaddr to a binary-coded
FIXED value, adds qvaluein times 10n, where n is the number of digits converted, and
stores the result in qvalueout.
If a nondigit ASCII code is encountered, $ASCIITOFIXED ends the conversion. $ASCIITOFIXED
converts only the digits before the nondigit ASCII code. CCG indicates that $ASCIITOFIXED
converted only part of the ASCII number. CCE indicates $ASCIITOFIXED converted the entire
string. If overflow traps are enabled and the result is greater than 263-1 or less than 263,
$ASCIITOFIXED sets $OVERFLOW and qvalueout is undefined.
Example 233 $ASCIITOFIXED Routine
LITERAL buffer_len = 100;
STRING .buffer[ 0:buffer_len - 1 ]; ! Buffer to convert
STRING .ptr := @buffer; ! pointer to buffer
INT maxdigits;
INT remainingdigits;
FIXED qvaluein;
FIXED qvalueout;
$ASCIITOFIXED (@ptr, maxdigits, remainingdigits, qvaluein,
qvalueout);
$AXADR
NOTE: The EpTAL compiler does not support this routine. (The EpTAL compiler does allow $AXADR
as a DEFINE name.)
$AXADR converts a standard address or a relative extended address to an absolute extended
address.
Nonatomic Operations 293