[Solved] CE12 Lab 3- Looping in MIPS

30 $

SKU: [Solved] CE12 Lab 3- Looping in MIPS Category: Tag:

This lab will introduce you to the MIPS ISA using MARS . You will write a program thatiterates through a set of numbers and prints either “Flux,” “Bunny,” or “Flux Bunny.”Lab PreparationRead chapters 2, 3, and 7 from Introduction To MIPS Assembly Language Programming .Download and walk through Part 1 of the MARS tutorial . You will need to downloadFibonacci.asm .SpecificationYou will write a simple program in the MIPS32 language using the MARS integrateddevelopment environment. This program will prompt the user for a number. Next, theprogram will iterate through a set of integers (starting at 0, ending at the numberinput by the user) and print to the console one of four outputs depending on thenumber. If the number is evenly divisible by 5 (with no remainder), then the outputis “Flux.” If the number is evenly divisible by 7, then the output is “Bunny.” If thenumber 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 beprinted.An example of the expected output is given below. The output should match this formatexactly (note the capitalization convention). There should be a new line characterafter each output:Please input a positive integer: 10Flux Bunny1234Flux6Bunny8Lab 3 Page 1 of 4 Fall 20189FluxNote that part of our grading script is automated, so it is imperative that yourprogram’s output matches the specification. The prompt should be “Please input apositive integer: ” NOT “Please enter a positive integer: ”. There should be onespace after the “:” in the prompt. The prompt should be the first text printed to theconsole. “Flux” and “Bunny” should be capitalized. There should be no space printedafter 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. Youmay assume that the user input is a positive integer i.e. no error handling isrequired.FilesLab3.asmThis file contains your code.Header CommentYour code should include a header comment with your name, CruzID, date, lab number,course number, quarter, school, program description and notes. Every program youwrite should include information like this. This is a good opportunity to startdeveloping effective code documentation skills. An example header comment is shownbelow.##################################################################################### Created by: Last Name, First Name# CruzID# 30 june August 2020## Assignment: Lab 64: Hello World# CMPE 012, Computer Systems and Assembly Language#ankitcoding, Fall 2018## 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 ofcode is for. In-line comments should be lined up (using spaces) for ease ofreadability.Register UsageYou should only use the temporary ($t) registers for this lab. At the beginning ofyour code, and optionally at the beginning of each block of code, indicate thefunctionality of the registers used. For instance, if you are using $t0 and $t1 forthe user input and and loop counter, respectively, your comments should includesomething like the following:# REGISTER USAGE# $t0: user input# $t1: loop counterLab 3 Page 2 of 4 Fall 2018White SpaceLine up instructions, operands, and comments to increase readability. Code should beindented from labels.Bad ExampleLOOP:LI $t1 2 #initialize $t1ADDI $t0 $t0 1 #increment $t0BLT $t0 $t1 LOOP #determine if code should re-enter loopGood ExampleLOOP:LI $t1 2 # initialize $t1ADDI $t0 $t0 1 # increment $t0BLT $t0 $t1 LOOP # determine if code should re-enter loopA Note About TabsIt is preferable to line up comments using spaces as opposed to tabs. Text editorscan have different standards for the width of one tab character. For this reason, itis preferable to line up comments using spaces, not tabs, so that the code appearsthe same regardless of text editor.README.txtThis file must be a plain text (.txt) file. It should contain your first and lastname (as it appears on Canvas) and your CruzID. Your CruzID is your email addressbefore @ucsc.edu. Your answers to the questions should total at least 8 sentenceswith complete thoughts.Your README should adhere to the following template:————————Lab 3: Looping in MIPSCMPE 012 Summer 2018Last Name, First NameCruzID————————-The text of your prompt (“Please input a positive integer: ”) and output strings(“Flux” and “Bunny”) are stored in the processor’s memory. After assembling yourprogram, what is the range of addresses in which these strings are stored?Write the answer here.What were the learning objectives of this lab?Write the answer here.Did you encounter any issues? Were there parts of this lab you found enjoyable?Write the answer here.How would you redesign this lab to make it better?Write the answer here.Lab 3 Page 3 of 4 Fall 2018Grading Rubric6 pts assembles without errors13 pts output matches the specification1 pt format of prompt1 pt format of “Flux”1 pt format of “Bunny”1 pt format of “Flux Bunny”1 pt format of integer2 pts conditions for printing “Flux”2 pts conditions for printing “Bunny”2 pts conditions for printing “Flux Bunny”2 pts conditions for printing integer1 pt complete header comments in code and README1 pt useful & sufficient comments1 pt comment on register usage1 pt clean visual structure / use of white spaceNote: line up instructions, operands, and comments using spacesindent code from labels2 pts readme file complete (should at least 8 sentences total with completethoughts)Lab 3 Page 4 of 4 Fall 2018

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CE12 Lab 3- Looping in MIPS
30 $