Starting from:

$30

CE12-Lab 3 MIPS ISA using ​MARS Solved

This lab will introduce you to the MIPS ISA using ​MARS​. You will write a program that iterates through a set of numbers and prints either “Flux,” “Bunny,” or “Flux Bunny.”

Specification
You will write a simple program in the MIPS32 language using the MARS integrated development environment. This program will prompt the user for a number. Next, the program will iterate through a set of integers (starting at 0, ending at the number input by the user) and print to the console one of four outputs depending on the number. If the number is evenly divisible by 5 (with no remainder), then the output is “Flux.” If the number is evenly divisible by 7, then the output is “Bunny.” If the number is divisible by both 5 and 7, then the output should be “Flux Bunny”. Lastly, if the output is not divisible by either 5 or 7, then the number itself should be printed.

An example of the expected output is given below. The output should match this format exactly (note the capitalization convention). There should be a new line character after each output:

Please input a positive integer: 10

Flux Bunny

1

2

3

4

Flux

6

Bunny

8

9

Flux

 It is imperative that your program’s output matches the specification. The prompt should be “Please input a positive integer: ” NOT “Please enter​ ​ a positive integer: ”. There should be one space after the “:” in the prompt. The prompt should be the first text printed to the console. “Flux” and “Bunny” should be capitalized. There should be no space printed after the numbers. A new line character should be printed after the last number.

Your code should end cleanly without error. Make sure to use the exit syscall. You may assume that the user input is a positive integer i.e. no error handling is required.

Files

Lab3.asm

This file contains your code.

Header Comment
Your code should include a header comment with your name, CruzID, date, lab number, course number, quarter, school, program description and notes. Every program you write should include information like this. This is a good opportunity to start developing effective code documentation skills. An example header comment is shown below.

####################################################################################





# Description: This program prints ‘Hello world.’ to the screen.



# Notes:       This program is intended to be run from the MARS IDE.

####################################################################################

Every block or section of code should have a comment describing what that block of code is for. In-line comments should be lined up (using spaces) for ease of readability.

Register Usage
You should only use the temporary ($t) registers for this lab. At the beginning of your code, and optionally at the beginning of each block of code, indicate the functionality of the registers used. For instance, if you are using $t0 and $t1 for the user input and and loop counter, respectively, your comments should include something like the following:

More products