CSE/EEE230 Assignment7 Solved

49.99 $

Description

5/5 - (2 votes)

Minimal Submi ed Files

You are required to turn in the following source file:
assignment7.s
Objec ves:

-write assembly language programs to:
-define a recursive procedure/function 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) = 5*n + 14 if n <= 3
= function1(n-1)/n + n*function1(n-3) + 4*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:
9
The solution is: 2207
————————————————–

What to turn in:

Go to “GradeScope” tab on Canvas -> CSE/EEE230 -> Assignment7, and upload your program file.

Each procedure/function needs to have a header using the following format:
############################################################
################
# Procedure/Function function1
# Description: —–
# parameters: $a0 = n value
# return value: $v0 = computed value
# registers to be used: $s3 and $s4 will be used.
############################################################
################

Grading Criteria:
____/ 5 Documentation (header with your name, your information, and program description and comments within your code, each function needs to have a header of the format described above)
____/ 1 Indentation and spacing (easy to read)
____/ 6 Required functions (function1 and main) and functionalities implemented
____/ 8 Produces correct results?
Total points: 20

ASU disclaimer (http://www.asu.edu/asuweb/disclaimer/)
Copying any content of this page will be a violation of the copy right.

  • assn7-vi3zlv.zip