Write a mips assembly language program

Assignment Help Assembly Language
Reference no: EM13771809

For this and all programming assignments for this course, you are to write a MIPS assembly language program that can be loaded and executed using the MARS simulator.

For now, I want your programs confined to the core instruction set of the MIPS processor. All of the instructions we have discussed to date are in the core instruction set. Using the MARS Help facility, you can find these listed under "Basic Instructions". (You'll see a large number of instructions there that use "$f.." registers or mention "FP" in the description. Those are floating point instructions. You can ignore them.)

To insure that your program uses only core instructions, go to the "Settings" menu on MARS and make sure the checkbox labeled "Permit extended (pseudo) instructions and formats" is NOT checked. This way MARS will insure you don't accidentally use a pseudoinstruction.

The program is simple, at least in C++. The first thing I want you to do is write and debug the program in C++.
Here's what the program should do:

1. When prompted, the user will simply input numbers, each followed by Enter (or Return). Your program will prompt the user by outputting a question mark followed by a space.

2. Normally, every time the user inputs a number, the program will respond by displaying the smallest and largest numbers seen so far. Both numbers should be displayed on the same line, with the first number followed by a comma and a space, then the second number, then endl.

3. After the smallest and largest values are displayed, the user will be prompted for the next number.

4. An exception to 2 and 3 above happens when the user enters the number -32768. When this number is entered should display, the sum of the values that have been entered (excluding -32768), after which the program should terminate.

Here's a Sample program session:
? 23
23, 23
? 15
15, 23
? -12
-12, 23
? 52
-12, 52
? -32768
78

Of course, after you have your C++ program completed, the fun begins. You need to translate the C++ code to MIPS assembly language, then test and debug using the MARS simulator until the program works correctly. Make sure your source file has the extension ".asm".

Note that your C++ code should be included in comments, as in my examples.

Reference no: EM13771809

Questions Cloud

Was it fair lewis got the death penalty : Was it fair Lewis got the death penalty, even though she didn't "pull the trigger" in the murders while the actual "gunmen" "only" got life in prison
Improvement in tornado prediction in the future : Have you yourself or do you know anyone that has been personally effected by a tornado? What did you learn from the video that affected you most?
Find a reputable article on the web about : Find a reputable article on the web about how to make your market portfolio an efficient portfolio (or how to win at the stock market). Describe the article (in a few paragraphs) and explain why or why not you think it might work.
Explain how you think understanding culture helps in doing : There is a host of sociological and cultural research that paints a robust picture of the effects of globalization on culture. This Application focuses on the flows of culture between Western and developing nations. As a practitioner in this global e..
Write a mips assembly language program : write a MIPS assembly language program that can be loaded and executed using the MARS simulator.
Case study - california choppers : Here is the first thing you will do in the short term towards your recommendation. Here is a sentence or two explaining more about it.
Write a paper about lingering puritan ideals in hawthorne : Write eight pages paper about "Lingering Puritan ideals in Hawthorne and Melville".
Question regarding the analysis of financial statements : What benefits are gained from research, planning, and the analysis of financial statements? Include sources and citing in APA format for each response.
Describe ways in which globalization has changed business : Globalization has significantly changed social life in cities, disassociating it from territoriality. This has had enormous consequences for political, economic, and cultural institutions. To prepare for this Discussion, read the website, Information..

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

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