Annotation of researchv10dc/dist/man/v3/man3/compar.3, revision 1.1.1.1

1.1       root        1: .pa 1
                      2: .he 'COMPAR (III)'1/15/73'COMPAR (III)'
                      3: .ti 0
                      4: NAME           compar -- default comparison routine for qsort
                      5: .sp
                      6: .ti 0
                      7: SYNOPSIS       jsr pc,compar
                      8: .sp
                      9: .ti 0
                     10: DESCRIPTION    Compar is the default comparison routine
                     11: called by qsort and is separated out so that the user can
                     12: supply his own comparison.
                     13: .sp
                     14: The routine is called with the width (in bytes) of
                     15: an element in r3 and it compares byte-by-byte the element
                     16: pointed to by r0 with the element pointed to by r4.
                     17: .sp
                     18: Return is via the condition codes,
                     19: which are tested by the instructions "blt" and "bgt".
                     20: .a
                     21: That is, in the absence of overflow, then the 
                     22: condition (r0) < (r4) should leave the Z-bit off and N-bit
                     23: on while (r0) > (r4) should leave Z and N off.
                     24: Still another way of putting it is that  for elements
                     25: of length 1 the instruction
                     26: 
                     27:        cmpb    (r0),(r4)
                     28: 
                     29: suffices.
                     30: .sp
                     31: Only r0 is changed by the call.
                     32: .sp
                     33: .ti 0
                     34: FILES          kept in /lib/liba.a
                     35: .sp
                     36: .ti 0
                     37: SEE ALSO       qsort (III)
                     38: .sp
                     39: .ti 0
                     40: DIAGNOSTICS    --
                     41: .sp
                     42: .ti 0
                     43: BUGS           It could be recoded to run faster.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.