pTAL Reference Manual (H06.08+)

Built-In Routines
HP pTAL Reference Manual523746-006
15-33
$COUNTDUPS
$COUNTDUPS
$COUNTDUPS returns the number of consecutive words, starting at the beginning of a
buffer, that are equal to the first word in the buffer.
srcaddr input,output
EXTADDR:variable
an address. Starting at srcaddr, $COUNTDUPS scans 16-bit words until it
encounters two adjacent words that are not equal. At the end of the operation,
srcaddr points to the word that differs from the first word and which,
therefore, terminated the scan. If there are no duplicates in the buffer,
srcaddr points immediately after the last two words it comparedthat is, at
the first word $COUNTDUPS did not examine.
maxwords input,output
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.
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
,
) ;
VST614.vsd
($COUNTDUPS
,
duplicationcount
scraddr
maxwords