 This time we're going to be building a program that can just output some integers for us. As before, we'll begin with a main label to tell QTSPim where we'd like our code to start. In order to print out an integer, we'll need to use system call number 1. So I'll start by putting 1 into v0. Next, I need to put the number that I'm interested in printing into a0. So I'll put 17 into a0. Now I can use the syscall operation, which should print out the value of 17 for me. If this is the only thing I want to do, then I just need to quit my program by using system call number 10. So if I come over to QTSPim and I run this, you can see that yes, it does indeed print out the number 17. If I'd like to do some more integer outputs, then I can string them up similar to what I did with these strings. Now when I run this, you can see it prints out all three numbers, 17, 71, and 45, but they're kind of run together. If I'd like them to perhaps display on separate lines, make them easier to read, then I'll actually need to add a string in there in the middle. Then I'll actually need to add a string in between each of those integers. So I'll insert the same code that we saw before for printing a string. I'll use system call number 4, and I will tell it about the string nl for new line. Then I call the system call operation. But now I've changed the value of v0. So I can't just set up a large set of these print integer operations. Instead I'll have to set the value of v0 back to 1 before I can print another integer. Now if I want to print another string, I'll have to set v0 back to 4. Then I can load in the address of the new line character and print that out. But now I also have to put 1 back into v0 so I can print the third integer. Now if I run this program, it prints 17, 71, and 45, each on their own line. So I've got three blocks, each of which is capable of printing out one integer for me. When I didn't modify v0 between the system calls, I was able to just reuse that value. But once I added in the request to print a string in between two print integer operations, I had to remember to set the value of v0 for each of those system calls. Otherwise it would still try to treat 71 as a string and would likely fail.