diff --git a/stdlib.asm b/stdlib.asm index bcbe300..329c67b 100644 --- a/stdlib.asm +++ b/stdlib.asm @@ -700,13 +700,14 @@ ret stx n qsort start csubroutine (4:base,4:count,4:size,4:compar),0 - phb - phk - plb lda count nothing to do if count is 0 ora count+2 beq done + + phb + phk + plb dec4 count set count to the addr of the last entry mul4 count,size add4 count,base @@ -717,12 +718,13 @@ qsort start lda compar+1 sta jsl1+2 sta jsl2+2 + plb + ph4 = *last -sr3 ph4