The value returned by the factorial program was hard to read. We now present a utility which takes a long integer n and returns a string representing n with commas inserted into the correct positions. Table
9-1 shows the algorithm. We use the temporary register r10 to keep track of whether a non-zero quotient has been found. Nowhere else in the program is r10 used, so there is no difficulty in using it as a temporary variable. This means that your program doesn’t need to save and restore r10. Listing ...