 This time, we're going to look at building our own custom functions. So this is the counterpart to a calling a function. And again, it's actually not that complex. Most of the complexity comes into writing the code that goes into the function. In some ways, this can actually be simpler than writing a function in a high level language. We don't need to come up with a function header, though it would be nice to put that in a comment so that anybody that wants to use their function will know what parameters it needs and what it's going to return. But the basic structure of our function is really simple. We really just have a function name and an instruction to return. So the function name label tells our machine what the name of our function is. It allows other pieces of code to call this function, and it can pretty much be whatever you want. It just needs to be a unique name. Preferably something that indicates what your function does. Then inside the function, we have all the code that you might want to write to do whatever this function needs to do. And then we have this JR $RA instruction. This function is like the return operation in most high level languages. So this is the jump register instruction. And what this does is it tells the machine to jump to a different line of code. And it's going to go to the one that's specified by some register. In this case, the $RA register. If you remember from when we were making the function call, we used the jump and link instruction. Part of what the jump and link instruction does, that it updates the $RA register with the value of that next instruction. So the jump and link instruction tells your function where you should return to when you're done running your code. So jump register instruction tells the machine, okay, I'm done running my code. My caller said I should go back here when I'm done, so there you go. Now the only other thing we have to worry about are where we put our parameters and our results. And as before, we expect our parameters to be in A0 through A3. Because many registers as you need, try to write down what you expect in each register. Comments are very helpful for this. And then when you're done, put your results in V0 and V1. Let your caller can access those results itself. So the basic structure of a function is actually pretty simple. And most of the complexity goes into what you're actually doing inside that function.