Overview: Today we practice MIPS assembly and learn instructions for logical operators. Develop and run your code on CPU
Posted: Thu Jun 02, 2022 7:45 am
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 $80, $zero, 16 sll $s1, $s0, 1 sll $s2, $s0, 2 sll $s3, $80, 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 $2 int sum= 0; // map to $3 int N = 512; // map to $4 for (i=1;i< N; i = i * 2) { sum sum + i; Verify that after running this sequence, value of $3 is 511. When ready, copy your MIPS assembly code from emulator and save as a text file. Submit this file on Moodle. S S OH IE 27
Overview: Today we practice MIPS assembly and learn instructions for logical operators. Develop and run your code on CPULator: