 For this example, I'm going to walk through the power function. As you can see on the left hand side, I've got all the code for my power function, as well as some driver code. And on the right hand side, I have my memory. At the moment, it's still fresh and clear, but we'll be adding new stuff to it. The first instruction that the machine will run is line 15, where it says put 5 into A0. So I'll put a 5 in A0. Line 16 says put 3 in A1. Line 17 says jump in link to power. Power is line 1. And I need to set my return address to be the next instruction after the jump in link, which is line 19. Now I'm up at line 1, where it says if A1 does not equal 0, then go to recursion. A1 is 3, so I'm down at line 5 now. Line 5 says take the stack pointer and move it down 4. So I'm going to take this arrow that I've got, and I'm going to move it down one spot. So now I've got some space on my stack. Line 6 says take the return address and store it at stack pointer plus 0. So in that space that we just made, I'm going to copy what's in the return address, which was pointing at line 19. Next, line 7 says to subtract 1 from whatever's in A1. So that's now 2. And it says to go jump in link to power. So power is line 1, and I need to set my return address, and it will get the address of the next line, which is line 9. Back at line 1 says if A1 is not equal to 0, then go to recursion. So I'll go down to line 5, and I'm going to move my stack pointer again. So I'll move my stack pointer down one more spot. And it says store the return address at stack pointer plus 0. So return address now says line 9. So that's what I'll put in there. Then I'll subtract 1 from A1, and then I'll jump in link to power. So I need to go down and set my return address to be the next instruction, which would be line 9. And then I'll start running again from line 1. A1 is not equal to 0, so I will go to recursion. Where it says move the stack pointer down again. So there's my stack pointer now. Next it says store the return address at stack pointer plus 0. So I'll put in a reference to line 9 there. Line 7 says subtract 1 from A1. So A1 is now 0. And then jump in link to power. So I changed my return address to at the next line, which is line 9. And I go back to line 1. This time A1 is equal to 0, so I won't go to recursion. I'll just go to line 2, which says to go to V0 and put a 1 in there. Then I go back to the return address. So my return address says line 9, so I'm going to go down here to line 9. Where it says multiply A0 times V0 and store the result in V0. So A0 is 5, V0 is 1, and I will put a 5 in V0. Next it says go to stack pointer plus 0 and read the value of the return address. So this value here is referencing line 9. So I'm going to come down here and put line 9 into my return address. Then I'm going to move my stack pointer up 4 bytes. And then I go to my return address. My return address says line 9. So I'm back at line 9, which says multiply A0 by V0 and store the results in V0. So 5 times 5 is 25, so I put 25 in there. Then I go over to stack pointer plus 0, which is here. And it says copy this value into the return address. So down here I set the return address to be line 9 again. Next I move the stack pointer up 4 bytes. Then I go to the instruction referenced by my return address. So back at line 9 it says multiply A0 by V0 and store the results in V0. A0 is 5, V0 is 25. 5 times 25 is 125. Line 10 says go to my stack pointer plus 0, read that data and store it into my return address. So this time stack pointer plus 0 is pointing at first element, which says line 19. So I put line 19 into my return address. I then deallocate that part of my stack. And then it says go to the instruction referenced by the return address. So now I'm down at line 19, which says copy the results of V0 into A0. So I'm going to copy the 125 and put that in A0. Now it says put a 1 in V0 and the syscall would make it print out the value 125. Then I would put a 10 in V0 and the syscall would have this program quit.