Ugh...
Okay. An iterative loop:
while (x) {
do y;
} (hold memory in z for next iteration)
Now, since you're using a bounded amount of space for z, you can imagine that all the information in z is held in a struct.
Tail recursion:
function tail (input, z) {
if (done) return answer;
else tail (input for next iteration, z for next iteration)
}
When you do the recursive call, all the information required is in the arguments, and you can drop everything else, thus using the same stack area.