Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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; i

Explanation / 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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote