|
|
1.1 ! root 1: .th COMPAR III 1/15/73 ! 2: .sh NAME ! 3: compar \*- default comparison routine for qsort ! 4: .sh SYNOPSIS ! 5: .ft B ! 6: jsr pc,compar ! 7: .ft R ! 8: .sh DESCRIPTION ! 9: .it Compar ! 10: is the default comparison routine ! 11: called by \fIqsort\fR and is separated out so that the user can ! 12: supply his own comparison. ! 13: .s3 ! 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: .s3 ! 18: Return is via the condition codes, ! 19: which are tested by the instructions ``blt'' and ``bgt''. ! 20: That is, in the absence of overflow, the ! 21: condition (r0) < (r4) should leave the Z-bit off and N-bit ! 22: on while (r0) > (r4) should leave Z and N off. ! 23: Still another way of putting it is that for elements ! 24: of length 1 the instruction ! 25: .s3 ! 26: cmpb (r0),(r4) ! 27: .s3 ! 28: suffices. ! 29: .s3 ! 30: Only r0 is changed by the call. ! 31: .sh "SEE ALSO" ! 32: qsort (III) ! 33: .sh BUGS ! 34: It could be recoded to run faster.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.