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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 18 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 18 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply