pTAL Conversion Guide

pTAL Built-In Routines
pTAL Conversion Guide527302-002
18-27
$FIXEDTOASCIIRESIDUE
qvalue input
FIXED(*):value
is a quadrupleword integer value to convert to ASCII digits.
bufferaddr input
BADDR:value
is the byte address at which to write the ASCII digits.
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 qvalue that it does not
convert because maxdigits were written but qvalue was not fully converted.
$FIXEDTOASCIIRESIDUE sets $OVERFLOW if it converts maxdigits bytes but
leading digits in qvalue were not converted; otherwise, it resets $OVERFLOW.
Figure 18-7. TAL Code Equivalent to $FIXEDTOASCIIRESIDUE Routine
CODE(STRP 7);
STACK qvalue, buffer, maxdigits;
CODE(CQA);
CODE(STRP 3);
STORE qresidue;
Example 18-18. Call to $FIXEDTOASCIIRESIDUE Routine
LITERAL buffer_len = 100;
FIXED val;
STRING .buffer[ 0:buffer_len - 1 ];
FIXED residue;
$FIXEDTOASCIIRESIDUE(val, @buffer, buffer_len, residue);