CS201 Lab: Arithmetic Operations and Debugging
Objective of this lab:
To investigate Arithmetic Operations and implement them in Spim.
Preparation
Read lab lecture notes.
Lab Assignment
Program#1:
Write a SPIM assembly language program convertF2C.s.
The program will do the following:
- Prompt the user to enter a temperature in Fahrenheit
- Convert it to Celsius
- Print out the converted values of the input 100, 0, and 70 with appropriate message
Here are the two formulas for your reference.
F = (9 * C / 5) + 32
C = 5 * (F - 32) / 9
Program#2:
Write a SPIM assembly language program equation.s based on the example
program math1.s in the lab notes.
The program will do the following:
- Prompt the user to enter a value for X
- Calculate the result of A*X^2+B*X+C, keep A, B and C values the same as before.
- Print out the calculated results of the input value 7, 5, and 9 with appropriate message
You will hand in the following:
- The source code in the file convertF2C.s and equation.s
- Display the program code in .pdf
- The screenshot to show the screen right after you loaded the .s file.
- The screenshot of the console displaying the results
- You are asked to submit one .pdf file and all the .s files. If you miss any one of them, you will get 0 marks.
Please note:
To make it easier for marking, you are required to submit the following files:
- One .pdf file and all the .s file, they contain all the required components for the lab assignment.
- Missing any one of the files (.pdf or .s files) you will get zero for the assignment.
- Submitting with other file format such as .zip or .doc, you will lose 5 marks.
- This will apply to Lab #6 to Lab #9.
Copyright: Department of Computer Science, University of Regina.