Page 1 of 1

Overview: Today we practice MIPS assembly and learn instructions for logical operators. Develop and run your code on CPU

Posted: Mon Jun 06, 2022 1:46 pm
by answerhappygod
Overview Today We Practice Mips Assembly And Learn Instructions For Logical Operators Develop And Run Your Code On Cpu 1
Overview Today We Practice Mips Assembly And Learn Instructions For Logical Operators Develop And Run Your Code On Cpu 1 (93.11 KiB) Viewed 20 times
Overview: Today we practice MIPS assembly and learn instructions for logical operators. Develop and run your code on CPULator: https://cpulator.01xz.net/?sys-mipsr5b Please refer to CPULator Guide on Moodle for instruction on how to use CPULator. Practice 1: Shift operation can be used as multiplication or divide by two. Let's verify this via emulator: addi $s0, $zero, 16 sll $s1, $s0, 1 sll $s2, $s0, 2 sll $s3, $s0, 3 srl $S4, $s0, 1 srl $55, $s0, 2 srl $S6, $s0, 3 Verify that after running this sequence, values of S1, S2, S3, S4, S5, S6 are 32, 64, 128, 8, 4, and 2. When ready, copy your MIPS assembly code from emulator and save as a text file. Submit this file on Moodle. Practice 2: Let's compile following C sequence for MIPS and run on the emulator (implement multiply by 2 as shift left): int i = 0; // map to S2 int sum = 0; // map to S3 // map to S4 int N = 512; for (i = 1; i < N; i = i * 2) { sum = sum + i; } Verify that after running this sequence, value of S3 is 511. When ready, copy your MIPS assembly code from emulator