Given an array of four integers, write a program that populates a new array with the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Given an array of four integers, write a program that populates a new array with the square of the elements in the given array. Assume $s0 stores the memory location of the first element of the given array, and $s1 stores the memory location of the first element of the new array. Hint: Each memory address is incremented by 4 due to the size of an integer stored in the memory. Ex: If $s0 and $s1 are initialized in the simulator as 4000 and 5000, and the content of the given array is: then the content of the new array is: Addresses Data 4000 4004 4008 4012 5004 5008 1 5012 2 Addresses Data 5000 3 4 1 4 9 16 Note: Use the '+' button under the Registers and Memory display to initialize $s0, $s1, and the four memory locations of the given array. LAB ACTIVITY 7.4.1: Module 3 Lab: Array of squares - Iw/sw Assembly Line 1 # Type your code here. Line 2 # Do not initialize $s0 and $s1 here. Line 3 # Use the button under the Register di Line 4 ENTER SIMULATION More options v Submit for grading Coding trail of your work What is this? STEP RUN Registers Each has value 0 + Memory Each has value 0 + 0/10 Load default template... Given an array of four integers, write a program that populates a new array with the square of the elements in the given array. Assume $s0 stores the memory location of the first element of the given array, and $s1 stores the memory location of the first element of the new array. Hint: Each memory address is incremented by 4 due to the size of an integer stored in the memory. Ex: If $s0 and $s1 are initialized in the simulator as 4000 and 5000, and the content of the given array is: then the content of the new array is: Addresses Data 4000 4004 4008 4012 5004 5008 1 5012 2 Addresses Data 5000 3 4 1 4 9 16 Note: Use the '+' button under the Registers and Memory display to initialize $s0, $s1, and the four memory locations of the given array. LAB ACTIVITY 7.4.1: Module 3 Lab: Array of squares - Iw/sw Assembly Line 1 # Type your code here. Line 2 # Do not initialize $s0 and $s1 here. Line 3 # Use the button under the Register di Line 4 ENTER SIMULATION More options v Submit for grading Coding trail of your work What is this? STEP RUN Registers Each has value 0 + Memory Each has value 0 + 0/10 Load default template...
Expert Answer:
Answer rating: 100% (QA)
The provided images suggest that you are working in a simulation environment for coding in assembly language and your task is to write a program that ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
Solve the equation in the complex number system. x-16x+89=0
-
Aneko Company reports the following ($000s): net sales of $14,800 for 2018 and $13,990 for 2017; end-of-year total assets of $19,100 for 2018 and $17,900 for 2017. Compute its total asset turnover...
-
Ethics Case Stephen Murphy owned Intertie, a California company that was involved in financing and managing cable television stations. Murphy was both an officer of the corporation and chairman of...
-
How does the doctrine of commercial impracticability attempt to balance the rights of both parties to a contract?
-
The Easy Finance Company has 3,000 loans outstanding at a recorded total book value of \(\$ 960,000\). As the auditor on this engagement, Mary Jones selects a sample of 300 loans for vouching. These...
-
Duncan Company reports the following financial information before adjustments. Instructions Prepare the journal entry to record Bad Debt Expense assuming Duncan Company estimates bad debts at (a) 1%...
-
Identify the sentences as: Simple Present, Present Continuous (Progressive), Simple Past, Past Continuous (Progressive), or Future Tense. It should have at least three different subjects and three...
-
GigaCo. manufactures 1-GB flash drives (jump drives). Price and cost data for a relevant range extending to 200,000 units per month are as follows: Sales price per unit (current monthly sales volume...
-
First, read the following excerpt from a short story titled: "Eyes of a Blue Dog" by Gabriel Garcia Marquez. "Eyes of a Blue Dog" by Gabriel Garcia Marquez I saw her walk over to the dressing table....
-
Harry and Meghans (H&Ms) is Canadas largest producer and exporter of maple syrup. Their operations are expanded, so they need to invest in more bottling equipment. Three different models are...
-
Calculate the total frequency in each table below. . Calculate the percentage in each category per table. Calculate the total percentage in each table. Cre.ate a chart each table using the...
-
Solve for the minimum cost using transportation method and computation for improvement. I X Y Z Demand 1 20 10 5 4 3 2 15 3 3 3 3 10 3 3 4 Supply 12 13 20
-
What security will he most likely be able to sell at the day? 2. At what price will the bank buy that security from him? 3. At what price will he be able to sell it to the bank? 4. At what...
-
Use the CAPM to find the required return for asset X and Y. Asset X: Year 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 Cash Flow $1,000 $1,500 $1,400 $1,700 $1,900 $1,600 $1,700 $2,000 $2,100...
-
The accompanying table describes probabilities for the California Daily 4 lottery. The player selects four digits with repetition allowed, and the random variable x is the number of digits that match...
-
What is the expected payoff of an investment that yields $5,000 with a probability of 0.15 and $500 with a probability of 0.85? Select one: O a. $325 O b. $5,500 O c. $2,750 O d. $1,175
-
The airplane shown is flying at a constant speed of v = 50 m/s in a circular path of radius P = 2000 m and is being tracked by a radar station positioned a distance h = 500 m below the bottom of the...
-
The overall grade in a course is determined from the grades of 6 quizzes, 3 midterms, and a final exam, using the following scheme: Quizzes: Quizzes are graded on a scale from 0 to 10. The grade of...
-
The dot product can be used for determining the angle between two vectors: Use MATLAB's built-in functions acosd, sqrt, and dot to find the angle (in degrees) between r1 = 6i - 3j + 2k and r2 = 21 +...
-
(a) A company uses a process costing system in which the following terms arise: conversion costs work-in-process equivalent units normal loss abnormal loss. Required: Provide a definition of each of...
-
(a) Explain briefly the term joint products in the context of process costing. (b) Discuss whether, and if so how, joint process costs should be shared among joint products. (Assume that no further...
-
Define joint costs, split-off point and further processing costs.
Study smarter with the SolutionInn App