Question: 1. Compile the following C code into MIPS: i=0; while (i

1. Compile the following C code into MIPS:

i=0;

while (i<=100) do

{ i=4*i; A[i]=0;}

where integer i is in register $s0 and the base memory address of array A is in$s1.

2. In the following MIPS assembly code, translate all the instructions to their corresponding machine code in hexadecimal format. This code is stored in the memory from address 0x1fff0000. Loop: sw $t1, 4($s0) addi $t1, $t1, -1 sll $t1, $t1, 2 bne $t1, $s5, Exit addi $s0, $s0, 4 j Loop Exit:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!