Write the MIPS assembly code for the following C instructions: B[2j] = A[3] + A[21] +...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the MIPS assembly code for the following C instructions: B[2j] = A[3] + A[21] + A[41] - #3 Assume i and j are preloaded into $s0 and $s1 respectively. Base address of arrays A and B are preloaded into $s2 and $s3 respectively. Obtain the address and data of B[2j] for the instruction if: $S0 = 1 $s1 = 20 $s2 = 8000 $s3 = 4000. Note: Address is 32-bit => the MSB after 16 bit address shown are all zeroes. Data size is 8-bit for each address location but in the table we have each address corresponds to 4 address location to make it 32-bit size data. We also padded zeroes to the MSB of data. Assume data in the table is in hexadecimal. 8000 11 8004 AB 8008 2C 8012 1D 8016 11 8020 AB 8024 2C 8028 1D 8032 11 8036 AB 8040 2C 8044 1D 8048 11 8052 AB 8056 2C 8060 1D 8064 11 8068 AB 8072 20 8076 1D 8080 11 Write the MIPS assembly code for the following C instructions: B[2j] = A[3] + A[21] + A[41] - #3 Assume i and j are preloaded into $s0 and $s1 respectively. Base address of arrays A and B are preloaded into $s2 and $s3 respectively. Obtain the address and data of B[2j] for the instruction if: $S0 = 1 $s1 = 20 $s2 = 8000 $s3 = 4000. Note: Address is 32-bit => the MSB after 16 bit address shown are all zeroes. Data size is 8-bit for each address location but in the table we have each address corresponds to 4 address location to make it 32-bit size data. We also padded zeroes to the MSB of data. Assume data in the table is in hexadecimal. 8000 11 8004 AB 8008 2C 8012 1D 8016 11 8020 AB 8024 2C 8028 1D 8032 11 8036 AB 8040 2C 8044 1D 8048 11 8052 AB 8056 2C 8060 1D 8064 11 8068 AB 8072 20 8076 1D 8080 11
Expert Answer:
Answer rating: 100% (QA)
MIPS assembly instructions LW Load word This instruction load the value from the effective address o... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The first and last term of an arithmetic series is given as well as the common difference. Determine the number of terms in the series and the sum of the series. a = 100 tn = - 100 d = - 10
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Cache memories are usually implemented in a static RAM technology. Main memories are usually dynamic RAM. Why does it still make sense to have multiple cache levels when they are implemented in the...
-
How does Philip Morris handle the sensitive issues associated with marketing tobacco? What kind of information does its web site at http://www.philipmorris.com/ provide about smoking and its negative...
-
You recently began a job as an accounting intern at Rocky Adventures. Your first task was to help prepare the cash budget for February and March. Unfortunately, the computer with the budget file...
-
Mega Nutrition has offered \($275\) million cash for all of the common stock in Andro Steroid Corporation. Based on recent market information, Andro Steroid is worth \($210\) million as an...
-
Identify several nonquantitative factors that are apt to play a decisive role in the final selection of projects for capital expenditures.
-
Fred, our cat, just won the local feline lottery to the tune of 3000 cans of "9-Lives" cat food (assorted flavors). A local grocer offers to take the 3000 cans and in return, supply Fred with 30 cans...
-
[The following information applies to the questions displayed below.) During April, the first production department of a process manufacturing system completed its work on 355,000 units of a product...
-
Suppose that the two-dimensional vectors (X1, Y1), (X2, Y2), . . . , (Xn, Yn) form a random sample from a bivariate normal distribution for which the means of X and Y, the variances of X and Y , and...
-
Capital City Hotel's restaurant is open for breakfast, lunch and dinner. The accountants prepared a segmented contribution margin income statement for the past year based on the three meal periods as...
-
At the end of its current period, a company's overhead was underapplied by $15,000. What should the company do to record this underapplication of overhead?
-
Vincent has also been working with Jennifer to sell her rental property and to buy a new house in a nearby suburb. Vincent's real estate agency manages the property on behalf of Jennifer and collects...
-
(2) Write Java code to prompt the user for the starting number to print (e.g. 5) and output rectangular pattern below: Use nested for-loops. Enter the value of n: 5 5 5 5 5 5 5 555 5 4 4 4 4 4 4 4 5...
-
Raymond Supply, anational hardware chain, is considering purchasing a smaller chain,Strauss & Glazer Parts (SGP). Raymond\'s analysts project thatthe merger will result in the following free cash...
-
For each of the following events, determine whether the event cause An increase in demand (a rightward shift) A decrease in demand (a leftward shift) A decrease in quantity demanded (a movement up...
-
If the government introduced a policy that was widely viewed as being able to reduce the future uncertainty in the stock market by requiring more transparency in accounting principles, what effect...
-
What key concerns must functional tactics address in marketing? Finance? POM? Personnel?
-
Solve Prob. F811 using Castiglianos theorem. Data from Prob. F811 Determine the vertical displacement of joint C. AE is constant. Use the principle of virtual work. A -2m- H B 30 kN 2 m G 4000 C -2m-...
-
Solve Prob. F713 using the conjugate-beam method. Data from Prob. F713 Use the moment-area theorems and determine the slope at A and displacement at C. EI is constant. A 3 m- C 8 kN Probs. F7-13/14 3...
-
Determine (approximately) the internal moment and shear at the ends of each member of the portal frame. Assume the supports at A and D are (a) Pinned, (b) Fixed and (c) Partially fixed such that the...
-
Why do buyers involved in straight rebuy purchases require less information than those making new-task purchases?
-
Why might business customers generally be considered more rational in their purchasing behavior than ultimate consumers?
-
Tejada Corporation incurred the following transactions. 1 I'm chased raw materials on account $46,300. 2. Raw materials of \($36,000\) were requisitioned to the factory. An analysis of the materials...
Study smarter with the SolutionInn App