The practical assignment MUST includes:source code file and report
´Source code file MUST be named as labID_questionID_subquestionID.s
such as: lab2_1_1.s, lab2_1_2.s, lab2_2.s
´Your code MUST be run on QtSpim/Mars correctly.
´Report should includes the practical topic, the main part of the code and its comments, the testing results, the problems and resolutions in the practical work.(Submit the pdf file).
Lab2
´Question 1:
´A Students return to school from home. It took H1 hours and M1 minutes to get to the transfer station first, and then he choose to take the high-speed rail from the transfer station to return to school. The transfer station is S kilometers away from the school. The average speed of the high-speed rail is: R kilometers per hour.
´It is asked How long does it take to go to the school from the home (for example, if it took 157 minutes, then your program should print out: Takes 2 hours and 37 minutes) (there is no need to consider overflow or floating data)
´— H1, M1, S, R is defined in the assembly source file
´— H1, M1, S, R is determined by user
´Question 2:
´Given the original string “abc”, make a new String with 6 character as “aAbBcC” and print out.
NOTIC:
there is at lease two String in your memory , 1st one is the “abc” which is initialed in your Data segment ,2nd one is created in the Data segment,while be re-assigned based on the 1st one in the TEXT segment.
Lab9
The objective of this experiment(实验目的):
Learn the difference between integer and float point data in MIPS,Learn the infinite and NaN in float point data, Practice the usage of floating register and the conditional flags in Co-processor 1, Practice on load,store,move,arithmetic,compare and branch instructions on float point data.
The contents of this experiment(实验内容):
Q1. Calculate the square root of an integer number without using “sqrt.s” and “sqrt.d”
1) Get the input data (integer) and the precision value(such as 0.01) from input device
2) If the input data is a negative number, print out the warning message and exit
3) If the input data is a positive number, calculate its square root value which can satisfy the accuracy requirement and print it out
Q2. Suppose 3 students attends a quiz with 5 questions, score of every question could be a float point number ranges from 0 to 5.0(such as 0.5, 1.0, 3.5.etc)
1) Get the scores of each question of each student
Suppose user input the following data, (5 4.5 3.5 4 3 ) is the score list of one student, 5 is the score of 1st question,4.5 is the score of 2nd question.etc.
5 4.5 3.5 4 3
3 2 2 1.5 1
4 3.5 5 4.5 3
2) calculate the total score of this quiz for every students and print out
3) calculate the average of every question and print out
4) calculate the average of all the question and print out
5) find all the index of the question in this quiz whose performance is not so good(the average score of the question is lower than the total average), print the index of this question and its corresponding average score.
Submission:
1) Assembly file(2 assembly files) with the same naming rules as lab2_assignment (comments is needed).
2) Report (pdf file):
a) Using the same template of report as lab2_assignment
b) The topic and content of this experiment has listed already.
c) The steps of experiment SHOULD include the description of the design idea of your code, the settings on Mars(MIPS simulator) if needed, the testing result.
d) The analysis of experiment and summary can be merged if needed.