Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

main: fori:data .word 5 .text .

Plsss I need help in Computer Architecture.

1.) Run what.s (downloadable from "Assignment 2" on eLearning) in SPIM, examine some of the registers etc in the SPIM windows, and look in the code of what.s, and try to work out what it does. Check whether the program works if the argument is changed to 6, 1, 0, 10, 20, etc? Answer what the program does in one sentence

So the program computes the square of the argument.?? and yes it works for arguments 6,1,0,10,20?

2.) Modify 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. Give your new program a sensible name.

my guess would be to add another line of argument? like arg1: .word 10 ???    

3.) Enhance the program to allow it to receive the two arguments from the keyboard and display the result in the console window of SPIM. If any of the input arguments is a negative number (less than zero), your enhanced program should display a zero in the console.

I dont know

4.) You should store your enhanced program (only a SINGLE program for Parts 2 & 3) in one SINGLE file called "Ass2.s". At the top of the program, use comments (starting with "#") to write your name and also use comments to answer Part 1.

its due in 3 hours but I can still submit it tomorrow for point deduction..

#what.s program:

.dataarg:.word5.text.globl mainmain:la$t3, arglw$t2, 0($t3) lw$t3, 0($t3)addi$t1, $zero, 0beqz$t2, finfori:add$t1, $t1, $t2addi$t3, $t3, -1bnez$t3, forifin:li$v0, 10syscall
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question