Question: The MIPS code shown is a compilation the C statement A[8]=h+A[8] assuming that the starting address of array A is stored in $s3 and the
The MIPS code shown is a compilation the C statement "A[8]=h+A[8]" assuming that the starting address of array A is stored in $s3 and the value of h is stored in $s2. Rewrite the MIPS code to add h to all the elements of A assuming that its size is stored in $s1. That is $s1 stores the number of elements (32-bits integers) in array A.
![The MIPS code shown is a compilation the C statement "A[8]=h+A[8]" assuming](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66ef438e12c9d_42966ef438d98ef1.jpg)
C code: A[8] h + A[8]; = MIPS code: 2 // load word lw t0, 3 add $t0, $s2, $t0 sw $t0, 32 ($s3) // store word (Ss3) memorY registers Load from memory to register 01 $to $s2 Value of h $s3 Address 8 words = 32 bytes A[8] Array A Address+32
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
