pTAL Conversion Guide

pTAL Built-In Routines
pTAL Conversion Guide527302-002
18-26
$FIXEDTOASCIIRESIDUE
maxdigits input
uINT:value
is the maximum number of ASCII digits to write at bufferaddr.
$FIXEDTOASCII sets $OVERFLOW if it converts maxdigits bytes but leading digits
in qvalue were not converted; otherwise, it resets $OVERFLOW.
$FIXEDTOASCIIRESIDUE
$FIXEDTOASCIIRESIDUE converts the absolute value of a FIXED value to a string of
ASCII-coded, base-10 digits, and stores the result in memory.
$FIXEDTOASCIIRESIDUE also returns the residue.
Note. In TNS processes, the CQA operator alters the condition code based on the initial value
of qvalue. $FIXEDTOASCII does not set the condition code.
Figure 18-6. TAL Code Equivalent to $FIXEDTOASCII Routine
STACK qvalue, bufferaddr, maxdigits;
CODE(CQA);
Example 18-17. Call to $FIXEDTOASCII Routine
LITERAL buffer_len = 100;
FIXED val;
STRING .buffer[ 0:buffer_len - 1 ];
$FIXEDTOASCII(val, @buffer, buffer_len);
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW Yes
$FIXEDTOASCIIRESIDUE (
qvalue
,
bufferaddr
VST618.vsd
qresidue ) ;maxdigits ,,