pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
uINT:variable
the maximum number of 16-bit words to scan at srcaddr. At the end of the operation,
maxwords contains:
• 0 if $COUNTDUPS scanned the entire buffer.
• The number of words $COUNTDUPS did not scan because it found a nonduplicate
pair.
maxwords must be an INT variable; it cannot be a STRING, UNSIGNED, or USE variable
or a bit field.
duplicationcount
input,output
uINT:variable
holds an initial value. At the end of the operation, duplicationcount contains its
original value plus the number of duplicate words found by $COUNTDUPS.
duplicationcount must be an INT variable; it cannot be a STRING, UNSIGNED, or
USE variable or a bit field.
$COUNTDUPS scans a buffer from left to right until it encounters two adjacent unequal words or
until it reads maxwords words.
Example 242 $COUNTDUPS Routine
LITERAL buffersize = 100;
INT .EXT buffer[ 0:buffersize-1 ];
INT maxwords;
INT duplication_count;
maxwords := maxbuff;
$COUNTDUPS(@buffer, maxwords, duplication_count);
$DBL
$DBL converts its argument to an INT(32) value.
NopTAL privileged procedure
NoCan be executed only by privileged procedures
NoSets condition code
NoSets $CARRY
Yes, if expression is a fixed valueSets $OVERFLOW
expression
is an expression whose value is an INT, INT(32), FIXED, REAL, REAL(64), UNSIGNED(1-16),
UNSIGNED(17-31), EXTADDR, or PROCADDR value.
300 Built-In Routines