Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. Modify the program what.s so that it takes two arguments. If the arguments ar

ID: 3793119 • Letter: 2

Question

2. Modify the program what.s so that it takes two arguments. If the arguments are both the same then the answer should be the same as that of what.s that takes only one argument. If they are different then you should figure out what your program should do based on the above. Try to make as few changes as possible.

The following is the program what.s...... which is a program which will computer the square of the argument. ( arg: .word 5 would output 25). My question is which modifications would I need in order take two arguments? Im thinking something along the ligns of adding another arg1: maybe?

#what.s is bellow

Explanation / Answer

To take two arguments you can use:

To check if the two arguments are equal and prform required action:

beq same,0($t0),0($t1)

#Do something when the two arguments are not equal.

#exit

same:

#Do the same as that of what.s

#exit

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote