Write a mips code that swaps the variables a and b

Assignment Help Computer Engineering
Reference no: EM131988113

Problem

The MIPS architecture supports byte and halfword (16-bit) memory transfer operations. The instructions are load byte (lb), load byte unsigned (lbu), store byte (sb), load halfword (lh), load halfword unsigned (lhu) and store halfword (sh).

Code: char a, b; //8-bit variables (a @ address 100) (b @ address 200)

Part a) Assuming 8-bit operations are supported (lb, lbu, sb), write a MIPS code that swaps the variables a and b.

Part b) If MIPS doesn't support byte and halfword operations, then we can only use ‘load word' (lw) and ‘store word' (sw), which are 32-bit operations. Accordingly, rewrite the code above using only (lw, sw) as memory transfer instructions.

That is all the professor provided for this problem.

Reference no: EM131988113

Questions Cloud

Write an efficient algorithm to solve the given problem : Suppose that you wrote an exhaustive search algorithm. How many possible solutions would you examine? Write an efficient algorithm to solve this problem.
Social perspective of the gold coast : Using a cost benefit analysis understanding, with the social perspective of the gold coast
Write about the colonisation process of australia : You are to select asimple article written about the colonisation process of Australia that portrays the point of view of the coloniser.
Trade liberalization versus trade barriers : [Some Hints: You need to discuss the benefits (gains) and costs of 'trade liberalization (trade openness)' and 'trade barriers (trade autarky)'.
Write a mips code that swaps the variables a and b : Assuming 8-bit operations are supported (lb, lbu, sb), write a MIPS code that swaps the variables a and b.
Describing the various market structures : What other factors should be discussed in describing the various market structures relative to the production process
Calculate Holly total depreciation deduction : On August 8, 2013, Holly purchased a residential apartment building. Calculate Holly's total depreciation deduction for the apartments for 2013 using MACRS
Demand for a particular product is high : How do producers know when the "demand for a particular product is high"? What is the signal?
Why suicide is wrong -write an argument about it : If man as existentialists conceive of him cannot be defined, it is because to begin with he is nothing.

Reviews

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