Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The purpose of this assignment is to let you be familiar with assembly programming using MIPS; all the programs should be tested using SPIM/QtSPIM/XSPIM, the
The purpose of this assignment is to let you be familiar with assembly programming using MIPS; all the programs should be tested using SPIM/QtSPIM/XSPIM, the MIPS assembler and simulator. Submission: For this assignment, you must submit your results and your programs online via Canvas by uploading a) a pdf file (named "hw3-Firstname-Lastname.pdf", which includes the results from your programs), b) the MIPS programs that you have written as individual files. Here replace "Firstname" using your first name and replace "Lastname" using your last name in the file name. Problem 1 (20 points) Below is a C (C++) function int set (int all, int n, int v) int for i; a[i] return i; (i=n-1; i >= 0; i--) =v; Translate this function to an equivalent function in MIPS assembly and name your file as "set.s". You need to follow the MIPS calling convention and others should be able to call and use your function. In other words, the address of the array a should be passed in using register Sa0, the value of n in register Sal, and the value of v in register Sa2. You need to test your program using "test_set.s" (http://www.cs.fsu.edu/liux/courses/cda3100/assignments/test set.s) and include the running results (shown on the console) in the pdf file to be submitted. The purpose of this assignment is to let you be familiar with assembly programming using MIPS; all the programs should be tested using SPIM/QtSPIM/XSPIM, the MIPS assembler and simulator. Submission: For this assignment, you must submit your results and your programs online via Canvas by uploading a) a pdf file (named "hw3-Firstname-Lastname.pdf", which includes the results from your programs), b) the MIPS programs that you have written as individual files. Here replace "Firstname" using your first name and replace "Lastname" using your last name in the file name. Problem 1 (20 points) Below is a C (C++) function int set (int all, int n, int v) int for i; a[i] return i; (i=n-1; i >= 0; i--) =v; Translate this function to an equivalent function in MIPS assembly and name your file as "set.s". You need to follow the MIPS calling convention and others should be able to call and use your function. In other words, the address of the array a should be passed in using register Sa0, the value of n in register Sal, and the value of v in register Sa2. You need to test your program using "test_set.s" (http://www.cs.fsu.edu/liux/courses/cda3100/assignments/test set.s) and include the running results (shown on the console) in the pdf file to be submitted
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started