You are required to turn in the following source file: assignment7.s Objectives:
ID: 3887051 • Letter: Y
Question
You are required to turn in the following source file:
assignment7.s
Objectives:
-write assembly language programs to:
-define a recursive procedure and call it.
-use syscall operations to display integers and strings on the console window
-use syscall operations to read integers from the keyboard.
Assignment Description:
Implement a MIPS assembly language program that defines "main", and "function1" procedures.
The function1 is recursive and should be defined as:
function1(n) = 2*n if n <= 4
= n*function1(n-2) + function1(n-3) + n otherwise.
The main asks a user to enter an integer for n and calls the function1 by passing the n value, then prints the result. If your program causes an infinite loop, press Control and 'C' keys at the same time to stop it. Name your source code file assignment7.s.
C program that will ask a user to enter an integer, calls the fuction1, and prints the returned value from the function1.
The following is a sample output (user input is in bold):
Enter an integer:
8
The solution is: 527
--------------------------------------------------
What to turn in:
-Upload your assignment7.s file through the assignment submission link in the Blackboard by the assignment deadline. You must have your name, email address, program description, and other information in the header block as it was described in the assignment 1, and your programs should be well commented.
Each procedure needs to have a header using the following format:
############################################################################
# Procedure findMax
# Description: -----
# parameters: $a0 = address of array, $a1 = length
# return value: $v0 = max
# registers to be used: $s3 and $s4 will be used.
############################################################################
Explanation / Answer
MIPS program for your C-program:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.