Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Anonymous
Anonymous asked in TravelLatin AmericaEcuador · 3 months ago

How to convert the following MIPS assembly instructions to C statement?

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.

a.

sll $s2, $s4, 1

add $s0, $s2, $s3

add $s0, $s0, $s1

b.

sll $t0, $s0, 2

add $t0, $s6, $t0

sll $t1, $s1, 2

add $t1, $s7, $t1

lw $s0, 0($t0)

addi $t2, $t0, 4

lw $t0, 0($t2)

add $t0, $t0, $s0

sw $t0, 0($t1)

There are no answers yet.
Be the first to answer this question.