1a. Using the MIPS program below (with bugs intact), determine the instruction format for each instruction and write the decimal values of each instruction field.
addi $v0, $zero, 0
loop: lw $v1, 0($a0)
sw $v1, 0($a1)
sll $a0, $a0, 2
add $a1, $a1, $a0
beq $v1, $zero, loop
1b. Translate the following C/Java code to MIPS assembly code. Assume that the values of a, i, and j are in registers $s0, $t0, and $t1, respectively. Assume that register $s2 holds the base address of the array A (add comments to your MIPS code).
j = 0;
for(i=0 ; I<a; i++)
A[i]= i+ j++;
PLEASE PROVIDE A LIKE FOR WORK AND TIME SPENT ON IT...DONT SIMPLY DISCOURAGE WORK IF YOU HAVE ANY DOUBTS PLEASE COMMENT
Get Answers For Free
Most questions answered within 1 hours.