For the MIPS assembly instructions below, what is the corresponding C++ statement? Assume that the base address of arrays A and B are in registers $s6 and $57, respectively. Iw $0, 0($s6) addi $s0, $s0, 5 Iw $1, 4($s6) add $s0, $s0, $s1 Iw $s1, 8($s6) add $s0, $s0, $s1 sw $s0, 0($s7) O B[O] = A[5] O A[0] = B[0] + B[1] + B[2] O B[O] = A[0] + A[1] + A[2] + 5 %3D O B[O] = A[0] + A[4] + A[8]

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter4: Processor Technology And Architecture
Section: Chapter Questions
Problem 12VE
icon
Related questions
Question
For the MIPS assembly instructions below, what is the corresponding C++ statement?
Assume that the base address of arrays A and B are in registers $s6 and $57, respectively.
Iw $s0, 0($s6)
addi $s0, $s0, 5
Iw $s1, 4($s6)
add $$0, $s0, $s1
Iw $1, 8($s6)
add $s0, $s0, $s1
sw $s0, 0($s7)
O B[O] = A[5]
O A[O] = B[0] + B[1] + B[2]
O B[O] = A[0] + A[1] + A[2] + 5
B[0] = A[O] + A[4] + A[8]
Transcribed Image Text:For the MIPS assembly instructions below, what is the corresponding C++ statement? Assume that the base address of arrays A and B are in registers $s6 and $57, respectively. Iw $s0, 0($s6) addi $s0, $s0, 5 Iw $s1, 4($s6) add $$0, $s0, $s1 Iw $1, 8($s6) add $s0, $s0, $s1 sw $s0, 0($s7) O B[O] = A[5] O A[O] = B[0] + B[1] + B[2] O B[O] = A[0] + A[1] + A[2] + 5 B[0] = A[O] + A[4] + A[8]
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning