We are to Write Code Corresonding to A[11] = A[10] + Y in MIPS
IT is given that Y is stored in $s1 and base address of array A is $s3
We will follow following steps to write full code
1). We will store address of A[10] and A[11] in registers $t0 and $t1
(i) we will store 10 and 11 in register $t0 and $t1 respectively using addi
(ii) multiply the content of $t0 and $t0 by 4 using shift left operation
(iii) will add value of base address of array to $t0 and $t1 and store result in $t0 and $t1 respectively.
$t0 and $t1 now contains address of A[10] and A[11] respectively.
2).
(i)fetching A[10] in register $t2
(ii)then adding A[10] with value of Y which is stored in $s1.
3).
FINALLY we stored A[10]+Y in memory location A[11] using $t1
Following Image contains full code along with explananation of each line of code

addi $t0,$zero,10 # $t0 = 10
addi $t1,$zero,11 # $t1 =11
sll $t0,$t0,2 #left shift by 2 or multiply by 4 $t0 = $t0*4
sll $t1,$t1,2 # $t1=$t*4
add $t0,$t0,$s3 # $t0 = & A[11]
add $t1,$t1,$s3 # $t1 = &A[11]
lw $t2,0($t0) #fetching A[10] in register
add $t2,$t2,$s1 # $t2 = Y+A[10]
sw $t2,0($t1) # A[11] = A[10]+Y
Question 7 Convert C code into MIPS code: A[11] = A[10] +Y Assume Y in $sl...
1. Convert the following C statement to MIPS code. Assume x, y and z are assigned to registers $s0, $s1 and $s2 respectively and the starting address of array A is $s6. x = y + z + A[3] 2. 2.Convert the following C statement to MIPS code. Assume the base address of array A is $s3 and h is assigned to register $s2 . A[7] = h + A[7]
Question 3 (10 points) Convert the following MIPS assembly code into machine language. Write the instruction in hexadecimal. The opcode for sw 43 (101011). sw St1, -4(St3) Question 4 (10 points) Consider the following MIPS assembly code: addi $s3, $0, 5 addi $s1, S0, 3 addi Ss1, $s1, 2 beq Ss3, Ssl, target addi Ss1, Ss1, 1 target: add Ss3, Ss1, Ssl a. After running the code, what is the value of Ss3? b. If the memory address of the...
C2. Convert the following c-code to MIPS code. The base memory address of the array a is 0x8000_400C, which must be loaded in the base register Ss0. Register assignments: int a[10]; while (i !- 10) 1 if ( i%2 == 0) a[i] = i * 2; else ail - i* 3 i++i
C2. Convert the following c-code to MIPS code. The base memory address of the array a is 0x8000_400C, which must be loaded in the base register Ss0. Register...
C code to MIPS Translate the following C command into MIPS assembly. Assume that the base address of arrays A is stored in register $s1. 시 I-A[2] + 7;
2.9 5 $2.2, 2.3> Translate the following C code to MIPS. Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address of the arrays A and B are in registers $s6 and $s7, respectively. Assume that the elements of the arrays A and B are 4-byte words: fAlBg
For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables i, and j are assigned to registers $s0, $s1, respectively. Assume that the base address of the arrays A and B are in registers $s2 and $s3, respectively. B[i] = A[i] - 10
C3. Convert the following C-code to MIPS code. [Use register $al for the variable i, temporary registers for other values, and load the base memory address of the array OxA0000080 to Şao] int i i int array [101; for (i= 0; i<5 ; i=i+1 ) { [i+1] [i] 8; * array = array
C3. Convert the following C-code to MIPS code. [Use register $al for the variable i, temporary registers for other values, and load the base memory address of...
Translate the following C code to MIPS assembly code. Assume that the value of i is in register $t0, and $s0 holds the base address of the integer MemArray if (i > 10) MemArray[i] = 0; else MemArray[i] = -MemArray[i];
7. Translate the following C code to MIPS assembly code. Use a minimum number of instructions. Assume that the values of a,b, i and j are in registers Ss0, Ss1, St0, and St1, respectively. Also, assume that register SS2 holds the base address of the array D. for(i-0; i<a; i++) for(j=0 ; j<b; j++)
CS51 Lab 8 1. Assume x goes to Ss0, y goes to $s1, and z goes to Ss2. Convert the following C code to MIPS. Use labels Else, Exit, and Loop when needed MIPS if (x== y) { y=y+z; else z=z-x; while (x < z) ( y=y-z; for (int x=1; x < 5; x++){ Y--i Assume x goes to $a0, y goes to Sa1, and z goes to $a2. Convert the folowing C code to MIPS. Include a statement to...