write a MIPS code please and not any other code. Objectives: -write assembly lan
ID: 3751464 • Letter: W
Question
write a MIPS code please and not any other code.
Objectives:
-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) = (3*n)-5 if n <= 3
= (n-1)*function1(n-1) + function1(n-2) - 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.
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: 7842
--------------------------------------------------
Each procedure/function needs to have a header using the following format:
############################################################################
# Procedure/Function function1
# Description: -----
# parameters: $a0 = address of array, $a1 = length
# return value: $v0 = max
# registers to be used: $s3 and $s4 will be used.
############################################################################
Explanation / Answer
/*if u havin any problem comment down pls before rating i really like to help you */
So here #function function1 is used to produce the result of the input
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.