Page 1 of 1

USR() function to sort BASIC string array

Posted: Sat Aug 24, 2024 5:17 am
by MarkTheStrange
This is an implementation of Shell's sort designed to be called via USR() from CBM BASIC. In my testing it sorted 100 words in 3 jiffies, and 1000 in under a second.

The argument should be the address of the array's first element:

Code: Select all

X=USR(POINTER(A$(0))) 
There's a loader program which can be assembled and run to install the handler into golden RAM and point the USR vector to it; there's also a ready-to-go binary file (SHELLSORT.BIN) which can be BLOADed directly (you still have to point the USR vector at $0311-$0312 to it manually).

Try It Now!

Image