# i, j in $s0, $s1 # A, B in $s6, $s7 # B[i] = A[B[j] + 12]; sll $t0, $s1, 2 # making j indexable add $t0, $t0, $s7 # $s0 = &B[j] lw $t0, 0($t0) # $t0 = B[j] addi $t0, $t0, 12 # $t0 = B[j] + 12 sll $t0, $t0, 2 # making B[j] + 12 indexable add $t0, $t0, $s6 # $t0 = &A[B[j] + 12] lw $t0, 0($t0) # $t0 = A[B[j] + 12] sll $t1, $s0, 2 # making i indexable add $t1, $t1, $s7 # $t1 = &B[i] sw $t0, 0($t1) # B[i] = A[B[j] + 12]
For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables...
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
Please answer the following questions involving MIPS assembly code: A) For the C statement below, what is the corresponding MIPS assembly code? Assume f, g are stored in S1 and S2. f = g + (-f -5) B) For the C statement below, what is the corresponding MIPS assembly code? Assume i and j are assigned in registers S1 and S2 respectively and base of address of arrays A and B are in registers S6 and S7. B[8] = A[i...
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 the arrays hold 16-bit integer values, $ s0 is the base for array X, $ s1 is the base for array Y, and $ t0 and $ t1 are index variables i and j respectively. Comment code X [j] = Y [i + j];
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
Assignment 3 Translate the following MIPS code to C. Assume that the variables f, g, h, i and j are assigned to registers Ss0, Ss1, Ss2, Ss3 and Ss4, respectively. Assume that the base address of the arrays A and B are in registers Ss6 and $s7, respectively. addi St0, Ss6, 4 add $t1, $s6, $0 #register $0 always holds 320s sw St1, 0(Sto) add Ss0, St1, Sto
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]
For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, and i are given and could be considered 32-bit integers as declared in a C program. Use a minimal number of MIPS assembly instructions: f g(h 5); For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, and i are given and could be considered 32-bit integers as declared in a C...
The relative time ratings of exercises are shown in square brackets after each exercise number. On average, an exercise rated [10] will take you twice as long as one rated [5]. Sections of the text that should be read before attempting an exercise will be given in angled brackets; for example, <1.3> means you should have read Section 1.3, Under the Covers, to help you solve this exercise. 2.1 [5] For the following C statement, what is the corresponding MIPS...
Translate the following C code to MIPS assembly. Assume that the values of a, b, i, and j are in registers $s0, $s1, $t0, and $t1, respectively. Also assume that $s2 holds the base address of the array D. for (i = 0: i < a: i++) for (j = 0: j < b: j++) D[2 * j] = i + j;