CS201 Lab: Procedure Calls
Objective of this lab:
In this lab assignment, you are going to practice
implementing procedure calls in SPIM.
Preparation
Read lab lecture notes.
Lab Assignment
Program:
Write a SPIM assembly language program num-vowel.s to find out the number of vowels
and the number of non-vowels in a given string and use procedure call to
check if a letter is vowel or not. (Hint: The example program Is-vowel.s in the lab notes
is very helpful.)
The program will do the following:
- Prompt the user to enter a string.
- Read letters in the string from the beginning to the end.
- The program will call the procedure vowelp
to check if a character entered in the string is a vowel or not.
- Count how many vowels and how many other characters are in the string.
- Print out the calculated results with appropriate message.
- Hint: A loop is needed.
You will hand in the following:
- The source code in the file num-vowel.s
- The print out of the screen shot (print screen) to show the program
has been successfully loaded.
- The print out of the screen shot of the console displaying the testing result
for "I am going to run this program with the real hardware in two weeks."
Copyright: Department of Computer Science, University of Regina.