2023 For this and all programming assignments for this course you are to | Assignment Collections
Computer Science 2023 C++ And MIPS
2023 For this and all programming assignments for this course you are to | Assignment Collections
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.
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.