By the way, I had to make a correction to the buffer xoring routine earlier. The value returned after storing a 2 byte number to an address is the address plus one. So only one a +1 is required to get to the next byte.
I cannot make the repeater loop (one argument for loop) work with a variable. The reason is that the registers that are used as counters in the loop change depending on the the number of times to loop for maximum optimization. If you don't know the value ahead of time, the parser can't know which method to use, and you end up forcing a more unoptimized one to account for this. Also, you wouldn't be able to bring in a value into the loop, like in my example, unless I add some extra code to it. Lastly, the format of the loop counter's register is NOT the same as the number of loops that need to be made. I would have to include code to convert the value into the right format. This is done at compile time for constants so conversions aren't needed at runtime. Add all of these extra bytes together, and you get code that is just as big as a regular for loop.
I could add it anyway because it would still be slightly faster than a typical for loop, but you certainly lose any size optimization.