pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

maxdigits
input
uINT:value
is the maximum number of ASCII digits to write at bufferaddr.
qresidue
output
FIXED(*):variable
holds any of the original value that was not converted because maxdigits bytes were
converted without converting all of qvalue.
$FIXEDTOASCIIRESIDUE returns in qresidue any portion of qvalue that it does not convert
because maxdigits digits were written but qvalue was not fully converted.
If $FIXEDTOASCIIRESIDUE converts maxdigits bytes but leading digits in qvalue are not
converted, and $OVERFLOW can be checked, $FIXEDTOASCIIRESIDUEI sets $OVERFLOW;
otherwise, it resets $OVERFLOW.
Example 256 $FIXEDTOASCIIRESIDUE Routine
LITERAL buffer_len = 100;
FIXED val;
STRING .buffer[ 0:buffer_len - 1 ];
FIXED residue;
$FIXEDTOASCIIRESIDUE(val, @buffer, buffer_len, residue);
$FIXI
$FIXI converts a FIXED value to a signed INT value.
NopTAL privileged procedure
NoCan be executed only by privileged procedures
NoSets condition code
NoSets $CARRY
YesSets $OVERFLOW
fixed-expression
is a FIXED expression, which $FIXI treats as a FIXED expression, ignoring any implied decimal
point.
If the result cannot be represented in a signed 16-bit integer, $FIXI traps if overflow traps are
enabled (see Chapter 13 (page 234)); otherwise, $FIXI ignores the problem.
Example 257 $FIXI Routine
INT intnum;
FIXED fixnum := %177777F;
intnum := $FIXI (fixnum); ! Return -1
$FIXL
$FIXL converts a FIXED value to an unsigned INT value.
312 Built-In Routines