Write a mips assembly program

Assignment Help Computer Engineering
Reference no: EM131306124

1. Convert the following C function to the corresponding MIPS assembly procedure: 

int count(int Model[], Color[], Year[], int n, intx,y,z)

{   int res = 0;

                inti = 0; 

for(i = 0; i != n; i++) 

                                if(Model[i] == x) {

if (Color [i] == y){              if (Year [i]== z){

                                                print "your car is in location [i]

                                                                                }

}

}

return [i]; 

2. Write a MIPS assembly program that will make use of the function count above as follows: 

Let's assume you are asked to code a car-finding system for a local parking lot: 

You are provided with the location of all the cars in the parking lot. The information is given to you in three arrays. Each array contains specific information about the cars. The first array contains the model of the car, the second array the color and the 3rd array the model.

 

1

2

3

4

5

6

7

8

9

....

Model

 

 

 

 

 

 

 

 

 

 

Color

 

 

 

 

 

 

 

 

 

 

Year

 

 

 

 

 

 

 

 

 

 

To find the location of the car you need to find the location that matches the Model, color and year.  

Model

Code

Ford

1

BMW

2

Audi

3

Honda

4

Infinity

5

Hyundai

6

Toyota

7

 

Color

Code

Black

1

Blue

2

Yellow

3

Red

4

Gray

5

White

6

Green

7

Silver

8

You are asked to:

  • Hard code the values for each of the arrays
  • Prompt the user to enter 3 values as follows: "Please enter the code for the Model, the Color, and the year of your car"
  • Read the integer values and store them
  • Use the function count as a base to elaborate your code and navigate through the arrays
  • Identify where in the parking lot the car is located, or if the car is not in the parking lot.
  • Output the results as follows: If the car was found "Your car is located on Position [name]". If the car was not found "We apologize for the inconvenience, your car is not in this parking lot". Exit the program

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Model

2

3

4

5

6

6

7

3

4

3

3

3

3

1

Color

2

4

6

8

7

5

3

1

2

3

1

4

5

6

Year

2001

2003

2006

2010

2012

2013

2013

2014

2006

2007

2005

2009

2009

2010

 

 

15

16

17

18

19

20

21

22

23

24

25

26

27

28

Model

2

1

1

1

5

7

7

7

6

5

3

3

2

2

Color

7

8

7

5

3

1

2

3

5

7

8

3

5

1

Year

2010

2013

2014

2014

2015

2016

2005

2007

2008

2008

2010

2001

2003

2004

 

 

29

30

31

32

Model

1

1

6

6

Color

3

5

7

8

Year

2005

2007

2013

2015

Reference no: EM131306124

Questions Cloud

How sampsons credit card decisions are related to budget : Advise the Sampsons on whether they should continue making minimum payments on their credit card or use money from their savings to pay off the credit balance.
Find the first and the last address in the last subnet : An organization is granted the block 130.56.0.0/16. The administrator wants to create 1024 subnets.
The implementation of the sarbanes–oxley act : Analyze the changes made to corporate governance rules since the implementation of the Sarbanes–Oxley Act of 2002. Based on your analysis, formulate an opinion on whether or not these changes are sufficient in preventing financial fraud.
Pros and cons of various types of financial institutions : Assuming that you could convince Brad to maintain checking, savings, and retirement accounts, discuss the pros and cons of various types of financial institutions.
Write a mips assembly program : Write a MIPS assembly program that will make use of the function count above as follows: Let's assume you are asked to code a car-finding system for a local parking lot: You are provided with the location of all the cars in the parking lot. The infor..
Compare nat and dhcp : Compare NAT and DHCP. Both can solve the problem of a shortage of addresses in an organization, but by using different strategies.
Maximum and minimum child and dependent care tax credit : Cindy and Glenn are married taxpayers who file a joint return. Both Cindy and Glenn work. During 2014, they had three young children for whom they paid $10,000 of qualifying child care expenses. What is the maximum and minimum child and dependent car..
Should brad consider shopping for a new credit card : Based on his projected annualized return, would it be advisable to sell the stocks to pay off his credit card?- Should Brad consider shopping for a new credit card?
How is the packet routed to its final destination : Assume router R2 in Figure 18.35 receives a packet with destination address 140.24.7.42. How is the packet routed to its final destination?

Reviews

len1306124

12/9/2016 2:14:23 AM

What to submit only the code for problem number 2. During the assessment day, you will be asked to download the file you submitted in blackboard, and we will proceed to assemble and execute it to test for proper coding. Nothing else should be submitted (e.g., as mentioned, no report is required). Programs that cannot be assembled may result in an automatic grade of 0. In addition to the submission of your solution, you will also be required to provide a “live demo and explanation” of your solutions. Failure to provide either of them will result in a grade of 0 even if you submitted your solution. Solutions to the following questions are to be submitted and must be shown (live demo) during lecture time on August 6th. Both questions are equally weighted.

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd