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

5. (10pts) Loop in C: while (save[i] =-k) i+ 1 The MIPS assembly code correspond

ID: 3705098 • Letter: 5

Question

5. (10pts) Loop in C: while (save[i] =-k) i+ 1 The MIPS assembly code corresponding to the above C segment: *Temp reg $t1-4% # tl address of save [i] # Temp reg $t0 = save[i] # go to Exit if save [i]s k #i-i+1 #goto Loop loop: sll St1, Ss3,2 add Stl, Stl, Ss6 lw St0, 0(St1) bne St0, Ss5, Exit addi $s3, $s3, 1 j loop Exit: Assume that i and k correspond to register Ss3 and Ss5 and the base of the array save is in Ss6. Re-compile the same C segment into MIPS language and use ONLY ONE branch or jump each time through the loop 6. (5pts) Two lines from a MIPS program are listed below. Their corresponding addresses in memory in hexadecimal format are also included. (Note: a number begins with 0x is a hexadecimal number) Memory Address MIPS Code 0x00401230 bne $t2, $tl, NonEqua.l 0x00401240 NonEqual: add $tl, $sl, $t2 Based on the information above, with your knowledge about PC-relative addressing translate the first line into its machine code

Explanation / Answer

6)

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