Page 1 of 1

Practice 3: Let's compile following C sequence for MIPS and run on the emulator: int divide (int N, int M) { // map q an

Posted: Mon Jun 06, 2022 1:47 pm
by answerhappygod
Practice 3 Let S Compile Following C Sequence For Mips And Run On The Emulator Int Divide Int N Int M Map Q An 1
Practice 3 Let S Compile Following C Sequence For Mips And Run On The Emulator Int Divide Int N Int M Map Q An 1 (104.1 KiB) Viewed 20 times
Practice 3 Let S Compile Following C Sequence For Mips And Run On The Emulator Int Divide Int N Int M Map Q An 2
Practice 3 Let S Compile Following C Sequence For Mips And Run On The Emulator Int Divide Int N Int M Map Q An 2 (104.1 KiB) Viewed 20 times
Practice 3: Let's compile following C sequence for MIPS and run on the emulator: int divide (int N, int M) { // map q and i to $s2 and $s3. int q = 0; int i = N; while (i > 0) { q += 1; i = i M; } return q; } int multiply (int N, int M) { // map sum and int sum = 0; for (int i = 0; i < N; ++i) { sum += M; } return sum; } int main() { // map a, b, c, k, and j to $s0, $s1, $s2, $s3, and $s4 int a = 4; int b = 5; int c = 120; int k = multiply (a, b); int j divide (c, k); Make sure multiply procedure properly gets backup of $s0 to $s4. Verify that after running this sequence value of SO is (4) 10 . value of S1 is (5) 10 value of S2 is (120) 10 value of S3 is (20) 10 value of S4 is (6)10 When ready, copy your MIPS assembly code from emulator and save as a text file. Submit this file on Mo i to $s0 and $s1

Practice 3: Let's compile following C sequence for MIPS and run on the emulator: int divide (int N, int M) { // map q and i to $s2 and $s3. int q = 0; int i = N; while (i > 0) { q += 1; i = i M; } return q; } int multiply (int N, int M) { // map sum and int sum = 0; for (int i = 0; i < N; ++i) { sum += M; } return sum; } int main() { // map a, b, c, k, and j to $s0, $s1, $s2, $s3, and $s4 int a = 4; int b = 5; int c = 120; int k = multiply (a, b); int j divide (c, k); Make sure multiply procedure properly gets backup of $s0 to $s4. Verify that after running this sequence value of SO is (4) 10 . value of S1 is (5) 10 value of S2 is (120) 10 value of S3 is (20) 10 value of S4 is (6)10 When ready, copy your MIPS assembly code from emulator and save as a text file. Submit this file on Mo i to $s0 and $s1