V3/usr/man/man3/compar.3

Find at most related files.
including files from this version of Unix.

.pa 1
.he 'COMPAR (III)'1/15/73'COMPAR (III)'
.ti 0
NAME		compar -- default comparison routine for qsort
.sp
.ti 0
SYNOPSIS	jsr pc,compar
.sp
.ti 0
DESCRIPTION	Compar is the default comparison routine
called by qsort and is separated out so that the user can
supply his own comparison.
.sp
The routine is called with the width (in bytes) of
an element in r3 and it compares byte-by-byte the element
pointed to by r0 with the element pointed to by r4.
.sp
Return is via the condition codes,
which are tested by the instructions "blt" and "bgt".
.a
That is, in the absence of overflow, then the 
condition (r0) < (r4) should leave the Z-bit off and N-bit
on while (r0) > (r4) should leave Z and N off.
Still another way of putting it is that  for elements
of length 1 the instruction

	cmpb	(r0),(r4)

suffices.
.sp
Only r0 is changed by the call.
.sp
.ti 0
FILES		kept in /lib/liba.a
.sp
.ti 0
SEE ALSO	qsort (III)
.sp
.ti 0
DIAGNOSTICS	--
.sp
.ti 0
BUGS		It could be recoded to run faster.