For the max subroutine, you are to use R0 and R1 for the parameters to compare, and return the larger number in the accumulator A. The main program keeps calling the max function several times with different test cases. Instead of you having to manually step through each case, your code should compare the return value with your expected value and keep track of which test case you are on (using the local variable t, to be implemented with the register R2). On the first failed case, jump to the label Error; else keep testing until you hit the Success infinite loop.
Why loop forever like this? because when you simulate it, it goes by very fast and you don’t want to have to step through each case each time. So, just have the simulator run. You can observe the program counter (PC), which will stay at one of the two loops. You can take a look at the register R2 in the simulator’s window. If you have three test cases and all three pass, then R2 should show 3. Otherwise, R2 has the value of the first test case that failed.
For call and return, use the ACALL instruction to call a function with the target label, and RET instruction to return.
If you have to jump, you can use SJMP for short jump.
For comparison, you can subtract using the SUBB instruction. If a borrow is required, then the C (carry flag) is set. Then, you can use the JC or JNC instruction (jump if carry bit / not carry bit) to do the right thing.