USR() function to sort BASIC string array

For posting library code and examples.
Post Reply
MarkTheStrange
Posts: 20
Joined: Sat Nov 26, 2022 6:24 pm

USR() function to sort BASIC string array

Post 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
Attachments
POKEDEMO.PRG
(2.75 KiB) Downloaded 54 times
shellsort.zip
Archive of source and executable code
(485 KiB) Downloaded 62 times
Post Reply