Translate the C function below to MIPS assembler. Fill in the table of where all
ID: 3841607 • Letter: T
Question
Translate the C function below to MIPS assembler. Fill in the table of where all variables you use are stored. You may assume that parameter arr is the address of the first element in an array of integers, and that arr contains n elements, where n > 0. You may assume that each int is 32 bits, and that % is the modulo operator. Make sure you comment each lines of MIPS code so it is easy to follow. Follow the procedure calling convention. Ask for more paper if needed and attach it. int evens(int arr[], int n) {int i = 0; int num = 0; for (i = 0; iExplanation / Answer
arr is stored in HEAP
i, n and num is stored in stacK
Explanation :
Automatic and Local variables are stored in stack
Dynamically alocated memory are allocated in HEAP
Hence the answer, function call parameters are stored in stack
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.