Due October 17, 2008

The goal of this lab is to practice more advanced assembly language
programming skills, in particular, the use of stack frames to support
recursion.

In particular, you will write an assembly language program that
generates a tree-recursive process for solving a classic mathematical
recreation, the “Towers of Hanoi” puzzle. This puzzle has three
pegs, numbered as pegs 1, 2, and 3, and n disks, labeled as disk 1
through disk n. (The number n can vary; typical values might be in
the range from 1 to 8.) Disk 1 is smaller than disk 2, which is in
turn smaller than disk 3, and so forth, with disk n being the
largest. Initially all the disks are on peg 1, starting with disk n
on the bottom, disk n-1 on top of that, and so forth, up to disk 1
on the top. The goal is to move all the disks to peg 2. You may only
move one disk at a time: the top disk from any of the three pegs onto
the top of either of the other two pegs. Moreover, there is a
constraint: you must not place a larger disk on top of a smaller.

Your lab write up can be short and sweet, but it should be English.
Specific details I will expect to see are the program you are
asked to write, a description of how you tested your program (and/or
test data and results) from the program. A few carefully chosen tests
should be used to ensure all cases are covered and all likely bugs are
exposed. Naturally, there is no reason to include any test which you
haven't checked for correctness; that would just run (and not
test) the program.

You will again use Xspim, as in lab 1.

The following is a Scheme version of the program you need to write; it
prompts for and reads in n and then prints out a list of the
necessary disk movements: