2 Modify the program whats so that it takes two arguments If

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

Solution

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

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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site