2.7 5<S$2.2, 2.3> Translate the following C code to RISC-V. Assume that the variables f, g, h, i, and j are assigned to registers x5, x6. x7. x28, and x29, y. Assume that the base address of th...
2.4 For the RISC-V assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers x5, x6, x7, x28, and x29, respectively. Assume that the base address of the arrays A and B are in registers x10 and x11, respectively. silix30, x5, 3 // x30=f*8 add x30, x10, x30 // x30=&A [f] s111 x31, x6 , 3 // x31 = g.8 add x31, x11, x31 // x31=&B [g]...
Translate the following C code to LEGv8. Assume that the variables f, g, h, i, and j are assigned to registers X0, X1, X2, X3, and X4, respectively. Assume that the base address of the arrays A and B are in registers X6 and X7, respectively. Assume that the elements of the arrays A and B are 8-byte words: B[8] = A[i] + A[j];
1 slli x30, x5, 3 add x30, x10, x30 slli x31, x6, 3 add x31, x11, x31 ld x5, 0(x30) addi x12, x30, 8 ld x30, 0(x12) add x30, x30, x5 sd x30, 0(x31) // x30 = f*8 // x30 = &A[f] // x31 = g*8 // x31 = &B[g] // f = A[f] For the RISC-V assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers...
Problem 2.4: For the RISC-V assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers x5, x6, x7, x28, and x29, respectively. Assume that the base address of the arrays A and B are in registers x10 and x11, respectively. х30, х5, 3 add x30, x10, х30 // x30 %3D &A[F] slli x31, х6, 3 add x31, x11, х31 // х31 %3D &B[g] x5, 0(х30) // x30...
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
Problem 1 (15 points) Translate the C code below into RISC-V, knowing that the values of i and j are in registers x28 and x29, respectively. The base address of array B is in register x30, and the base address of array C is in register x31.
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
3. Assume that the variables £, g, i are assigned to registers $so, $s1, 5s2 respectively. Assume that the base address of arrays A, B, C are in registers Ss6, Ss7, Ss8 Write down MIPS instructions that implement the following C statement: (a) f = g- A(B [C[B+1]]]; 3. Assume that the variables £, g, i are assigned to registers $so, $s1, 5s2 respectively. Assume that the base address of arrays A, B, C are in registers Ss6, Ss7, Ss8...
solve asap and will rate 8. Assume that the variables£ Assume that the base address of arrays A, B are in registers Ss6, Ss7 , g, i are assigned to registers $s0, 5s1, 5s2 respectively. Write down MIPS instructions that implement the following C statement: (a) f = g-A(B [811; 8. Assume that the variables£ Assume that the base address of arrays A, B are in registers Ss6, Ss7 , g, i are assigned to registers $s0, 5s1, 5s2 respectively....
For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables i andj are assigned to registers $50 and $s1, respectively and the base address of the arrays A and B are in registers $s6 and $57, respectively. B[i] = A[B[j]+12];