 In our previous video, we saw that our architecture provides comparisons for equality. We can test to see whether two registers are equal or not equal, but all of those instructions that allowed us to say whether one value was greater than another value were actually pseudo-instructions. So this time, we're going to look at how the assembler actually implements those. And the way those work is that we have a set less than and a set less than immediate instruction. We can use those in combination with the equality tests. The way these instructions work is that if my first parameter is less than my second parameter, then it's going to put the value of one into an output register. So if I have, say, set less than T0, T1, T2, you would compare the value in T1 to the value in T2. And if T1 is less than T2, it sets T0 to 1. If T1 is equal to T2, or is greater than T2, then T0 gets set to 0. We can then do a test for equality on T0 and see whether it's equal to 0 or 1. This is one case where having 0 in a register already comes in really handy. We can just compare results of T0 to $0 and make our determination based on that. But all the architecture actually gives us is the set less than instruction. We don't actually get things like set greater than or set less than or equal to. If we want any of those, we actually have to build it from the set less than instruction and the branch equals or branch not equals instructions. So the way that usually happens is by reorganizing the comparison we actually want to do into something that we know how to do. For example, if I want to know if a is greater than b, well, that's really the same as saying is b less than a. So I've flipped my relationship around really just by changing the order of the parameters. But now I can just use a set less than instruction to decide is b less than a. So if b is less than a, then I would set my output register to 1 and then that value is not equal to 0. If I want to know if a is greater than b, well, this is also like asking if a is not less than b. Because the only time that a greater than or equal to b is false is when a is actually less than b. The most complex case is when we want to know if a is less than or equal to b. We could break this down and do this in two parts. We could say is a less than b or is a equal to b. Or we can do transformations to get this into a case that we do know how to solve directly. So if a is less than or equal to b and a is not greater than b. But we can't implement the a greater than b directly. We've already seen how to solve that. We just flipped the order of the parameters around. So we ask, is it true that b is not less than a? If that condition turns out to be true, then that's the same as saying that a is less than or equal to b.