Question: You will write a MIPS assembly program that mimics this C + + code: void FizzBuzz ( int a [ ] , int al )

You will write a MIPS assembly program that mimics this C++ code:
void FizzBuzz(int a[], int al){
for (int i =0; i al; i++){
if (a[i]%5==0 && a[i]%3==0)
std::cout FizzBuzz;
else if (a[i]%5==0)
std::cout Buzz;
else if (a[i]%3==0)
std::cout Fizz;
else
std::cout a[i];
}
}
// again you dont need to implement main
int main(){
int arr[10]={1,2,3,4,5,6,7,8,9,10};
int alength =10;
FizzBuzz(arr, alength);
// Expected Output : 12 Fizz 4 Buzz Fizz 78 Fizz Buzz
}
Given: main() does not have any variables in $s registers.
A skeleton assembly program that you will complete to write your code is available to you in the fizzbuzz.asm file. Your solution MUST INCLUDE a well-designed function call.
While FizzBuzz typically counts from 0, your code should work on any arbitrary array. On our end, for testing purposes we may use different arrays, so your code should work with any other valid (non-empty) array.
 You will write a MIPS assembly program that mimics this C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!