Assembler Square Root and Sort
by Mark Moxon and David Beaumont

Running this application opens up a directory viewer containing two Basic programs, ArmSort and ISqrt.

ArmSort demonstrates an assembler routine to sort an array of integers into decreasing order. When the program is run, you will be asked for the number of elements to be sorted, and an array of random numbers is set up. First the ArmSort routine is called to sort the numbers, and then the same random array is sorted using the operating system call OS_HeapSort. Times are displayed for each sort.

ISqrt is an assembler routine that calculates the integer square root of any number. An integer square root of a number is the largest integer that is less than or equal to the square root of that number. Running this program will prompt you to enter any number; when one has been entered, the integer square root will be displayed. To terminate the program press Escape.

For details of how to incorporate these routines into your own programs, see the article in this month's magazine.

 RISC User 1992
