CSE 5/7381 Fall 2017 Homework Assignment 4 Assignment 4 – Due Thur., Sep. 21 Submit to Canvas by 11:59p – late homework will not be accepted. MIPS Assembly Code using the MARS tool - please do the problems below. Files for the MARS tool are in the MARS folder in the Files section of Canvas. Please put your name, class (5/7381) and assignment number (4) on your homework. A. MIPS Assembly Code Program For this exercise, you will use the MARS (MIPS Assembler and Runtime Simulator) tool to develop and run MIPS assembly language programs. This is a free Java applet that will run on your PC – please see the Canvas course link on MARS for further information. 1. Download the MARS program, tutorial, and sample MIPS program Fibonacci.asm to your computer. Go through Part 1 of the tutorial to learn how to use the MARS program, including running the sample MIPS programs as directed. Examine the code and step through it so that you understand the instructions used in the code. Also examine the register and data segment contents as they update during execution. Note: you do not have to submit anything for this part – I just want you to get familiar with the MARS program. 2. Create and run MIPS code for the following Java code: j = 10; x = 1; do { x = x * 2; System.out.printf(“%d “,x); j--; } until (j == 0) a. Save the program as an *.asm file – use the first initial of your first name and the first 4 letters of your last name. For example, my file submission name would be tmani.asm. b. Take a screen shot of the MARS console (including Run/IO section) so that the grader can view your results. If you take a screen shot of the entire console, please crop and enlarge the Run/IO section so that it is readable. c. Submit the actual *.asm file so that the grader can run it. d. Turn in your code and output (screen shot) for credit. Make sure that your name appears on both documents that you submit so that you can get proper credit for your work. 1 CSE 7381 Fall 2017 Homework Assignment 5 Assignment 5 – Due SAT., Sep. 23 NOTE: THIS ASSIGNMENT IS ONLY FOR STUDENTS ENROLLED IN CSE 7381 Submit to Canvas by 11:59p – late homework will not be accepted. Additional MARS assignment – please do the problems below. Please put your name, class (7381) and assignment number (5) on your homework. A. Additional MIPS Assembly Code Program For this exercise, you will write another MIPS assembly code program. 1. Download the MIPS program Circle.asm from Canvas. This program calculates the approximate area of a circle, given the radius input by the use. 2. Modify the program to read the length and width of a rectangle from user input, and calculate the area and perimeter of this rectangle. 3. Save the program as an *.asm file – use the first initial of your first name and the first 4 letters of your last name. For example, my file submission name would be tmani.asm. 4. Run your program using the following values: a. Length = 5, width = 10 b. Length = 4, width = 4 c. Length = 8, width = 2 5. Take a screen shot of the MARS console (including Run/IO section) so that the grader can view your results. If you take a screen shot of the entire console, please crop and enlarge the Run/IO section so that it is readable. 6. Submit the actual *.asm file so that the grader can run it. 7. Turn in your code and output (screen shot) for credit. Make sure that your name appears on both documents that you submit so that you can get proper credit for your work. 1 ...