Docsity

MIPS Program Assignment for Computer Architecture Course, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
Program Assignment Number Four
CSC 320
Computer Architecture
Spring Semester 2008
Due February 26, 2008
Write a MIPS program which will prompt the user to input a positive integer value which is to be raised to
a power. The user should then be prompted to input the power to which the value should be raised. Your
program should raise the first value to the power of the second value.
Your program must contain:
The usual required main function.
A separate function to prompt for and input the required values.
A separate function to recursively perform the required operation
A separate function to print the result.
The output should be “ X raised to the Y power is Z”.
One additional note: You must indicate in your header information which assembler you
are using. Also, make the first line of your source code a comment indicating which
assembler you are using. A 10 point penalty will be applied to any program turned in
which does not do this. Many of you are already doing it.
For example:
#MARS
OR
#SPIM….. then write your program.

Partial preview of the text

Download MIPS Program Assignment for Computer Architecture Course and more Assignments Computer Architecture and Organization in PDF only on Docsity!

Program Assignment Number Four CSC 320 Computer Architecture Spring Semester 2008 Due February 26, 2008 Write a MIPS program which will prompt the user to input a positive integer value which is to be raised to a power. The user should then be prompted to input the power to which the value should be raised. Your program should raise the first value to the power of the second value. Your program must contain: The usual required main function. A separate function to prompt for and input the required values. A separate function to recursively perform the required operation A separate function to print the result. The output should be “ X raised to the Y power is Z”.

One additional note: You must indicate in your header information which assembler you

are using. Also, make the first line of your source code a comment indicating which

assembler you are using. A 10 point penalty will be applied to any program turned in

which does not do this. Many of you are already doing it.

For example:

#MARS

OR

#SPIM….. then write your program.