Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9.5 SELF-REVIEW QUESTION Suppose that $to contains the starting address of an array of 3 words. The following MIPS program returns in $t1 the sum

image text in transcribed

9.5 SELF-REVIEW QUESTION Suppose that $to contains the starting address of an array of 3 words. The following MIPS program returns in $t1 the sum of all elements of the array. Write a complete program and test it in SPIM simulator. main: lw $t2, 0($t0) + loads the first component of the array to $t2 lw $t3, 4($t0) add $t1, $t2, $t3 # sum the first two components of the array lw $t2, 8($t0) add $t1, $t1, $t2 # sum the third component sw $t1, 12 ($t0) # store the results Using the trace table below, specify the registers and memory content after execution of the above instructions. Instruction Data register $t1 $t2 Memory 4($to) 8($t0) $to $t3 0($t0) 12 ($t0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sybase Database Administrators Handbook

Authors: Brian Hitchcock

1st Edition

0133574776, 978-0133574777

More Books

Students also viewed these Databases questions