This one is functionally identical to the one included with the Life program, but is streamlined by eliminating the need for the temporary variable .3, and thus should run significantly faster. The program itself uses my best effort towards passing a routine as an argument to another routine. You could also use this bubble sort to sort 32 bit arrays, for example, or to sort arrays in the opposite order, or to sort arrays starting at some index other than 1. The bubble sort expects .1 to contain the number of elements to be sorted, and proceeds to go through the necessary loops. When the bubble sort finishes its loops it jumps back to the main program using the return address which has been sitting on the bottom of the stack all this time.
Main program prints out results.
See how fast you can figure out how they work. It is used to work around a bug in the array implementation which prevents you from using two different subscripts on the same array in the same statement. Chances are this will be fixed before the array stuff is released, in which case .4 should be eliminated by folding the pairs of statements together in the obvious way.